-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Deprecate HLRC security methods #37883
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
Merged
hub-cap
merged 5 commits into
elastic:master
from
hub-cap:rest_security_deprecate_empty_response
Feb 4, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
70a46da
Deprecate HLRC security methods
hub-cap d29eabd
Merge remote-tracking branch 'upstream/master' into rest_security_dep…
hub-cap 4dc84ad
deprecated methods call correct methods
hub-cap 856543d
Merge remote-tracking branch 'upstream/master' into rest_security_dep…
hub-cap b34952a
Merge remote-tracking branch 'upstream/master' into rest_security_dep…
hub-cap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,6 @@ | |
| import org.elasticsearch.client.security.DeleteUserRequest; | ||
| import org.elasticsearch.client.security.DeleteUserResponse; | ||
| import org.elasticsearch.client.security.DisableUserRequest; | ||
| import org.elasticsearch.client.security.EmptyResponse; | ||
| import org.elasticsearch.client.security.EnableUserRequest; | ||
| import org.elasticsearch.client.security.GetPrivilegesRequest; | ||
| import org.elasticsearch.client.security.GetPrivilegesResponse; | ||
|
|
@@ -235,14 +234,12 @@ public void getRoleMappingsAsync(final GetRoleMappingsRequest request, final Req | |
| * | ||
| * @param request the request with the user to enable | ||
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @return the response from the enable user call | ||
| * @return {@code true} if the request succeeded (the user is enabled) | ||
| * @throws IOException in case there is a problem sending the request or parsing back the response | ||
| * @deprecated use {@link #enableUser(RequestOptions, EnableUserRequest)} instead | ||
| */ | ||
| @Deprecated | ||
| public EmptyResponse enableUser(EnableUserRequest request, RequestOptions options) throws IOException { | ||
| return restHighLevelClient.performRequestAndParseEntity(request, SecurityRequestConverters::enableUser, options, | ||
| EmptyResponse::fromXContent, emptySet()); | ||
| public boolean enableUser(EnableUserRequest request, RequestOptions options) throws IOException { | ||
| return restHighLevelClient.performRequest(request, SecurityRequestConverters::enableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, emptySet()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -254,10 +251,11 @@ public EmptyResponse enableUser(EnableUserRequest request, RequestOptions option | |
| * @param request the request with the user to enable | ||
| * @return {@code true} if the request succeeded (the user is enabled) | ||
| * @throws IOException in case there is a problem sending the request or parsing back the response | ||
| * @deprecated use {@link #enableUser(EnableUserRequest, RequestOptions)} instead | ||
| */ | ||
| @Deprecated | ||
| public boolean enableUser(RequestOptions options, EnableUserRequest request) throws IOException { | ||
| return restHighLevelClient.performRequest(request, SecurityRequestConverters::enableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, emptySet()); | ||
| return enableUser(request, options); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -268,13 +266,11 @@ public boolean enableUser(RequestOptions options, EnableUserRequest request) thr | |
| * @param request the request with the user to enable | ||
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @param listener the listener to be notified upon request completion | ||
| * @deprecated use {@link #enableUserAsync(RequestOptions, EnableUserRequest, ActionListener)} instead | ||
| */ | ||
| @Deprecated | ||
| public void enableUserAsync(EnableUserRequest request, RequestOptions options, | ||
| ActionListener<EmptyResponse> listener) { | ||
| restHighLevelClient.performRequestAsyncAndParseEntity(request, SecurityRequestConverters::enableUser, options, | ||
| EmptyResponse::fromXContent, listener, emptySet()); | ||
| ActionListener<Boolean> listener) { | ||
| restHighLevelClient.performRequestAsync(request, SecurityRequestConverters::enableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, listener, emptySet()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -285,11 +281,12 @@ public void enableUserAsync(EnableUserRequest request, RequestOptions options, | |
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @param request the request with the user to enable | ||
| * @param listener the listener to be notified upon request completion | ||
| * @deprecated use {@link #enableUserAsync(EnableUserRequest, RequestOptions, ActionListener)} instead | ||
| */ | ||
| @Deprecated | ||
| public void enableUserAsync(RequestOptions options, EnableUserRequest request, | ||
| ActionListener<Boolean> listener) { | ||
| restHighLevelClient.performRequestAsync(request, SecurityRequestConverters::enableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, listener, emptySet()); | ||
| enableUserAsync(request, options, listener); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -299,14 +296,12 @@ public void enableUserAsync(RequestOptions options, EnableUserRequest request, | |
| * | ||
| * @param request the request with the user to disable | ||
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @return the response from the enable user call | ||
| * @return {@code true} if the request succeeded (the user is disabled) | ||
| * @throws IOException in case there is a problem sending the request or parsing back the response | ||
| * @deprecated use {@link #disableUser(RequestOptions, DisableUserRequest)} instead | ||
| */ | ||
| @Deprecated | ||
| public EmptyResponse disableUser(DisableUserRequest request, RequestOptions options) throws IOException { | ||
| return restHighLevelClient.performRequestAndParseEntity(request, SecurityRequestConverters::disableUser, options, | ||
| EmptyResponse::fromXContent, emptySet()); | ||
| public boolean disableUser(DisableUserRequest request, RequestOptions options) throws IOException { | ||
| return restHighLevelClient.performRequest(request, SecurityRequestConverters::disableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, emptySet()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -318,10 +313,11 @@ public EmptyResponse disableUser(DisableUserRequest request, RequestOptions opti | |
| * @param request the request with the user to disable | ||
| * @return {@code true} if the request succeeded (the user is disabled) | ||
| * @throws IOException in case there is a problem sending the request or parsing back the response | ||
| * @deprecated use {@link #disableUser(DisableUserRequest, RequestOptions)} instead | ||
| */ | ||
| @Deprecated | ||
| public boolean disableUser(RequestOptions options, DisableUserRequest request) throws IOException { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you make this method delegate to the one that is not deprecated. |
||
| return restHighLevelClient.performRequest(request, SecurityRequestConverters::disableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, emptySet()); | ||
| return disableUser(request, options); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -332,13 +328,11 @@ public boolean disableUser(RequestOptions options, DisableUserRequest request) t | |
| * @param request the request with the user to disable | ||
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @param listener the listener to be notified upon request completion | ||
| * @deprecated use {@link #disableUserAsync(RequestOptions, DisableUserRequest, ActionListener)} instead | ||
| */ | ||
| @Deprecated | ||
| public void disableUserAsync(DisableUserRequest request, RequestOptions options, | ||
| ActionListener<EmptyResponse> listener) { | ||
| restHighLevelClient.performRequestAsyncAndParseEntity(request, SecurityRequestConverters::disableUser, options, | ||
| EmptyResponse::fromXContent, listener, emptySet()); | ||
| ActionListener<Boolean> listener) { | ||
| restHighLevelClient.performRequestAsync(request, SecurityRequestConverters::disableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, listener, emptySet()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -349,11 +343,12 @@ public void disableUserAsync(DisableUserRequest request, RequestOptions options, | |
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @param request the request with the user to disable | ||
| * @param listener the listener to be notified upon request completion | ||
| * @deprecated use {@link #disableUserAsync(DisableUserRequest, RequestOptions, ActionListener)} instead | ||
| */ | ||
| @Deprecated | ||
| public void disableUserAsync(RequestOptions options, DisableUserRequest request, | ||
| ActionListener<Boolean> listener) { | ||
| restHighLevelClient.performRequestAsync(request, SecurityRequestConverters::disableUser, options, | ||
| RestHighLevelClient::convertExistsResponse, listener, emptySet()); | ||
| disableUserAsync(request, options, listener); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -523,14 +518,12 @@ public void getSslCertificatesAsync(RequestOptions options, ActionListener<GetSs | |
| * | ||
| * @param request the request with the user's new password | ||
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @return the response from the change user password call | ||
| * @return {@code true} if the request succeeded (the new password was set) | ||
| * @throws IOException in case there is a problem sending the request or parsing back the response | ||
| * @deprecated use {@link #changePassword(RequestOptions, ChangePasswordRequest)} instead | ||
| */ | ||
| @Deprecated | ||
| public EmptyResponse changePassword(ChangePasswordRequest request, RequestOptions options) throws IOException { | ||
| return restHighLevelClient.performRequestAndParseEntity(request, SecurityRequestConverters::changePassword, options, | ||
| EmptyResponse::fromXContent, emptySet()); | ||
| public boolean changePassword(ChangePasswordRequest request, RequestOptions options) throws IOException { | ||
| return restHighLevelClient.performRequest(request, SecurityRequestConverters::changePassword, options, | ||
| RestHighLevelClient::convertExistsResponse, emptySet()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -542,10 +535,11 @@ public EmptyResponse changePassword(ChangePasswordRequest request, RequestOption | |
| * @param request the request with the user's new password | ||
| * @return {@code true} if the request succeeded (the new password was set) | ||
| * @throws IOException in case there is a problem sending the request or parsing back the response | ||
| * @deprecated use {@link #changePassword(ChangePasswordRequest, RequestOptions)} instead | ||
| */ | ||
| @Deprecated | ||
| public boolean changePassword(RequestOptions options, ChangePasswordRequest request) throws IOException { | ||
| return restHighLevelClient.performRequest(request, SecurityRequestConverters::changePassword, options, | ||
| RestHighLevelClient::convertExistsResponse, emptySet()); | ||
| return changePassword(request, options); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -556,13 +550,11 @@ public boolean changePassword(RequestOptions options, ChangePasswordRequest requ | |
| * @param request the request with the user's new password | ||
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @param listener the listener to be notified upon request completion | ||
| * @deprecated use {@link #changePasswordAsync(RequestOptions, ChangePasswordRequest, ActionListener)} instead | ||
| */ | ||
| @Deprecated | ||
| public void changePasswordAsync(ChangePasswordRequest request, RequestOptions options, | ||
| ActionListener<EmptyResponse> listener) { | ||
| restHighLevelClient.performRequestAsyncAndParseEntity(request, SecurityRequestConverters::changePassword, options, | ||
| EmptyResponse::fromXContent, listener, emptySet()); | ||
| ActionListener<Boolean> listener) { | ||
| restHighLevelClient.performRequestAsync(request, SecurityRequestConverters::changePassword, options, | ||
| RestHighLevelClient::convertExistsResponse, listener, emptySet()); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -573,14 +565,14 @@ public void changePasswordAsync(ChangePasswordRequest request, RequestOptions op | |
| * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
| * @param request the request with the user's new password | ||
| * @param listener the listener to be notified upon request completion | ||
| * @deprecated use {@link #changePasswordAsync(ChangePasswordRequest, RequestOptions, ActionListener)} instead | ||
| */ | ||
| @Deprecated | ||
| public void changePasswordAsync(RequestOptions options, ChangePasswordRequest request, | ||
| ActionListener<Boolean> listener) { | ||
| restHighLevelClient.performRequestAsync(request, SecurityRequestConverters::changePassword, options, | ||
| RestHighLevelClient::convertExistsResponse, listener, emptySet()); | ||
| changePasswordAsync(request, options, listener); | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Delete a role mapping. | ||
| * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html"> | ||
|
|
||
39 changes: 0 additions & 39 deletions
39
client/rest-high-level/src/main/java/org/elasticsearch/client/security/EmptyResponse.java
This file was deleted.
Oops, something went wrong.
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
51 changes: 0 additions & 51 deletions
51
...t/rest-high-level/src/test/java/org/elasticsearch/client/security/EmptyResponseTests.java
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.