sa: Allow empty policy to indicate parent user's policy is inherited (#9185)

This commit is contained in:
Anis Elleuch
2020-03-23 22:17:18 +01:00
committed by GitHub
parent 9a951da881
commit 791821d590
4 changed files with 52 additions and 21 deletions

View File

@@ -211,8 +211,9 @@ func getClaimsFromToken(r *http.Request) (map[string]interface{}, error) {
// If OPA is not set, session token should
// have a policy and its mandatory, reject
// requests without policy claim.
_, pok := claims.Lookup(iamPolicyClaimName())
if !pok {
_, pokOpenID := claims.Lookup(iamPolicyClaimNameOpenID())
_, pokSA := claims.Lookup(iamPolicyClaimNameSA())
if !pokOpenID && !pokSA {
return nil, errAuthentication
}