New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entities may have duplicate policies #12812
Entities may have duplicate policies #12812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent new duplicate policies - do we also want to filter out duplicates on query endpoints, so that any existing entity policy dups aren't exposed to the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree with nick's comment
vault/identity_store_entities.go
Outdated
@@ -238,7 +238,8 @@ func (i *IdentityStore) handleEntityUpdateCommon() framework.OperationFunc { | |||
// Update the policies if supplied | |||
entityPoliciesRaw, ok := d.GetOk("policies") | |||
if ok { | |||
entity.Policies = entityPoliciesRaw.([]string) | |||
filteredPolicies := strutil.RemoveDuplicates(entityPoliciesRaw.([]string), false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filteredPolicies
var can be avoided by direct assignment to entity.Policies
.
Thanks for the comments. I am trying to fix the query endpoints, and I have found |
7f1cc67
to
e8da9be
Compare
* Entities may have duplicate plicies * Adding changelog * removing duplicates on reading entity policies * fix changelog
Fixes #10847