Deduplicate policies prior to generating ACL on request (#17914)
* Deduplicate policies prior to generating ACL on request * add changelog * edit changelog entry
This commit is contained in:
parent
adc8f9a20e
commit
3394c28ce1
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
auth: Deduplicate policies prior to ACL generation
|
||||||
|
```
|
|
@ -204,7 +204,7 @@ func (c *Core) fetchACLTokenEntryAndEntity(ctx context.Context, req *logical.Req
|
||||||
return nil, nil, nil, nil, ErrInternalError
|
return nil, nil, nil, nil, ErrInternalError
|
||||||
}
|
}
|
||||||
for nsID, nsPolicies := range identityPolicies {
|
for nsID, nsPolicies := range identityPolicies {
|
||||||
policyNames[nsID] = append(policyNames[nsID], nsPolicies...)
|
policyNames[nsID] = policyutil.SanitizePolicies(append(policyNames[nsID], nsPolicies...), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attach token's namespace information to the context. Wrapping tokens by
|
// Attach token's namespace information to the context. Wrapping tokens by
|
||||||
|
@ -361,7 +361,7 @@ func (c *Core) checkToken(ctx context.Context, req *logical.Request, unauth bool
|
||||||
if te != nil {
|
if te != nil {
|
||||||
auth.IdentityPolicies = identityPolicies[te.NamespaceID]
|
auth.IdentityPolicies = identityPolicies[te.NamespaceID]
|
||||||
auth.TokenPolicies = te.Policies
|
auth.TokenPolicies = te.Policies
|
||||||
auth.Policies = append(te.Policies, identityPolicies[te.NamespaceID]...)
|
auth.Policies = policyutil.SanitizePolicies(append(te.Policies, identityPolicies[te.NamespaceID]...), false)
|
||||||
auth.Metadata = te.Meta
|
auth.Metadata = te.Meta
|
||||||
auth.DisplayName = te.DisplayName
|
auth.DisplayName = te.DisplayName
|
||||||
auth.EntityID = te.EntityID
|
auth.EntityID = te.EntityID
|
||||||
|
|
Loading…
Reference in New Issue