-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
VAULT-6818 - Restrict ability to merge entities with mount-accessor-conflicting aliases unless one is explicitly chosen to be kept #16539
Conversation
…of clashing entity aliases
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.
Looks good so far -- I really like all the testing and thorough comments, as well as the log lines!
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.
Are any docs updates needed?
Definitely will be docs updates needed. They'll come as a PR after this one! |
(For some reason I can't respond to this comment, so adding my own and linking) The reason for the continue is that the other path shares the merge code with the normal, non-clash case. It would be possible to duplicate the code and move the continue to the other code path (or add some kind of check), but I don't think there's much getting around a little awkwardness here |
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.
Changes look good to me! Thanks!
In the case that there are conflicting aliases, we will error and print out a list of alias that conflict. This error could look a little like this:
To merge such a set of aliases, you must:
Provide only a single from_entity_id
Provide a list of the alias ids you want to keep as conflicting_alias_ids_to_keep (the others will be deleted)
Test cases cover the following:
conflicting_alias_ids_to_keep
value, and ensuring an error (only one clash merge allowed at once)Docs PR here: #16593