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