You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/05/25 06:26:10 UTC

[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1002: Edit rbac apis

tianxiaoliang commented on a change in pull request #1002:
URL: https://github.com/apache/servicecomb-service-center/pull/1002#discussion_r638488772



##########
File path: server/plugin/auth/buildin/buildin.go
##########
@@ -97,11 +97,35 @@ func (ba *TokenAuthenticator) Identify(req *http.Request) error {
 	if err != nil {
 		return err
 	}
-	req2 := req.WithContext(rbac.NewContext(req.Context(), claims.(map[string]interface{})))
+	req2 := req.WithContext(rbac.NewContext(req.Context(), m))
 	*req = *req2
 	return nil
 }
 
+func (ba *TokenAuthenticator) GetRolesList(m map[string]interface{}) ([]string, error) {

Review comment:
       cari里这个函数已经写好了RolesFromContext,不维护多余代码

##########
File path: datasource/etcd/account.go
##########
@@ -55,7 +58,11 @@ func (ds *DataSource) CreateAccount(ctx context.Context, a *rbac.Account) error
 		log.Error("pwd hash failed", err)
 		return err
 	}
+	a.Role = ""

Review comment:
       何为特意设置老的role为空




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org