Skip to content

Conversation

@albertzaharovits
Copy link
Contributor

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.

CC @elastic/es-security

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

builder.field("email", user.getEmail());
}
builder.field("metadata", user.getMetadata());
builder.field("enabled", enabled);
Copy link
Contributor Author

@albertzaharovits albertzaharovits Nov 1, 2018

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;
Copy link
Contributor Author

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);
}

Copy link
Contributor Author

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 .

Copy link
Member

@jaymode jaymode left a 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

@albertzaharovits
Copy link
Contributor Author

True, thank you for pointing it out Jay, it did not realized it.

@albertzaharovits albertzaharovits merged commit 85a8b51 into elastic:master Nov 8, 2018
@albertzaharovits albertzaharovits deleted the hlrc_nit_put_user branch November 8, 2018 16:42
albertzaharovits added a commit that referenced this pull request Nov 8, 2018
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.
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment