fix: if OPA set do not enforce policy claim (#10149)

This commit is contained in:
Harshavardhana
2020-07-28 11:47:57 -07:00
committed by GitHub
parent 1b6ba0d062
commit 27266f8a54
4 changed files with 5 additions and 10 deletions

View File

@@ -328,7 +328,7 @@ func (sts *stsAPIHandlers) AssumeRoleWithJWT(w http.ResponseWriter, r *http.Requ
policyName = globalIAMSys.currentPolicies(strings.Join(policySet.ToSlice(), ","))
}
if policyName == "" {
if policyName == "" && globalPolicyOPA == nil {
writeSTSErrorResponse(ctx, w, true, ErrSTSInvalidParameterValue, fmt.Errorf("%s claim missing from the JWT token, credentials will not be generated", iamPolicyClaimNameOpenID()))
return
}