Introduce "ConditionalClusterPrivilege"#32073
Merged
tvernum merged 3 commits intoelastic:security-app-privsfrom Jul 17, 2018
Merged
Introduce "ConditionalClusterPrivilege"#32073tvernum merged 3 commits intoelastic:security-app-privsfrom
tvernum merged 3 commits intoelastic:security-app-privsfrom
Conversation
A conditional cluster privilege is like the existing cluster privilege, except that it has a Predicate over the request as well as over the action name. It is the "role descriptor" level representation for the newly introduced "ConditionalClusterPermission" This change adds the ConditionalClusterPrivilege interface, and allows them to be attached to RoleDescriptors, but does not provide any JSON/XContent support. This means that they cannot be used in the Roles API, nor are they stored in the security index, but they can be defined by custom Roles Providers and will be consulted as part of authorization decisions on Roles.
Collaborator
|
Pinging @elastic/es-security |
tvernum
commented
Jul 16, 2018
| public static void writeArray(StreamOutput out, ConditionalClusterPrivilege[] privileges) throws IOException { | ||
| out.writeArray((out1, value) -> out1.writeNamedWriteable(value), privileges); | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
This class is small and seems a bit redundant right now, but it will handle the XContent parsing/building when we add that.
jaymode
approved these changes
Jul 16, 2018
| /** | ||
| * The request-level privilege (as a {@link Predicate}) that is required by this conditional privilege. | ||
| */ | ||
| Predicate<TransportRequest> getRequestPredicate(); |
Member
There was a problem hiding this comment.
We currently have special handling for same user privileges. I wonder if it is worth a refactor to change this to a BiPredicate, which would cover that case as well. I'm tossing this out there as an idea and we can always defer this to later on
Contributor
Author
There was a problem hiding this comment.
This is a good idea - I'll see about adding it in a followup.
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.
A conditional cluster privilege is like the existing cluster
privilege, except that it has a Predicate over the request as
well as over the action name.
It is the "role descriptor" level representation for the newly
introduced "ConditionalClusterPermission"
This change adds the ConditionalClusterPrivilege interface, and
allows them to be attached to RoleDescriptors, but does not provide
any JSON/XContent support. This means that they cannot be used in the
Roles API, nor are they stored in the security index, but they can be
defined by custom Roles Providers and will be consulted as part of
authorization decisions on Roles.