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