MySQL 8.4.0
Source Code Documentation
Multi_factor_auth_list Class Reference

#include <sql_mfa.h>

Inheritance diagram for Multi_factor_auth_list:
[legend]

Public Member Functions

 Multi_factor_auth_list (MEM_ROOT *)
 
 ~Multi_factor_auth_list () override
 
my_vector< I_multi_factor_auth * > & get_mfa_list ()
 
size_t get_mfa_list_size ()
 
bool is_alter_allowed (THD *, LEX_USER *) override
 This method checks MFA methods present in ACL_USER against new factor specified as part of ALTER USER sql. More...
 
void alter_mfa (I_multi_factor_auth *) override
 This method modifies the Multi factor authentication interface based on ALTER USER sql. More...
 
bool validate_plugins_in_auth_chain (THD *thd, const authentication_policy::Factors &policy_factors) override
 Interface method to validate the auth plugin chain before updating the user_attributes in mysql.user table. More...
 
bool validate_against_authentication_policy (THD *thd, const authentication_policy::Factors &policy_factors) override
 This method checks the modified Multi factor authentication interface methods based on ALTER USER sql against authentication policy. More...
 
bool update_user_attributes () override
 Interface method to update user_attributes. More...
 
void add_factor (I_multi_factor_auth *m) override
 
bool serialize (Json_array &mfa_arr) override
 Interface method to convert this interface into a valid JSON object. More...
 
bool deserialize (uint f, Json_dom *mfa_dom) override
 Interface method to convert a valid JSON object into this interface. More...
 
bool init_registration (THD *, uint) override
 Interface method to initiate registration. More...
 
bool finish_registration (THD *, LEX_USER *, uint) override
 Interface method to finish registration step. More...
 
bool is_passwordless () override
 Interface method to check if registration step in for passwordless authentication method. More...
 
void get_info_for_query_rewrite (THD *, LEX_USER *) override
 Interface method to fill in Multi factor authentication method details during query rewrite. More...
 
void get_generated_passwords (Userhostpassword_list &gp, const char *u, const char *h) override
 Interface method to fill in generated passwords from Multi factor authentication methods. More...
 
void get_server_challenge_info (server_challenge_info_vector &sc) override
 Interface method to fill in generated server challenge from init registration step. More...
 
- Public Member Functions inherited from I_multi_factor_auth
virtual ~I_multi_factor_auth ()=default
 
Multi_factor_auth_listget_multi_factor_auth_list ()
 Get methods. More...
 
Multi_factor_auth_infoget_multi_factor_auth_info ()
 

Private Member Functions

void sort_mfa ()
 Helper method to sort nth factor methods in multi-factor authentication interface such that 2nd factor method always precedes 3rd factor method. More...
 

Private Attributes

my_vector< I_multi_factor_auth * > m_factor
 

Constructor & Destructor Documentation

◆ Multi_factor_auth_list()

Multi_factor_auth_list::Multi_factor_auth_list ( MEM_ROOT mem_root)

◆ ~Multi_factor_auth_list()

Multi_factor_auth_list::~Multi_factor_auth_list ( )
override

Member Function Documentation

◆ add_factor()

void Multi_factor_auth_list::add_factor ( I_multi_factor_auth m)
overridevirtual

Reimplemented from I_multi_factor_auth.

◆ alter_mfa()

void Multi_factor_auth_list::alter_mfa ( I_multi_factor_auth m)
overridevirtual

This method modifies the Multi factor authentication interface based on ALTER USER sql.

This method refers to Multi factor authentication interface present in ACL_USER against the new interface which is passed as an input and updates the nth factor method in new interface by either adding or dropping the nth factor methods. An expression like new_mfa_interface = ACL_USER::m_mfa;

Parameters
[in,out]mhandler to new Multi factor authentication interface

Reimplemented from I_multi_factor_auth.

◆ deserialize()

bool Multi_factor_auth_list::deserialize ( uint  nth_factor,
Json_dom mfa_dom 
)
overridevirtual

Interface method to convert a valid JSON object into this interface.

Parameters
[in]nth_factorRefers to which factor needs to be deserialized
[in]mfa_domJSON dom object which should be deserialized
Returns
status of deserialization
Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

◆ finish_registration()

bool Multi_factor_auth_list::finish_registration ( THD thd,
LEX_USER user_name,
uint  nth_factor 
)
overridevirtual

