Skip to content

Commit

Permalink
fix(apigateway): set scope policy binding project id query
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito committed Jan 20, 2025
1 parent 6887125 commit 00bed0f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/apigateway/handler/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/gotypes"
"yunion.io/x/pkg/util/httputils"
"yunion.io/x/pkg/util/printutils"
"yunion.io/x/pkg/util/rbacscope"
Expand Down Expand Up @@ -221,7 +222,13 @@ var (
)

func (h *AuthHandlers) getScopedPolicyBindings(ctx context.Context, w http.ResponseWriter, req *http.Request) {
_, params, _ := appsrv.FetchEnv(ctx, w, req)
_, _params, _ := appsrv.FetchEnv(ctx, w, req)
if gotypes.IsNil(_params) {
_params = jsonutils.NewDict()
}
params := _params.(*jsonutils.JSONDict)
token := AppContextToken(ctx)
params.Set("project_id", jsonutils.NewString(token.GetProjectId()))
hash := fmt.Sprintf("%x", md5.Sum([]byte(params.String())))
cache := bindingCache.Get(hash)
if cache != nil {
Expand Down

0 comments on commit 00bed0f

Please sign in to comment.