Support updates of API key attributes [service layer]#87924
Merged
n1v0lg merged 113 commits intoelastic:masterfrom Jun 29, 2022
Merged
Support updates of API key attributes [service layer]#87924n1v0lg merged 113 commits intoelastic:masterfrom
n1v0lg merged 113 commits intoelastic:masterfrom
Conversation
ywangd
reviewed
Jun 28, 2022
Member
ywangd
left a comment
There was a problem hiding this comment.
This is almost ready. I don't have major points. Other than below comments, I also felt we are a bit light on debug loggings. For example, when the version number gets updated, I think it's worth for a logging message.
...e/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/UpdateApiKeyRequest.java
Show resolved
Hide resolved
...e/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/UpdateApiKeyRequest.java
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/core/security/action/apikey/UpdateApiKeyRequestTests.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
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java
Outdated
Show resolved
Hide resolved
...ty/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java
Show resolved
Hide resolved
...ty/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java
Outdated
Show resolved
Hide resolved
...ty/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java
Outdated
Show resolved
Hide resolved
...ty/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java
Show resolved
Hide resolved
...ty/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/ApiKeyIntegTests.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Build failure is unrelated and tracked here |
ywangd
approved these changes
Jun 28, 2022
Member
ywangd
left a comment
There was a problem hiding this comment.
LGTM
Thanks for the iterations!
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
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@elasticmachine run elasticsearch-ci/part-1-fips |
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.
Service level implementation to add support for updating attributes of
existing API keys. This allows end-users to modify privileges and
metadata associated with API keys dynamically, without requiring
rolling out new API keys every time there is a change.
Updatable attributes are
role_descriptorsandmetadata. Severalother attributes are updated automatically, on every update call,
including
limited_by_role_descriptors,creator, andversion. APIkey attributes are replaced, not merged.
On every update, the API key doc cache is cleared for the updated API
key.
This PR implements the necessary service layer changes in
ApiKeyService. I will integrate this with the REST and transportlayers in a subsequent PR.
Relates: #87870
Note: labeling
>non-issuesince I would rather include a>featuretag and changelog entry on the REST & transport layer PR.