MySQL 8.0.39
Source Code Documentation
password_policy_service.cc File Reference
#include <assert.h>
#include <stddef.h>
#include "lex_string.h"
#include "m_ctype.h"
#include "m_string.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql/plugin.h"
#include "mysql/plugin_validate_password.h"
#include "mysqld_error.h"
#include "sql/current_thd.h"
#include "sql/mysqld.h"
#include "sql/sql_plugin.h"
#include "sql/sql_plugin_ref.h"
#include "sql_string.h"
#include <mysql/components/service_implementation.h>
#include <mysql/components/services/validate_password.h>

Functions

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

Variables

LEX_CSTRING validate_password_plugin = {STRING_WITH_LEN("validate_password")}
 Static name of the built in plugin used by mysql_password_policy_service_st for password validation. More...
 

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

Variable Documentation

◆ validate_password_plugin

LEX_CSTRING validate_password_plugin = {STRING_WITH_LEN("validate_password")}

Static name of the built in plugin used by mysql_password_policy_service_st for password validation.