-
Notifications
You must be signed in to change notification settings - Fork 25.7k
HLRest: refactor put_user to utilize User object
#35188
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
HLRest: refactor put_user to utilize User object
#35188
Conversation
|
Pinging @elastic/es-core-infra |
| builder.field("email", user.getEmail()); | ||
| } | ||
| builder.field("metadata", user.getMetadata()); | ||
| builder.field("enabled", enabled); |
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.
enabled has to be part of the request body entity, otherwise all users are put/updated as enabled.
|
|
||
| private final String username; | ||
| private final Collection<String> roles; | ||
| private final Set<String> roles; |
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 User is both part of a response as well as a request, we have to acknowledge that roles can change order (through a round trip serialize-deserialize) but the User is still the same (from the equals POV).
| "/_xpack/security/user/" + putUserRequest.getUser().getUsername()); | ||
| highLevelClient().getLowLevelClient().performRequest(deleteUserRequest); | ||
| } | ||
|
|
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.
Added IT for put_user .
jaymode
left a comment
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. Note, this is technically breaking-java since put user is in 6.5 the old way
|
True, thank you for pointing it out Jay, it did not realized it. |
This follows #33552 , when the `_authenticate` API added a new `User` object for the API's response. This changes the `put_user` API to also employ a `User` object in the request. The User object changed slightly. A bug with put_user only putting/updating enabled (but not disabled) users has been fixed.
This follows #33552 , when the
_authenticateAPI added a newUserobject for the API's response.This changes the
put_userAPI to also employ aUserobject in the request.The
Userobject changed slightly.A bug with
put_useronly putting/updating enabled (but not disabled) users has been fixed.CC @elastic/es-security