matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Feature Request]: support alter user <user name> lock statement.

Open allengaoo opened this issue 9 months ago • 3 comments

Is there an existing issue for the same feature request?

  • [x] I have checked the existing issues.

Is your feature request related to a problem?

MO has already supported " alter user <user name> unlock " statement to enable an user. However lock user is not supported yet.  

In MOI implementation, when customer created an user in a workspace, we create an  MO user accordingly, it means we need to support lock/unlock a MO user in order to support MOI user management features.

Describe the feature you'd like

MO support "alter user lock " statement. When a user was locked , all new connections with the username is not allowed and error message like "connection failed due to user has been locked", but the connected sessions are not impacted.

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy


Additional information

No response

allengaoo avatar Apr 11 '25 07:04 allengaoo

当前的MO是有类似lock的机制的。 它是当有设置最大密码错误次数的时候 以及 最大 连接延迟的情况下 这2个: set global connection_control_failed_connections_threshold = 3; set global connection_control_max_connection_delay = 300000000; (bvt case参考:password_retry.sql)

那么当登录密码次数大于一定数量。会锁住用户 connection_control_max_connection_delay 这么长时间。 在登录的时候自动处理,没有相应语法。 (对应源码: pkg/frontend/session.go AuthenticateUser函数 约1436行)

ouyuanning avatar Apr 21 '25 06:04 ouyuanning

刚才和 @ouyuanning 进行了讨论,最后的结论是不复用当前的密码管理的lock 机制,而是增加一个全新的用户是否被锁定的状态来实现。

allengaoo avatar Apr 21 '25 08:04 allengaoo

工作安排优先级排后,下一个版本编写测试用例及测试

heni02 avatar May 30 '25 06:05 heni02