MySQL 8.0.32
Source Code Documentation
validate_password_imp.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_IMP_H
24#define VALIDATE_PASSWORD_IMP_H
25
35
37extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins);
38extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins_string);
39extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_factory);
40extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_case);
41extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_converter);
42extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_iterator);
43extern REQUIRES_SERVICE_PLACEHOLDER(mysql_string_ctype);
44extern REQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_register);
45extern REQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_unregister);
46extern REQUIRES_SERVICE_PLACEHOLDER(status_variable_registration);
47extern REQUIRES_SERVICE_PLACEHOLDER(mysql_thd_security_context);
48extern REQUIRES_SERVICE_PLACEHOLDER(mysql_security_context_options);
49extern REQUIRES_SERVICE_PLACEHOLDER(psi_memory_v2);
50
51/**
52 An implementation of the password_validation_service to validate password and
53 to get its strength.
54*/
56 public:
57 /**
58 Validates the strength of given password.
59
60 @sa validate_password::validate()
61 */
62 static DEFINE_BOOL_METHOD(validate, (void *thd, my_h_string password));
63
64 /**
65 Gets the password strength between (0-100)
66
67 @sa validate_password::get_strength()
68 */
70 unsigned int *strength));
71};
72#endif /* VALIDATE_PASSWORD_IMP_H */
An implementation of the password_validation_service to validate password and to get its strength.
Definition: validate_password_imp.h:55
static mysql_service_status_t get_strength(void *thd, my_h_string password, unsigned int *strength) noexcept
Gets the password strength between (0-100)
Definition: validate_password_imp.cc:528
static mysql_service_status_t validate(void *thd, my_h_string password) noexcept
Validates the strength of given password.
Definition: validate_password_imp.cc:584
Specifies macros to define Components.
static char * password
Definition: mysql_secure_installation.cc:55
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:87
The string functions as a service to the mysql_server component.
Definition: mysql_string_service.cc:45
REQUIRES_SERVICE_PLACEHOLDER(registry)