-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
HLRC: Add get users action #36332
HLRC: Add get users action #36332
Conversation
This commit adds get user action to the high level rest client.
Pinging @elastic/es-core-features |
Labeling this as WIP as its not entire complete but I wanted to get some immediate feedback to keep this task moving toward completion. I have one key question:
Other than that I'd like someone to have a quick look to verify I'm not missing anything. Once the above question is answered I think I just need to add an explicit test for calls to the |
ping: @elastic/es-security |
@albertzaharovits had originally put the enabled field on the user and then removed it from the object, see #33552 (comment) for the reasoning. |
I did not see anything jump out as missing to me |
client/rest-high-level/src/main/java/org/elasticsearch/client/SecurityClient.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/main/java/org/elasticsearch/client/SecurityClient.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUsersResponse.java
Outdated
Show resolved
Hide resolved
@nknize I would much prefer not to reintroduce I think |
@albertzaharovits awesome.. thx for the feedback. I'll remove the enabled flag from user. Can you clarify one thing for me? If we don't want the client to be concerned about enabled, then why would we return all users and enabled users? Wouldn't we just want to return either all users (if a username is not specified) or the requested user? |
I think that creates a strange API for clients that just want to iterate across all users (they'd have to loop twice, or we'd have to do some fancy merging of I feel it would be a nicer API to just add a |
What I meant was that the current
I was thinking of the following client experience:
The enabled check might as well be |
I guess the main question I have here is: how do I know if a user is enabled or disabled if I do not add the |
…e User parser to GetUsersResponse, and remove enabled flag from user
@albertzaharovits @tvernum I removed the enabled flag from the User. I also moved the User parser to the |
client/rest-high-level/src/main/java/org/elasticsearch/client/SecurityRequestConverters.java
Outdated
Show resolved
Hide resolved
...t/rest-high-level/src/test/java/org/elasticsearch/client/SecurityRequestConvertersTests.java
Outdated
Show resolved
Hide resolved
Looks good, thank you! |
retest this please |
This is probably okay to merge. The failures look unrelated to this change. Will keep trying to reach a passing CI result. |
I left a suggestion inline for
The |
client/rest-high-level/src/main/java/org/elasticsearch/client/SecurityRequestConverters.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/test/java/org/elasticsearch/client/SecurityIT.java
Outdated
Show resolved
Hide resolved
...t/rest-high-level/src/test/java/org/elasticsearch/client/SecurityRequestConvertersTests.java
Outdated
Show resolved
Hide resolved
...t/rest-high-level/src/test/java/org/elasticsearch/client/SecurityRequestConvertersTests.java
Outdated
Show resolved
Hide resolved
...high-level/src/test/java/org/elasticsearch/client/documentation/SecurityDocumentationIT.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.
If you'd be so kind I would like a test in SecurityIT
as well, but it's up to you.
LGTM besides the lack of documentation
* elastic/master: Remove deprecated `useDisMax` from MultiMatchQuery (elastic#36488) HLRC: Add get users action (elastic#36332) fix MultiValuesSourceFieldConfig toXContent (elastic#36525) Add ILM-specific security privileges (elastic#36493) Remove usages of `MockTcpTransport` from zen tests (elastic#36579)
This is labelled 6.6.0 but it has not been backported to 6.x. Just a reminder to backport #36622 once this is backported. |
This commit adds get user action to the high level rest client.
This commit adds get users action to the high level rest client.
Relates #29827