MySQL 8.0.40
Source Code Documentation
|
Abstract base class to define the skeleton of rewriting the users, yet deferring some steps to the concrete classes. More...
#include <sql_rewrite.h>
Protected Member Functions | |
Rewriter_user (THD *thd, Consumer_type target_type) | |
void | rewrite_users (LEX *lex, String *str) const |
Fetch the users from user_list in LEX struct and append them to the String. More... | |
void | append_literal_secret (String *str) const |
Append the literal <secret> in place of password to the output string. More... | |
virtual void | append_auth_str (LEX_USER *lex, String *str) const |
Append the password hash to the output string. More... | |
void | append_plugin_name (const LEX_USER *user, String *str) const |
Append the authentication plugin name for the user. More... | |
void | append_mfa_plugin_name (const LEX_MFA *user, String *str) const |
Append the authentication plugin name from LEX_MFA for the user. More... | |
void | append_mfa_auth_str (const LEX_MFA *user, String *str) const |
Append the authentication string from LEX_MFA for the user. More... | |
bool | rewrite (String &rlb) const override |
Appends the essential clauses for SHOW CREATE|CREATE|ALTER USER statements in the buffer rlb. More... | |
virtual void | append_user_auth_info (LEX_USER *user, bool comma, String *str) const =0 |
virtual void | rewrite_password_history (const LEX *lex, String *str) const =0 |
The default implementation is to append the PASSWORD HISTORY clause iff it is specified. More... | |
virtual void | rewrite_password_reuse (const LEX *lex, String *str) const =0 |
The default implementation is to append the PASSWORD REUSE clause iff it is specified. More... | |
virtual void | rewrite_user_application_user_metadata (const LEX *lex, String *str) const =0 |
void | rewrite_in_memory_user_application_user_metadata (const LEX *user, String *str) const |
Use the LEX for reconstructing the ATTRIBUTE or COMMENT clause. More... | |
Private Member Functions | |
void | rewrite_ssl_properties (const LEX *lex, String *str) const |
Append the SSL clause for users iff it is specified. More... | |
void | rewrite_user_resources (const LEX *lex, String *str) const |
Append the user resource clauses for users. More... | |
void | rewrite_account_lock (const LEX *lex, String *str) const |
Append the ACCOUNT LOCK clause for users iff it is specified. More... | |
void | rewrite_password_expired (const LEX *lex, String *str) const |
Append the PASSWORD EXPIRE clause for users iff it is specified. More... | |
void | rewrite_password_require_current (LEX *lex, String *str) const |
Append the PASSWORD REQUIRE CURRENT clause for users. More... | |
void | rewrite_account_lock_state (LEX *lex, String *str) const |
Append the account lock state. More... | |
void | rewrite_default_roles (const LEX *lex, String *str) const |
Append the DEFAULT ROLE clause for users iff it is specified. More... | |
Additional Inherited Members | |
Public Member Functions inherited from I_rewriter | |
I_rewriter (THD *thd, Consumer_type type) | |
virtual | ~I_rewriter () |
I_rewriter (const I_rewriter &)=delete | |
const I_rewriter & | operator= (const I_rewriter &)=delete |
I_rewriter (const I_rewriter &&)=delete | |
const I_rewriter & | operator= (const I_rewriter &&)=delete |
void | set_consumer_type (Consumer_type type) |
Reset the previous consumer type. More... | |
Consumer_type | consumer_type () |
Return the current consumer type set in the object. More... | |
Protected Attributes inherited from I_rewriter | |
THD *const | m_thd |
Consumer_type | m_consumer_type |
Abstract base class to define the skeleton of rewriting the users, yet deferring some steps to the concrete classes.
The implementation in specific steps might vary according to SQL or the consumer type.
|
protected |
Append the password hash to the output string.
[in] | user | LEX_USER to fetch the auth string of it. |
[in,out] | str | The string in which hash value is suffixed |
Reimplemented in Rewriter_show_create_user.
|
protected |
Append the literal <secret> in place of password to the output string.
[in,out] | str | The string in which literal value is suffixed |
Append the authentication string from LEX_MFA for the user.
[in] | user | User to retrieve the plugin string |
[in,out] | str | The string in which plugin info is suffixed |
Append the authentication plugin name from LEX_MFA for the user.
[in] | user | User to retrieve the plugin string |
[in,out] | str | The string in which plugin info is suffixed |
Append the authentication plugin name for the user.
[in] | user | LEX User to retrieve the plugin string |
[in,out] | str | The string in which plugin info is suffixed |
|
protectedpure virtual |
Implemented in Rewriter_create_user, Rewriter_alter_user, and Rewriter_show_create_user.
|
overrideprotectedvirtual |
Appends the essential clauses for SHOW CREATE|CREATE|ALTER USER statements in the buffer rlb.
[in,out] | rlb | Buffer to return the rewritten query in. |
false | Since it does the partial query rewrite. Must be called through derived classes rewrite(). |
Implements I_rewriter.
Reimplemented in Rewriter_create_user, Rewriter_alter_user, and Rewriter_show_create_user.
Append the ACCOUNT LOCK clause for users iff it is specified.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
Append the account lock state.
Append FAILED_LOGIN_ATTEMPTS/PASSWORD_LOCK_TIME if account auto-lock is active.
[in] | lex | LEX to retrieve data from |
[in,out] | str | The string in which plugin info is suffixed |
Append the DEFAULT ROLE clause for users iff it is specified.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
|
protected |
Use the LEX for reconstructing the ATTRIBUTE or COMMENT clause.
[in] | lex | LEX struct to know if the clause was specified |
[in,out] | str | The string in which the clause is suffixed |
Append the PASSWORD EXPIRE clause for users iff it is specified.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
|
protectedpure virtual |
The default implementation is to append the PASSWORD HISTORY clause iff it is specified.
Though concrete classes may add their own implementation.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
Implemented in Rewriter_create_user, Rewriter_alter_user, and Rewriter_show_create_user.
Append the PASSWORD REQUIRE CURRENT clause for users.
[in] | lex | LEX struct to know if the clause was specified |
[in,out] | str | The string in which the clause is suffixed |
|
protectedpure virtual |
The default implementation is to append the PASSWORD REUSE clause iff it is specified.
Though concrete classes may add their own implementation.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
Implemented in Rewriter_create_user, Rewriter_alter_user, and Rewriter_show_create_user.
Append the SSL clause for users iff it is specified.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
|
protectedpure virtual |
Implemented in Rewriter_create_user, Rewriter_alter_user, and Rewriter_show_create_user.
Append the user resource clauses for users.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |
Fetch the users from user_list in LEX struct and append them to the String.
[in] | lex | LEX struct to check if clause is specified |
[in,out] | str | The string in which clause is suffixed |