MySQL 8.0.31
Source Code Documentation
validate_password.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2022, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is also distributed with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef VALIDATE_PASSWORD_SERVICE_H
24#define VALIDATE_PASSWORD_SERVICE_H
25
28
29/**
30 This component defines interface that the server uses to enforce a
31 password policy.
32
33 The policy is enfoced through two methods
34 1) validate_password_imp::validate() that answers the question of whether
35 this password is good enough or not.
36
37 2) validate_password_imp::get_strength() that can be used by password
38 changing UIs to display a password strength meter in the range of [0-100]
39 as the user enters a password.
40*/
42/**
43 Checks if a password is valid by the password policy.
44
45 @param thd MYSQL THD object
46 @param password Given Password
47 @return Status of performed operation
48 @return false success (valid password)
49 @return true failure (invalid password)
50*/
52
53/**
54 Calculates the strength of a password in the scale of 0 to 100.
55
56 @param thd MYSQL THD object
57 @param password Given Password
58 @param [out] strength pointer to handle the strength of the given password.
59 in the range of [0-100], where 0 is week password and
60 100 is strong password
61 @return Status of performed operation
62 @return false success
63 @return true failure
64*/
65DECLARE_BOOL_METHOD(get_strength,
66 (void *thd, my_h_string password, unsigned int *strength));
67
69
70#endif /* VALIDATE_PASSWORD_SERVICE_H */
static char * password
Definition: mysql_secure_installation.cc:55
static mysql_service_status_t validate(reference_caching_channel channel) noexcept
Definition: component.cc:66
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111
The string functions as a service to the mysql_server component.
Definition: mysql_string_service.cc:45
static int validate_password(mysql_string_handle password)
Definition: validate_password.cc:394