You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "Wanghb1 (via GitHub)" <gi...@apache.org> on 2025/06/23 13:57:48 UTC
[PR] support admin reset self's password without current password [servicecomb-service-center]
Wanghb1 opened a new pull request, #1506:
URL: https://github.com/apache/servicecomb-service-center/pull/1506
1.support admin reset self's password without current password
2.fix the flaw that admin can change other admins' password
--
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-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] support admin reset self's password without current password [servicecomb-service-center]
Posted by "humingcheng (via GitHub)" <gi...@apache.org>.
humingcheng merged PR #1506:
URL: https://github.com/apache/servicecomb-service-center/pull/1506
--
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-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] support admin reset self's password without current password [servicecomb-service-center]
Posted by "humingcheng (via GitHub)" <gi...@apache.org>.
humingcheng commented on code in PR #1506:
URL: https://github.com/apache/servicecomb-service-center/pull/1506#discussion_r2161716713
##########
server/service/rbac/account_service_test.go:
##########
@@ -193,11 +194,11 @@ func TestUpdateAccount(t *testing.T) {
})
t.Run("update self, should return: "+rbac.NewError(rbac.ErrForbidOperateSelfAccount, "").Error(), func(t *testing.T) {
name := "TestDeleteAccount_update_self"
- a := newAccount(name)
+ a := newAdminAccount(name)
Review Comment:
已有的用例不要改,不然含义都变了
##########
server/service/rbac/password.go:
##########
@@ -40,20 +41,29 @@ func ChangePassword(ctx context.Context, a *rbac.Account) error {
return discovery.NewError(discovery.ErrInternal, err.Error())
}
- // change self password, need to check password mismatch
- if changer.Name == a.Name {
- return changePassword(ctx, a.Name, a.CurrentPassword, a.Password)
+ // non-admin user can only change self
Review Comment:
修改者: admin,非admin;被修改者:admin/非admin/自己,这几种改密码场景都要覆盖
--
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-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org