-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Simplify CompositeRolesStore#getRoleDescriptors #103126
Simplify CompositeRolesStore#getRoleDescriptors #103126
Conversation
This method has only one production caller, which asserts that the response always has length 1 and (if assertions are disabled) discards all but the first set of role descriptors in the response. We can push that behaviour down into the implementation simplifying things quite considerably and eliminating the allocation and copying needed to support other sizes of response.
Pinging @elastic/es-security (Team:Security) |
NB this refactoring is only valid if we never complete the |
...in/java/org/elasticsearch/xpack/security/authc/support/ApiKeyUserRoleDescriptorResolver.java
Show resolved
Hide resolved
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.
LGTM
This method has only one production caller, which asserts that the
response always has length 1 and (if assertions are disabled) discards
all but the first set of role descriptors in the response. We can push
that behaviour down into the implementation simplifying things quite
considerably and eliminating the allocation and copying needed to
support other sizes of response.