MySQL 8.0.40
Source Code Documentation
|
#include <acl_table_user.h>
Public Member Functions | |
Acl_table_user_writer (THD *thd, TABLE *table, LEX_USER *combo, Access_bitmask rights, bool revoke_grant, bool can_create_user, Pod_user_what_to_update what_to_update, Restrictions *restrictions, I_multi_factor_auth *mfa) | |
mysql.user table writer constructor More... | |
~Acl_table_user_writer () override | |
Cleanup. More... | |
Acl_table_op_status | finish_operation (Table_op_error_code &error) override |
Finish the operation. More... | |
Acl_table_user_writer_status | driver () |
Perform add/update to mysql.user table. More... | |
bool | setup_table (int &error, bool &builtin_password) |
Position user table. More... | |
bool | update_authentication_info (Acl_table_user_writer_status &return_value) |
Update user's authentication information. More... | |
bool | update_privileges (Acl_table_user_writer_status &return_value) |
Update global privileges for user. More... | |
bool | update_ssl_properties () |
Update SSL properties. More... | |
bool | update_user_resources () |
Update user resource restrictions. More... | |
bool | update_password_expiry () |
Update password expiration info. More... | |
bool | update_account_locking () |
Update account locking info. More... | |
bool | update_password_history () |
Password history updates. More... | |
bool | update_password_reuse () |
Password reuse time updates. More... | |
bool | update_password_require_current () |
Whether current password is required to update existing one. More... | |
bool | update_user_attributes (std::string ¤t_password, Acl_table_user_writer_status &return_value) |
User_attributes updates. More... | |
void | replace_user_application_user_metadata (std::function< bool(TABLE *table)> const &update) |
Send the function for updating the user metadata JSON code to the table processor. More... | |
Access_bitmask | get_user_privileges () |
Helper function to get global privileges from mysql.user table. More... | |
std::string | get_current_credentials () |
Get current password from mysql.user.authentication_string. More... | |
Public Member Functions inherited from acl_table::Acl_table | |
Acl_table (THD *thd, TABLE *table, Acl_table_operation operation) | |
virtual | ~Acl_table ()=default |
Acl_table (const Acl_table &)=delete | |
const Acl_table & | operator= (const Acl_table &)=delete |
Acl_table (const Acl_table &&)=delete | |
const Acl_table & | operator= (const Acl_table &&)=delete |
Acl_table_operation | get_operation_mode () |
Private Member Functions | |
bool | update_user_application_user_metadata () |
Helper function for updating the user metadata JSON. More... | |
bool | write_user_attributes_column (const Acl_user_attributes &user_attributes) |
Helper function to write updated user_attributes in the column. More... | |
Private Attributes | |
bool | m_has_user_application_user_metadata |
LEX_USER * | m_combo |
Access_bitmask | m_rights |
bool | m_revoke_grant |
bool | m_can_create_user |
Pod_user_what_to_update | m_what_to_update |
User_table_schema * | m_table_schema |
Restrictions * | m_restrictions |
I_multi_factor_auth * | m_mfa |
std::function< bool(TABLE *table)> | m_user_application_user_metadata |
Additional Inherited Members | |
Protected Member Functions inherited from acl_table::Acl_table | |
Acl_table_op_status | convert_table_op_error_code () |
Protected Attributes inherited from acl_table::Acl_table | |
THD * | m_thd |
TABLE * | m_table |
Acl_table_operation | m_operation |
Table_op_error_code | m_error |
acl_table::Acl_table_user_writer::Acl_table_user_writer | ( | THD * | thd, |
TABLE * | table, | ||
LEX_USER * | combo, | ||
Access_bitmask | rights, | ||
bool | revoke_grant, | ||
bool | can_create_user, | ||
Pod_user_what_to_update | what_to_update, | ||
Restrictions * | restrictions = nullptr , |
||
I_multi_factor_auth * | mfa = nullptr |
||
) |
mysql.user table writer constructor
Note: Table handle must be non-null.
[in] | thd | Thread handle |
[in] | table | Handle to mysql.user table |
[in] | combo | User information |
[in] | rights | Updated global privileges |
[in] | revoke_grant | If its REVOKE statement |
[in] | can_create_user | Whether user has ability to create new user |
[in] | what_to_update | Things to be updated |
[in] | restrictions | Restrictions of the user, if there is any |
[in] | mfa | Interface pointer to Multi factor authentication methods |
|
override |
Cleanup.
Acl_table_user_writer_status acl_table::Acl_table_user_writer::driver | ( | ) |
Perform add/update to mysql.user table.
|
overridevirtual |
Finish the operation.
Depending on type of operation (INSERT/UPDATE), either insert a new row in mysql.user table or update an existing row using SE APIs.
[out] | out_error | Table operation error, if any |
Implements acl_table::Acl_table.
std::string acl_table::Acl_table_user_writer::get_current_credentials | ( | ) |
Get current password from mysql.user.authentication_string.
Access_bitmask acl_table::Acl_table_user_writer::get_user_privileges | ( | ) |
Helper function to get global privileges from mysql.user table.
void acl_table::Acl_table_user_writer::replace_user_application_user_metadata | ( | std::function< bool(TABLE *table)> const & | update | ) |
Send the function for updating the user metadata JSON code to the table processor.
update | The function expression used for updating the JSON |
bool acl_table::Acl_table_user_writer::setup_table | ( | int & | error, |
bool & | builtin_plugin | ||
) |
Position user table.
Try to find a row matching with given account information. If one is found, set record pointer to it and set operation type as UPDATE. If no record is found, then set record pointer to empty record.
Raises error in DA in various cases where sanity of table and intention of operation is checked.
[out] | error | Table operation error |
[out] | builtin_plugin | For existing record, if authentication plugin is one of the builtins or not. |
false | Table is positioned. In case of insert, it means no record is found for given (user,host). In case of update, table is set to point to existing record. |
true | Error positioning table. |
bool acl_table::Acl_table_user_writer::update_account_locking | ( | ) |
Update account locking info.
Raises error in DA if mysql.user table does not have account_locked column.
false | Success |
true | Table is not in expected format |
bool acl_table::Acl_table_user_writer::update_authentication_info | ( | Acl_table_user_writer_status & | return_value | ) |
Update user's authentication information.
Raises error in DA if mysql.user table does not have following columns:
[out] | return_value | To update password change timestamp |
false | Success |
true | Error storing authentication info or table is not in expected format |
bool acl_table::Acl_table_user_writer::update_password_expiry | ( | ) |
Update password expiration info.
Raises error in DA if mysql.user table does not have password_expired column.
false | Success |
true | Table is not in expected format |
bool acl_table::Acl_table_user_writer::update_password_history | ( | ) |
Password history updates.
Raises error in DA if mysql.user table does not have password_reuse_history column.
false | Success |
true | Table is not in expected format |
bool acl_table::Acl_table_user_writer::update_password_require_current | ( | ) |
Whether current password is required to update existing one.
Raises error in DA if mysql.user table does not have password_require_current column.
false | Success |
true | Table is not in expected format |
bool acl_table::Acl_table_user_writer::update_password_reuse | ( | ) |
Password reuse time updates.
Raises error in DA if mysql.user table does not have password_reuse_time column.
false | Success |
true | Table is not in expected format |
bool acl_table::Acl_table_user_writer::update_privileges | ( | Acl_table_user_writer_status & | return_value | ) |
Update global privileges for user.
[out] | return_value | To store updated global privileges |
bool acl_table::Acl_table_user_writer::update_ssl_properties | ( | ) |
Update SSL properties.
false | Success |
true | Table is not in expected format |
|
private |
Helper function for updating the user metadata JSON.
bool acl_table::Acl_table_user_writer::update_user_attributes | ( | std::string & | current_password, |
Acl_table_user_writer_status & | return_value | ||
) |
User_attributes updates.
Raises error in DA if mysql.user table does not have user_attributes column.
false | Success |
true | Table/Column is not in expected format |
bool acl_table::Acl_table_user_writer::update_user_resources | ( | ) |
Update user resource restrictions.
|
private |
Helper function to write updated user_attributes in the column.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |