morrySnow commented on code in PR #1930: URL: https://github.com/apache/doris-website/pull/1930#discussion_r1928191333
########## docs/sql-manual/sql-statements/account-management/SET-PASSWORD.md: ########## @@ -26,37 +26,55 @@ under the License. ## Description -The SET PASSWORD command can be used to modify a user's login password. If the [FOR user_identity] field does not exist, then change the current user's password +The `SET PASSWORD` statement is used to modify a user's login password. + +## Syntax ```sql -SET PASSWORD [FOR user_identity] = - [PASSWORD('plain password')]|['hashed password'] +SET PASSWORD [FOR <user_identity>] = + [PASSWORD(<plain_password>)]|[<hashed_password>] ``` -Note that the user_identity here must exactly match the user_identity specified when creating a user with CREATE USER, otherwise an error will be reported that the user does not exist. If user_identity is not specified, the current user is 'username'@'ip', which may not match any user_identity. Current users can be viewed through SHOW GRANTS. +## Required Parameters -The plaintext password is input in the PASSWORD() method; when using a string directly, the encrypted password needs to be passed. -To modify the passwords of other users, administrator privileges are required. +**<plain_password>** Review Comment: 1. 需要有序列表 2. 需要反引号包裹,防止转义 ```suggestion **1. `<plain_password>`** ``` ########## docs/sql-manual/sql-statements/account-management/ALTER-USER.md: ########## @@ -24,78 +24,105 @@ specific language governing permissions and limitations under the License. --> - ## Description -The ALTER USER command is used to modify a user's account attributes, including passwords, and password policies, etc. +The `ALTER USER` statement is used to modify a user's account attributes, including passwords, and password policies, etc. ->Note that. -> ->This command give over supports modifying user roles from versions 2.0. Please use [GRANT](./GRANT.md) and [REVOKE](./REVOKE.md) for related operations +## Syntax ```sql -ALTER USER [IF EXISTS] user_identity [IDENTIFIED BY 'password'] -[password_policy] -[comment] +ALTER USER [IF EXISTS] <user_identity> [IDENTIFIED BY <password>] +[<password_policy>] +[<comment>] +``` -user_identity: - 'user_name'@'host' +## Required Parameters -password_policy: +**<user_identity>** - 1. PASSWORD_HISTORY [n|DEFAULT] - 2. PASSWORD_EXPIRE [DEFAULT|NEVER|INTERVAL n DAY/HOUR/SECOND] - 3. FAILED_LOGIN_ATTEMPTS n - 4. PASSWORD_LOCK_TIME [n DAY/HOUR/SECOND|UNBOUNDED] - 5. ACCOUNT_UNLOCK -``` +> A user_identity uniquely identifies a user.The syntax is:'user_name'@'host'. +> `user_identity` consists of two parts, user_name and host, where username is the username. Host identifies the host address where the client connects. The host part can use % for fuzzy matching. If no host is specified, it defaults to '%', which means the user can connect to Doris from any host. +> The host part can also be specified as a domain, the syntax is: 'user_name'@['domain'], even if it is surrounded by square brackets, Doris will think this is a domain and try to resolve its ip address. -About `user_identity` and `password_policy`, Please refer to `CREATE USER`. +## Optional Parameters -`ACCOUNT_UNLOCK` is used to unlock a locked user. +**<password>** -In an ALTER USER command, only one of the following account attributes can be modified at the same time: +> Specify the user password. -1. Change password -2. Modify `PASSWORD_HISTORY` -3. Modify `PASSWORD_EXPIRE` -4. Modify `FAILED_LOGIN_ATTEMPTS` and `PASSWORD_LOCK_TIME` -5. Unlock users +**<password_policy>** -## Example +> `password_policy` is a clause used to specify policies related to password authentication login. Currently, the following policies are supported: -1. Change the user's password +```sql + - PASSWORD_HISTORY [n|DEFAULT] + - PASSWORD_EXPIRE [DEFAULT|NEVER|INTERVAL n DAY/HOUR/SECOND] + - FAILED_LOGIN_ATTEMPTS n + - PASSWORD_LOCK_TIME [n DAY/HOUR/SECOND|UNBOUNDED] + - ACCOUNT_UNLOCK Review Comment: 这部分: 1. 建议无序列表中写清楚类别。语法分到每一个类别中 2. 每一个的语法还是要遵循语法部分的规范。参数要加上尖括号,可选部分使用大括号和竖线。举个例子 ```sql PASSWORD_EXPIRE { DEFAULT | NEVER | INTERVAL <n> { DAY | HOUR | SECOND } } ``` 另外一种做法是,在语法部分把这些分支全部列清楚。然后在参数部分介绍每个分支的作用 ########## docs/sql-manual/sql-statements/account-management/SET-PASSWORD.md: ########## @@ -26,37 +26,55 @@ under the License. ## Description -The SET PASSWORD command can be used to modify a user's login password. If the [FOR user_identity] field does not exist, then change the current user's password +The `SET PASSWORD` statement is used to modify a user's login password. + +## Syntax ```sql -SET PASSWORD [FOR user_identity] = - [PASSWORD('plain password')]|['hashed password'] +SET PASSWORD [FOR <user_identity>] = + [PASSWORD(<plain_password>)]|[<hashed_password>] ``` -Note that the user_identity here must exactly match the user_identity specified when creating a user with CREATE USER, otherwise an error will be reported that the user does not exist. If user_identity is not specified, the current user is 'username'@'ip', which may not match any user_identity. Current users can be viewed through SHOW GRANTS. +## Required Parameters -The plaintext password is input in the PASSWORD() method; when using a string directly, the encrypted password needs to be passed. -To modify the passwords of other users, administrator privileges are required. +**<plain_password>** -## Example +> The input is a plaintext password. + +**<hashed_password>** + +> The input is an encrypted password. Review Comment: 同上 ########## docs/sql-manual/sql-statements/account-management/SET-PASSWORD.md: ########## @@ -26,37 +26,55 @@ under the License. ## Description -The SET PASSWORD command can be used to modify a user's login password. If the [FOR user_identity] field does not exist, then change the current user's password +The `SET PASSWORD` statement is used to modify a user's login password. + +## Syntax ```sql -SET PASSWORD [FOR user_identity] = - [PASSWORD('plain password')]|['hashed password'] +SET PASSWORD [FOR <user_identity>] = + [PASSWORD(<plain_password>)]|[<hashed_password>] ``` -Note that the user_identity here must exactly match the user_identity specified when creating a user with CREATE USER, otherwise an error will be reported that the user does not exist. If user_identity is not specified, the current user is 'username'@'ip', which may not match any user_identity. Current users can be viewed through SHOW GRANTS. +## Required Parameters -The plaintext password is input in the PASSWORD() method; when using a string directly, the encrypted password needs to be passed. -To modify the passwords of other users, administrator privileges are required. +**<plain_password>** -## Example +> The input is a plaintext password. Review Comment: 这里说的太笼统了。要解释清楚什么是plain text password。传递这种password时,实际会发生什么。会怎么影响登录 ########## docs/sql-manual/sql-statements/account-management/CREATE-USER.md: ########## @@ -24,112 +24,127 @@ specific language governing permissions and limitations under the License. --> - - ## Description -The CREATE USER command is used to create a Doris user. +The `CREATE USER` statement is used to create a Doris user. + +## Syntax ```sql -CREATE USER [IF EXISTS] user_identity [IDENTIFIED BY 'password'] -[DEFAULT ROLE 'role_name'] -[password_policy] -[comment] - -user_identity: - 'user_name'@'host' - -password_policy: - - 1. PASSWORD_HISTORY [n|DEFAULT] - 2. PASSWORD_EXPIRE [DEFAULT|NEVER|INTERVAL n DAY/HOUR/SECOND] - 3. FAILED_LOGIN_ATTEMPTS n - 4. PASSWORD_LOCK_TIME [n DAY/HOUR/SECOND|UNBOUNDED] +CREATE USER [IF EXISTS] <user_identity> [IDENTIFIED BY <password>] +[DEFAULT ROLE <role_name>] +[<password_policy>] +[<comment>] ``` +## Required Parameters -In Doris, a user_identity uniquely identifies a user. user_identity consists of two parts, user_name and host, where username is the username. host Identifies the host address where the client connects. The host part can use % for fuzzy matching. If no host is specified, it defaults to '%', which means the user can connect to Doris from any host. +**<user_identity>** -The host part can also be specified as a domain, the syntax is: 'user_name'@['domain'], even if it is surrounded by square brackets, Doris will think this is a domain and try to resolve its ip address. . +> A user_identity uniquely identifies a user.The syntax is:'user_name'@'host'. +> `user_identity` consists of two parts, user_name and host, where username is the username. Host identifies the host address where the client connects. The host part can use % for fuzzy matching. If no host is specified, it defaults to '%', which means the user can connect to Doris from any host. +> The host part can also be specified as a domain, the syntax is: 'user_name'@['domain'], even if it is surrounded by square brackets, Doris will think this is a domain and try to resolve its ip address. -If a role (ROLE) is specified, the newly created user will be automatically granted the permissions of the role. If not specified, the user has no permissions by default. The specified ROLE must already exist. -`password_policy` is a clause used to specify policies related to password authentication login. Currently, the following policies are supported: +## Optional Parameters -1. `PASSWORD_HISTORY` +**<password>** - Whether to allow the current user to use historical passwords when resetting their passwords. For example, `PASSWORD_HISTORY 10` means that it is forbidden to use the password set in the past 10 times as a new password. If set to `PASSWORD_HISTORY DEFAULT`, the value in the global variable `password_history` will be used. `0` means do not enable this feature. Default is 0. +> Specify the user password. -2. `PASSWORD_EXPIRE` +**<role_name>** - Set the expiration time of the current user's password. For example `PASSWORD_EXPIRE INTERVAL 10 DAY` means the password will expire in 10 days. `PASSWORD_EXPIRE NEVER` means that the password does not expire. If set to `PASSWORD_EXPIRE DEFAULT`, the value in the global variable `default_password_lifetime` is used. Defaults to NEVER (or 0), which means it will not expire. +> Specify the user role. +> If a role (ROLE) is specified, the newly created user will be automatically granted the permissions of the role. If not specified, the user has no permissions by default. The specified ROLE must already exist. -3. `FAILED_LOGIN_ATTEMPTS` and `PASSWORD_LOCK_TIME` +**<password_policy>** - When the current user logs in, if the user logs in with the wrong password for n times, the account will be locked, and the lock time is set. For example, `FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 1 DAY` means that if you log in wrongly for 3 times, the account will be locked for one day. +> `password_policy` is a clause used to specify policies related to password authentication login. Currently, the following policies are supported: - A locked account can be actively unlocked through the `ALTER USER` statement. +```sql + - PASSWORD_HISTORY [n|DEFAULT] + - PASSWORD_EXPIRE [DEFAULT|NEVER|INTERVAL n DAY/HOUR/SECOND] + - FAILED_LOGIN_ATTEMPTS n + - PASSWORD_LOCK_TIME [n DAY/HOUR/SECOND|UNBOUNDED] +``` Review Comment: 与alter user 相同 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org