MySQL  8.0.22
Source Code Documentation
service_mysql_password_policy.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
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_SERVICE_MYSQL_PLUGIN_AUTH_INCLUDED
24 #define MYSQL_SERVICE_MYSQL_PLUGIN_AUTH_INCLUDED
25 
26 /**
27  @file include/mysql/service_mysql_password_policy.h
28 
29  Definitions for the password validation service
30 */
31 
32 /**
33  @ingroup group_ext_plugin_services
34 
35  This service allows plugins to validate passwords based on a common policy.
36 
37  This is a "bridge service", i.e. facade with no
38  real functionality that just calls the actual password validation plugin
39  APIs. This serive is needed by other plugins to call into the password
40  validation plugins and thus overcome the limitation that only the server
41  can call plugins.
42 
43  @sa st_mysql_validate_password
44 */
46  /**
47  Validates a password.
48 
49  @sa my_validate_password_policy,
50  st_mysql_validate_password::validate_password
51  */
52  int (*my_validate_password_policy_func)(const char *, unsigned int);
53  /**
54  Evaluates the strength of a password in a scale 0-100
55 
56  @sa my_calculate_password_strength,
57  st_mysql_validate_password::get_password_strength
58  */
59  int (*my_calculate_password_strength_func)(const char *, unsigned int);
61 
62 #ifdef MYSQL_DYNAMIC_PLUGIN
63 
64 #define my_validate_password_policy(buffer, length) \
65  mysql_password_policy_service->my_validate_password_policy_func(buffer, \
66  length)
67 #define my_calculate_password_strength(buffer, length) \
68  mysql_password_policy_service->my_calculate_password_strength_func(buffer, \
69  length)
70 
71 #else
72 
73 int my_validate_password_policy(const char *, unsigned int);
74 int my_calculate_password_strength(const char *, unsigned int);
75 
76 #endif
77 
78 #endif
int my_calculate_password_strength(const char *, unsigned int)
Invoke the component/plugin to evalue the strength of a password.
Definition: password_policy_service.cc:129
This service allows plugins to validate passwords based on a common policy.
Definition: service_mysql_password_policy.h:45
int(* my_validate_password_policy_func)(const char *, unsigned int)
Validates a password.
Definition: service_mysql_password_policy.h:52
struct mysql_password_policy_service_st * mysql_password_policy_service
int my_validate_password_policy(const char *, unsigned int)
Invoke the component/plugin to validate the input password.
Definition: password_policy_service.cc:71
int(* my_calculate_password_strength_func)(const char *, unsigned int)
Evaluates the strength of a password in a scale 0-100.
Definition: service_mysql_password_policy.h:59