MySQL 8.0.40
Source Code Documentation
plugin_validate_password.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
25#define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
26
27/**
28 @file include/mysql/plugin_validate_password.h
29 API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN)
30*/
31
32#include <mysql/plugin.h>
33#define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100
34
35typedef void *mysql_string_handle;
36
37/**
38 This plugin type defines interface that the server uses to
39 enforce a password policy.
40
41 The policy is enfoced through st_mysql_validate_password::validate_password()
42 that answers the question of whether this password is good enough or not.
43
44 There's one auxiliary function
45 st_mysql_validate_password::get_password_strength() that can be used by
46 password changing UIs to display a password strength meter as the user enters
47 a password.
48
49 Since plugins may need that functionality there's a plugin service
50 @ref mysql_password_policy_service_st exposing
51 it to other plugins.
52
53 There also is a default password policy plugin
54 "validate_password" built into the server binary that
55 implements this plugin API.
56
57 @sa mysql_password_policy_service_st
58*/
61 /**
62 Checks if a password is valid by the password policy
63
64 @param password The password to validate
65 @retval true password meets the password validation plugin policy
66 @retval false password does not meet the validation policy
67 */
69 /**
70 Calculates the strength of a password in the scale of 0 to 100.
71
72 @param password The password to evaluate the strength of
73 @return The strength of the password (0-100)
74 */
76};
77#endif
static char * password
Definition: mysql_secure_installation.cc:56
void * mysql_string_handle
Definition: plugin_validate_password.h:35
This plugin type defines interface that the server uses to enforce a password policy.
Definition: plugin_validate_password.h:59
int(* validate_password)(mysql_string_handle password)
Checks if a password is valid by the password policy.
Definition: plugin_validate_password.h:68
int interface_version
Definition: plugin_validate_password.h:60
int(* get_password_strength)(mysql_string_handle password)
Calculates the strength of a password in the scale of 0 to 100.
Definition: plugin_validate_password.h:75