Interface method to finish registration step.

Parameters
[in]thdConnection handler
[in]user_nameHandler to LEX_USER
[in]nth_factorRefers to which factor needs registration
Returns
status of registration step
Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

◆ get_generated_passwords()

void Multi_factor_auth_list::get_generated_passwords ( Userhostpassword_list gp,
const char *  u,
const char *  h 
)
overridevirtual

Interface method to fill in generated passwords from Multi factor authentication methods.

Parameters
[out]gpList holding all generated passwords.
[in]uName of user
[in]hHost name

Implements I_multi_factor_auth.

◆ get_info_for_query_rewrite()

void Multi_factor_auth_list::get_info_for_query_rewrite ( THD thd,
LEX_USER user_name 
)
overridevirtual

Interface method to fill in Multi factor authentication method details during query rewrite.

Parameters
[in]thdConnection handler
[in]user_nameHandler to LEX_USER

Implements I_multi_factor_auth.

◆ get_mfa_list()

my_vector< I_multi_factor_auth * > & Multi_factor_auth_list::get_mfa_list ( )

◆ get_mfa_list_size()

size_t Multi_factor_auth_list::get_mfa_list_size ( )

◆ get_server_challenge_info()

void Multi_factor_auth_list::get_server_challenge_info ( server_challenge_info_vector sc)
overridevirtual

Interface method to fill in generated server challenge from init registration step.

Parameters
[out]scBuffer to hold server challenge

Implements I_multi_factor_auth.

◆ init_registration()

bool Multi_factor_auth_list::init_registration ( THD thd,
uint  nth_factor 
)
overridevirtual

Interface method to initiate registration.

Parameters
[in]thdConnection handler
[in]nth_factorRefers to which factor needs registration
Returns
status of registration step
Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

◆ is_alter_allowed()

bool Multi_factor_auth_list::is_alter_allowed ( THD thd,
LEX_USER user 
)
overridevirtual

This method checks MFA methods present in ACL_USER against new factor specified as part of ALTER USER sql.

Parameters
[in]thdConnection handler
[in]userHandler to LEX_USER whose Multi Factor Auth methods will being added/dropped or modified
Returns
status of the validation
Return values
falseSuccess ALTER USER can proceed further
trueFailure report error for ALTER USER

Reimplemented from I_multi_factor_auth.

◆ is_passwordless()

bool Multi_factor_auth_list::is_passwordless ( )
overridevirtual

Interface method to check if registration step in for passwordless authentication method.

Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

◆ serialize()

bool Multi_factor_auth_list::serialize ( Json_array mfa_arr)
overridevirtual

Interface method to convert this interface into a valid JSON object.

Parameters
[in,out]mfa_arrA json array into which nth factor Multi factor authentication methods needs to be added.
Returns
status of serialization
Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

◆ sort_mfa()

void Multi_factor_auth_list::sort_mfa ( )
private

Helper method to sort nth factor methods in multi-factor authentication interface such that 2nd factor method always precedes 3rd factor method.

◆ update_user_attributes()

bool Multi_factor_auth_list::update_user_attributes ( )
overridevirtual

Interface method to update user_attributes.

Returns
status of update operation
Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

◆ validate_against_authentication_policy()

bool Multi_factor_auth_list::validate_against_authentication_policy ( THD thd,
const authentication_policy::Factors policy_factors 
)
overridevirtual

This method checks the modified Multi factor authentication interface methods based on ALTER USER sql against authentication policy.

Parameters
[in]thdConnection handle
[in]policy_factorsAuthentication policy factors
Returns
status of the validation
Return values
falseSuccess (modified mfa methods match policy)
trueFailure (authentication policy is vioalted)

Reimplemented from I_multi_factor_auth.

◆ validate_plugins_in_auth_chain()

bool Multi_factor_auth_list::validate_plugins_in_auth_chain ( THD thd,
const authentication_policy::Factors policy_factors 
)
overridevirtual

Interface method to validate the auth plugin chain before updating the user_attributes in mysql.user table.

Parameters
[in]thdConnection handler
[in]policy_factorsAuthentication policy factors
Returns
status of the validation
Return values
falseSuccess
trueFailure

Implements I_multi_factor_auth.

Member Data Documentation

◆ m_factor

my_vector<I_multi_factor_auth *> Multi_factor_auth_list::m_factor
private

The documentation for this class was generated from the following files: