MySQL 8.4.2
Source Code Documentation
acl_table::Acl_user_attributes Class Reference

Class to handle information stored in mysql.user.user_attributes. More...

#include <acl_table_user.h>

Public Member Functions

 Acl_user_attributes (MEM_ROOT *mem_root, bool read_restrictions, Auth_id &auth_id, Access_bitmask global_privs)
 Default constructor. More...
 
 Acl_user_attributes (MEM_ROOT *mem_root, bool read_restrictions, Auth_id &auth_id, Restrictions *m_restrictions, I_multi_factor_auth *mfa)
 
 ~Acl_user_attributes ()
 
bool deserialize (const Json_object &json_object)
 Obtain info from JSON representation of user attributes. More...
 
bool serialize (Json_object &json_object) const
 Create JSON object from user attributes. More...
 
bool update_additional_password (std::string &credential)
 Update second password for user. More...
 
void discard_additional_password ()
 Discard second password. More...
 
const std::string get_additional_password () const
 Get second password. More...
 
Restrictions get_restrictions () const
 Get the restriction list for the user. More...
 
void update_restrictions (const Restrictions &restricitions)
 
auto get_failed_login_attempts () const
 
auto get_password_lock_time_days () const
 
auto get_password_lock () const
 
void set_password_lock (Password_lock password_lock)
 
I_multi_factor_authget_mfa ()
 
void set_mfa (I_multi_factor_auth *mfa)
 
bool consume_user_attributes_json (Json_dom_ptr json)
 Take over ownership of the json pointer. More...
 

Private Member Functions

void report_and_remove_invalid_db_restrictions (DB_restrictions &db_restrictions, Access_bitmask mask, enum loglevel level, ulonglong errcode)
 
bool deserialize_password_lock (const Json_object &json_object)
 
bool deserialize_multi_factor (const Json_object &json_object)
 

Private Attributes

MEM_ROOTm_mem_root
 Mem root. More...
 
bool m_read_restrictions
 Operation for restrictions. More...
 
Auth_id m_auth_id
 Auth ID. More...
 
std::string m_additional_password
 Second password for user. More...
 
Restrictions m_restrictions
 Restrictions_list on certain databases for user. More...
 
Access_bitmask m_global_privs
 Global static privileges. More...
 
Password_lock m_password_lock
 password locking More...
 
I_multi_factor_authm_mfa
 multi factor auth info More...
 
Json_dom_ptr m_user_attributes_json
 Save the original json object. More...
 

Detailed Description

Class to handle information stored in mysql.user.user_attributes.

Constructor & Destructor Documentation

◆ Acl_user_attributes() [1/2]

acl_table::Acl_user_attributes::Acl_user_attributes ( MEM_ROOT mem_root,
bool  read_restrictions,
Auth_id auth_id,
Access_bitmask  global_privs 
)

Default constructor.

◆ Acl_user_attributes() [2/2]

acl_table::Acl_user_attributes::Acl_user_attributes ( MEM_ROOT mem_root,
bool  read_restrictions,
Auth_id auth_id,
Restrictions m_restrictions,
I_multi_factor_auth mfa 
)

◆ ~Acl_user_attributes()

acl_table::Acl_user_attributes::~Acl_user_attributes ( )

Member Function Documentation

◆ consume_user_attributes_json()

bool acl_table::Acl_user_attributes::consume_user_attributes_json ( Json_dom_ptr  json)

Take over ownership of the json pointer.

Returns
Error state
Return values
trueAn error occurred
falseSuccess

◆ deserialize()

bool acl_table::Acl_user_attributes::deserialize ( const Json_object json_object)

Obtain info from JSON representation of user attributes.

Parameters
[in]json_objectJSON object that holds user attributes
Returns
status of parsing json_object
Return values
falseSuccess
trueError parsing the JSON object

Second password

◆ deserialize_multi_factor()

bool acl_table::Acl_user_attributes::deserialize_multi_factor ( const Json_object json_object)
private

◆ deserialize_password_lock()

bool acl_table::Acl_user_attributes::deserialize_password_lock ( const Json_object json_object)
private

◆ discard_additional_password()

void acl_table::Acl_user_attributes::discard_additional_password ( )

Discard second password.

◆ get_additional_password()

const std::string acl_table::Acl_user_attributes::get_additional_password ( ) const

Get second password.

Returns
second password

◆ get_failed_login_attempts()

auto acl_table::Acl_user_attributes::get_failed_login_attempts ( ) const
inline

◆ get_mfa()

I_multi_factor_auth * acl_table::Acl_user_attributes::get_mfa ( )
inline

◆ get_password_lock()

auto acl_table::Acl_user_attributes::get_password_lock ( ) const
inline

◆ get_password_lock_time_days()

auto acl_table::Acl_user_attributes::get_password_lock_time_days ( ) const
inline

◆ get_restrictions()

Restrictions acl_table::Acl_user_attributes::get_restrictions ( ) const

Get the restriction list for the user.

Returns
Restriction list

◆ report_and_remove_invalid_db_restrictions()

void acl_table::Acl_user_attributes::report_and_remove_invalid_db_restrictions ( DB_restrictions db_restrictions,
Access_bitmask  mask,
enum loglevel  level,
ulonglong  errcode 
)
private

◆ serialize()

bool acl_table::Acl_user_attributes::serialize ( Json_object json_object) const

Create JSON object from user attributes.

Parameters
[out]json_objectObject to store serialized user attributes
Returns
status of serialization
Return values
falseSuccess
trueError serializing user attributes

◆ set_mfa()

void acl_table::Acl_user_attributes::set_mfa ( I_multi_factor_auth mfa)
inline

◆ set_password_lock()

void acl_table::Acl_user_attributes::set_password_lock ( Password_lock  password_lock)
inline

◆ update_additional_password()

bool acl_table::Acl_user_attributes::update_additional_password ( std::string &  credential)

Update second password for user.

We replace existing one if any.

Parameters
[in]credentialSecond password
Returns
status of password update
Return values
falseSuccess
trueError. Second password is empty

◆ update_restrictions()

void acl_table::Acl_user_attributes::update_restrictions ( const Restrictions restricitions)

Member Data Documentation

◆ m_additional_password

std::string acl_table::Acl_user_attributes::m_additional_password
private

Second password for user.

◆ m_auth_id

Auth_id acl_table::Acl_user_attributes::m_auth_id
private

Auth ID.

◆ m_global_privs

Access_bitmask acl_table::Acl_user_attributes::m_global_privs
private

Global static privileges.

◆ m_mem_root

MEM_ROOT* acl_table::Acl_user_attributes::m_mem_root
private

Mem root.

◆ m_mfa

I_multi_factor_auth* acl_table::Acl_user_attributes::m_mfa
private

multi factor auth info

◆ m_password_lock

Password_lock acl_table::Acl_user_attributes::m_password_lock
private

password locking

◆ m_read_restrictions

bool acl_table::Acl_user_attributes::m_read_restrictions
private

Operation for restrictions.

◆ m_restrictions

Restrictions acl_table::Acl_user_attributes::m_restrictions
private

Restrictions_list on certain databases for user.

◆ m_user_attributes_json

Json_dom_ptr acl_table::Acl_user_attributes::m_user_attributes_json
private

Save the original json object.


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