25#ifndef _AUTHENTICATION_POLICY_H_
26#define _AUTHENTICATION_POLICY_H_
156 bool validate(
const char *new_policy);
166 bool update(
const char *new_policy);
224 static bool parse(
const std::string &new_policy_value,
Class representing authenticalion policy factor.
Definition: authentication_policy.h:40
bool is_optional() const
Is the factor optional (may be omitted)?
Definition: authentication_policy.h:57
const std::string & get_default_plugin() const
Get default plugin name.
Definition: authentication_policy.h:97
bool is_default_specified() const
Has the factor a default plugin specified?
Definition: authentication_policy.h:83
std::string default_plugin
Default plugin name.
Definition: authentication_policy.h:127
const std::string & get_mandatory_or_default_plugin() const
Get mandatory plugin name (if defined) else the default plugin name.
Definition: authentication_policy.h:106
std::string mandatory_plugin
If empty: the factor is optional If "*" : the factor may be whichever plugin Else : mandatory plugin ...
Definition: authentication_policy.h:123
const std::string & get_mandatory_plugin() const
Get mandatory plugin name.
Definition: authentication_policy.h:90
bool is_mandatory_specified() const
Has the factor a concrete mandatory auth plugin specified?
Definition: authentication_policy.h:73
Factor(const std::string &mandatory_plugin, const std::string &default_plugin)
Constructor.
Definition: authentication_policy.cc:53
bool is_whichever() const
Is the factor whichever (any auth plugin may be used for it)?
Definition: authentication_policy.h:65
void set_default()
Set default to system defined.
Definition: authentication_policy.h:115
Class representing authentication policy.
Definition: authentication_policy.h:140
static Policy * policy
Pointer to the authentication policy object.
Definition: authentication_policy.h:143
~Policy()
Destructor.
Definition: authentication_policy.h:146
Factors new_factors
Verified, but not yet set authentication policy factors.
Definition: authentication_policy.h:235
Factors factors
Actual authentication policy factors.
Definition: authentication_policy.h:229
friend bool policy_update(const char *new_policy)
Validate @authentication_policy variable value.
Definition: authentication_policy.h:312
st_mysql_auth * get_mysql_auth(const std::string &plugin_name)
Get server authentication plugin descriptor by plugin name.
Definition: authentication_policy.cc:57
friend bool policy_validate(const char *new_policy)
Validate @authentication_policy variable value.
Definition: authentication_policy.h:299
void release_plugin_refs()
Release all plugin references and clear plugin_refs container.
Definition: authentication_policy.h:252
friend void get_first_factor_default_plugin(std::string &name)
Get copy of first factor default plugin name.
Definition: authentication_policy.h:334
void get_default_plugin(size_t factor, std::string &name) const
Get copy of default plugin name.
Definition: authentication_policy.cc:221
friend int init(const char *opt_authentication_policy)
Initialize authentication policy.
Definition: authentication_policy.cc:237
std::vector< plugin_ref > plugin_refs
Definition: authentication_policy.h:247
friend void deinit()
Component deinitialization.
Definition: audit_api_message_emit.cc:580
static bool parse(const std::string &new_policy_value, Factors &parsed_factors)
Parse @authentication_policy variable value.
Definition: authentication_policy.cc:67
bool update(const char *new_policy)
Update @authentication_policy variable value.
Definition: authentication_policy.cc:196
std::string verified_policy_value
The verified policy value.
Definition: authentication_policy.h:240
bool validate(const char *new_policy)
Validate @authentication_policy variable value.
Definition: authentication_policy.cc:134
friend void get_policy_factors(Factors &factors)
Get copy of the authentication policy factors.
Definition: authentication_policy.h:324
void get_factors(Factors &factors) const
Get copy of the authentication policy factors.
Definition: authentication_policy.cc:215
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
char * opt_authentication_policy
Definition: mysqld.cc:1522
namespace for authentication policy
Definition: authentication_policy.cc:44
int init(const char *opt_authentication_policy)
Initialize authentication policy.
Definition: authentication_policy.cc:237
bool policy_validate(const char *new_policy)
Validate @authentication_policy variable value.
Definition: authentication_policy.h:299
std::vector< Factor > Factors
Type of container with authentication policy factors.
Definition: authentication_policy.h:135
bool policy_update(const char *new_policy)
Validate @authentication_policy variable value.
Definition: authentication_policy.h:312
void deinit()
Deinitialize authentication policy.
Definition: authentication_policy.cc:255
void get_policy_factors(Factors &factors)
Get copy of the authentication policy factors.
Definition: authentication_policy.h:324
void get_first_factor_default_plugin(std::string &name)
Get copy of first factor default plugin name.
Definition: authentication_policy.h:334
Authentication Plugin API.
void plugin_unlock(THD *thd, plugin_ref plugin)
Definition: sql_plugin.cc:1261
LEX_CSTRING * plugin_name(st_plugin_int **ref)
Definition: sql_plugin_ref.h:95
case opt name
Definition: sslopt-case.h:29
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
Server authentication plugin descriptor.
Definition: plugin_auth.h:227