Fix unsupported privileges error message during role and API key crea…#128858
Merged
gmjehovich merged 7 commits intoelastic:mainfrom Jun 4, 2025
Merged
Conversation
Collaborator
|
Pinging @elastic/es-security (Team:Security) |
Collaborator
|
Hi @gmjehovich, I've created a changelog YAML for you. |
jfreden
approved these changes
Jun 4, 2025
Contributor
jfreden
left a comment
There was a problem hiding this comment.
Great job! LGTM! Can you change the label to enhancement instead of bug and update the change log to reflect that?
Collaborator
|
Hi @gmjehovich, I've updated the changelog YAML for you. |
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
gmjehovich
added a commit
to gmjehovich/elasticsearch
that referenced
this pull request
Jun 11, 2025
…y creation (elastic#128858) (elastic#129158) * Fix unsupported privileges error message during role and API key creation * [CI] Auto commit changes from spotless * Add changelog file --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves an issue where Elasticsearch's error message for unknown index privileges was verbose and unclear.
Previously, when a role or API key was created with an unrecognized index privilege, the resulting error message listed valid privileges using a
privilege_name1=[privilege_name1], privilege_name2=[privilege_name2]...format (e.g.,read=[read], write=[write]...).This change ensures that names of valid index privileges are displayed only once instead of in that repeated format. They are also displayed alphabetically for testability and improved readability.
This change was validated with a unit test in
IndexPrivilegeTestas well as a modification to an integration test I recently added inPutRoleRestIT.Example of new error message:
Closes #128132