- Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathvalidate_password_imp.h
100 lines (87 loc) · 4.28 KB
/
validate_password_imp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef VALIDATE_PASSWORD_IMP_H
#defineVALIDATE_PASSWORD_IMP_H
#include<mysql/components/component_implementation.h>
#include<mysql/components/service_implementation.h>
#include<mysql/components/services/component_status_var_service.h>
#include<mysql/components/services/component_sys_var_service.h>
#include<mysql/components/services/log_builtins.h>
#include<mysql/components/services/mysql_string.h>
#include<mysql/components/services/psi_memory_service.h>
#include<mysql/components/services/registry.h>
#include<mysql/components/services/security_context.h>
#include<mysql/components/services/validate_password.h>
externREQUIRES_SERVICE_PLACEHOLDER(registry);
externREQUIRES_SERVICE_PLACEHOLDER(log_builtins);
externREQUIRES_SERVICE_PLACEHOLDER(log_builtins_string);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_character_access);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_factory);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_case);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_converter);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_iterator);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_ctype);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_string_value);
externREQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_register);
externREQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_unregister);
externREQUIRES_SERVICE_PLACEHOLDER(status_variable_registration);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_thd_security_context);
externREQUIRES_SERVICE_PLACEHOLDER(mysql_security_context_options);
externREQUIRES_SERVICE_PLACEHOLDER(psi_memory_v2);
externREQUIRES_SERVICE_PLACEHOLDER(registry_registration);
externREQUIRES_SERVICE_PLACEHOLDER_AS(registry,
mysql_service_registry_no_lock);
externREQUIRES_SERVICE_PLACEHOLDER_AS(registry_registration,
mysql_service_registration_no_lock);
/**
An implementation of the password_validation_service to validate password and
to get its strength.
*/
classvalidate_password_imp {
public:
/**
Validates the strength of given password.
@sa validate_password::validate()
*/
staticDEFINE_BOOL_METHOD(validate, (void *thd, my_h_string password));
/**
Gets the password strength between (0-100)
@sa validate_password::get_strength()
*/
staticDEFINE_BOOL_METHOD(get_strength, (void *thd, my_h_string password,
unsignedint *strength));
};
classvalidate_password_changed_characters_imp {
public:
/**
Validate if number of changed characters matches the pre-configured
criteria
@param [in] current_password Current password
@param [in] new_password New password
@param [out] minimum_required Minimum required number of changed characters
@param [out] changed Actual number of changed characters
@returns Result of validation
@retval false Success
@retval true Error
*/
staticDEFINE_BOOL_METHOD(validate, (my_h_string current_password,
my_h_string new_password,
uint *minimum_required, uint *changed));
};
#endif/* VALIDATE_PASSWORD_IMP_H */