tianxiaoliang commented on a change in pull request #1119:
URL:
https://github.com/apache/servicecomb-service-center/pull/1119#discussion_r680821688
##########
File path: server/service/rbac/context.go
##########
@@ -47,3 +51,24 @@ func AccountFromContext(ctx context.Context)
(*rbacmodel.Account, error) {
}
return rbacmodel.GetAccount(m)
}
+
+func WithToken(req *http.Request, token string) *http.Request {
+ return util.SetRequestContext(req, CtxRequestToken, token)
+}
+
+func TokenFromRequest(req *http.Request) string {
Review comment:
建议参考go标准库和grpc源码的context管理模式
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]