MySQL 8.0.32
Source Code Documentation
service_mysql_password_policy.h File Reference

Definitions for the password validation service. More...

Go to the source code of this file.

Classes

struct  mysql_password_policy_service_st
 This service allows plugins to validate passwords based on a common policy. More...
 

Functions

int my_validate_password_policy (const char *, unsigned int)
 Invoke the component/plugin to validate the input password. More...
 
int my_calculate_password_strength (const char *, unsigned int)
 Invoke the component/plugin to evalue the strength of a password. More...
 

Variables

struct mysql_password_policy_service_stmysql_password_policy_service
 

Detailed Description

Definitions for the password validation service.

Function Documentation

◆ my_calculate_password_strength()

int my_calculate_password_strength ( const char *  password,
unsigned int  password_len 
)

Invoke the component/plugin to evalue the strength of a password.

Implementation of a plugin service mysql_password_policy_service_st method. Typically called when new user is created or existing password is changed. Calls the validate_password_plugin / validate_password_component plugin's / component's st_mysql_validate_password::get_password_strength method. Constructs a temporary binary String object out of the password supplied.

Parameters
passwordpassword which needs to be validated against the defined policies
password_lenlength of password
Returns
password strength score (0-100)
See also
st_mysql_validate_password, mysql_password_policy_service_st::my_calculate_password_strength_func

◆ my_validate_password_policy()

int my_validate_password_policy ( const char *  password,
unsigned int  password_len 
)

Invoke the component/plugin to validate the input password.

Implementation of a plugin service mysql_password_policy_service_st method. Calls the validate_password_plugin / validate_password_component plugin's / component's st_mysql_validate_password::validate_password method. Constructs a temporary binary String object out of the password supplied.

Parameters
passwordpassword which needs to be validated against the defined policies
password_lenlength of password
Return values
0Password OK
1Password incompatible with policy
See also
st_mysql_validate_password, mysql_password_policy_service_st::my_validate_password_policy_func