mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
do not allow reset auth to new to be used along with add identified clauses
This commit is contained in:
parent
f0223aedde
commit
4fd19c3ad9
@ -660,6 +660,11 @@ bool ParserCreateUserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
|
||||
|
||||
}
|
||||
|
||||
if (reset_authentication_methods_to_new && !auth_data.empty())
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "RESET AUTHENTICATION METHODS TO NEW cannot be used along with [ADD] IDENTIFIED clauses");
|
||||
}
|
||||
|
||||
if (!alter && !hosts)
|
||||
{
|
||||
String common_host_pattern;
|
||||
|
@ -55,6 +55,8 @@ RESET AUTHENTICATION METHODS TO NEW can only be used on alter statement
|
||||
BAD_ARGUMENTS
|
||||
ADD NOT IDENTIFIED should result in syntax error
|
||||
SYNTAX_ERROR
|
||||
RESET AUTHENTICATION METHODS TO NEW cannot be used along with [ADD] IDENTIFIED clauses
|
||||
BAD_ARGUMENTS
|
||||
localhost 9000 0 0 0
|
||||
localhost 9000 0 0 0
|
||||
Basic authentication after user creation
|
||||
@ -130,3 +132,5 @@ RESET AUTHENTICATION METHODS TO NEW can only be used on alter statement
|
||||
BAD_ARGUMENTS
|
||||
ADD NOT IDENTIFIED should result in syntax error
|
||||
SYNTAX_ERROR
|
||||
RESET AUTHENTICATION METHODS TO NEW cannot be used along with [ADD] IDENTIFIED clauses
|
||||
BAD_ARGUMENTS
|
||||
|
@ -152,6 +152,9 @@ function test
|
||||
echo "ADD NOT IDENTIFIED should result in syntax error"
|
||||
${CLICKHOUSE_CLIENT} --query "ALTER USER ${user} $1 ADD NOT IDENTIFIED" 2>&1 | grep -m1 -o "SYNTAX_ERROR"
|
||||
|
||||
echo "RESET AUTHENTICATION METHODS TO NEW cannot be used along with [ADD] IDENTIFIED clauses"
|
||||
${CLICKHOUSE_CLIENT} --query "ALTER USER ${user} $1 IDENTIFIED WITH plaintext_password by '1' RESET AUTHENTICATION METHODS TO NEW" 2>&1 | grep -m1 -o "BAD_ARGUMENTS"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS ${user}"
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user