Create/Update role mapping API#34171
Merged
bizybot merged 10 commits intoelastic:masterfrom Oct 16, 2018
Merged
Conversation
This commit adds create/update role mapping API.
Collaborator
|
Pinging @elastic/es-security |
Collaborator
|
Pinging @elastic/es-core-infra |
added 2 commits
October 1, 2018 18:10
jkakavas
reviewed
Oct 2, 2018
|
|
||
| public PutRoleMappingRequest(final String name, final boolean enabled, final List<String> roles, final RoleMapperExpression rules, | ||
| @Nullable final Map<String, Object> metadata, @Nullable final RefreshPolicy refreshPolicy) { | ||
| super(); |
Contributor
Author
There was a problem hiding this comment.
removed this, Thank you.
jkakavas
reviewed
Oct 2, 2018
| private boolean created; | ||
|
|
||
| public PutRoleMappingResponse(boolean created) { | ||
| super(); |
...t-high-level/src/test/java/org/elasticsearch/client/security/PutRoleMappingRequestTests.java
Show resolved
Hide resolved
- also added few missing cases
jaymode
requested changes
Oct 2, 2018
| */ | ||
| public final class PutRoleMappingResponse { | ||
|
|
||
| private boolean created; |
| */ | ||
| public final class PutRoleMappingRequest implements Validatable, ToXContentObject { | ||
|
|
||
| private String name; |
Member
There was a problem hiding this comment.
make all of the class member variables final
| private List<String> roles; | ||
| private RoleMapperExpression rules; | ||
|
|
||
| @Nullable private Map<String, Object> metadata; |
Member
There was a problem hiding this comment.
metadata cannot be null based on the constructor
| private RoleMapperExpression rules; | ||
|
|
||
| @Nullable private Map<String, Object> metadata; | ||
| @Nullable private RefreshPolicy refreshPolicy; |
Member
There was a problem hiding this comment.
refreshPolicy cannot be null based on the constructor
| } | ||
| final RefreshPolicy refreshPolicy = randomFrom(randomFrom(RefreshPolicy.values()), null); | ||
|
|
||
| if (Strings.hasText(name) == false) { |
Member
There was a problem hiding this comment.
rather than use randomization for these branches can we just test the valid case and invalid cases?
Contributor
Author
There was a problem hiding this comment.
Separated into cases, Thank you.
.../rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingResponse.java
Outdated
Show resolved
Hide resolved
Member
jaymode
approved these changes
Oct 15, 2018
Member
jaymode
left a comment
There was a problem hiding this comment.
I left one comment. Otherwise LGTM
.../rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingResponse.java
Outdated
Show resolved
Hide resolved
bizybot
added a commit
that referenced
this pull request
Oct 16, 2018
Correct the tags mapping with the documentation. This was added in #34171
bizybot
added a commit
that referenced
this pull request
Oct 16, 2018
We added support for role mapper expression DSL in #33745, that allows us to build the role mapper expression used in the role mapping (as rules for determining user roles based on what the boolean expression resolves to). This change now adds support for create/update role mapping API to the high-level rest client.
bizybot
added a commit
that referenced
this pull request
Oct 16, 2018
Correct the tags mapping with the documentation. This was added in #34171
98 tasks
kcm
pushed a commit
that referenced
this pull request
Oct 30, 2018
We added support for role mapper expression DSL in #33745, that allows us to build the role mapper expression used in the role mapping (as rules for determining user roles based on what the boolean expression resolves to). This change now adds support for create/update role mapping API to the high-level rest client.
kcm
pushed a commit
that referenced
this pull request
Oct 30, 2018
Correct the tags mapping with the documentation. This was added in #34171
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.
We added support for role mapper expression DSL in #33745,
that allows us to build the role mapper expression used in the
role mapping (as rules for determining user roles based on what
the boolean expression resolves to).
This change now adds support for create/update role mapping
API to the high-level rest client.