Simplify API key service API#44935
Merged
bizybot merged 8 commits intoelastic:manage-own-api-key-privilegefrom Aug 6, 2019
Merged
Simplify API key service API#44935bizybot merged 8 commits intoelastic:manage-own-api-key-privilegefrom
bizybot merged 8 commits intoelastic:manage-own-api-key-privilegefrom
Conversation
This commit merely refactors API key service interface for retrieving and invalidating API keys. This avoids the use of `*Response` classes to service layer. The service layer need not do any authorization so we do not need multiple ways to retrieve or invalidate API keys but one interface to do each operation.
Collaborator
|
Pinging @elastic/es-security |
added 2 commits
July 29, 2019 15:32
albertzaharovits
approved these changes
Jul 30, 2019
Contributor
albertzaharovits
left a comment
There was a problem hiding this comment.
Just some minor nits, otherwise LGTM.
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java
Outdated
Show resolved
Hide resolved
| static final GetApiKeysResult EMPTY_RESULT = new GetApiKeysResult(Collections.emptyList()); | ||
| private final Collection<ApiKey> foundApiKeysInfo; | ||
|
|
||
| public GetApiKeysResult(Collection<ApiKey> foundApiKeysInfo) { |
Contributor
There was a problem hiding this comment.
Maybe make this constructor look more like InvalidateApiKeysResult.
Contributor
Author
There was a problem hiding this comment.
ScrollHelper.fetchAllByEntity returns a Collection<T> and so this is a Collection than a List, avoiding the conversion here.
Contributor
|
I don't think there's any need to create |
*Response in service layer
tvernum
approved these changes
Aug 6, 2019
Contributor
tvernum
left a comment
There was a problem hiding this comment.
LGTM, with a couple of nits.
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java
Show resolved
Hide resolved
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java
Outdated
Show resolved
Hide resolved
added 2 commits
August 6, 2019 19:25
Contributor
Author
|
@elasticmachine test this please |
56 tasks
39 tasks
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.
This commit merely refactors API key service interface
for retrieving and invalidating API keys.
The service layer need not do any authorization so we do not need
multiple interfaces to retrieve or invalidate API keys but one interface
to do each operation.
Relates #40031