-
Notifications
You must be signed in to change notification settings - Fork 320
Change API token index actions to use action listeners and limit to 100 tokens outstanding #5147
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
Change API token index actions to use action listeners and limit to 100 tokens outstanding #5147
Conversation
Signed-off-by: Derek Ho <[email protected]>
…curity into actionget-limit
Signed-off-by: Derek Ho <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/api-tokens #5147 +/- ##
======================================================
- Coverage 71.46% 71.37% -0.09%
======================================================
Files 334 355 +21
Lines 22552 23475 +923
Branches 3590 3686 +96
======================================================
+ Hits 16117 16756 +639
- Misses 4642 4883 +241
- Partials 1793 1836 +43
🚀 New features to boost your workflow:
|
src/main/java/org/opensearch/security/action/apitokens/ApiTokenAction.java
Outdated
Show resolved
Hide resolved
try { | ||
XContentBuilder builder = channel.newBuilder(); | ||
builder.startObject(); | ||
builder.field("Api Token: ", token); |
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.
Let's just have the field name be token
. No need to include the colon here because this gets serialized to json and will get included.
src/main/java/org/opensearch/security/action/apitokens/ApiTokenAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/action/apitokens/ApiTokenIndexHandler.java
Show resolved
Hide resolved
Signed-off-by: Derek Ho <[email protected]>
8750e8b
into
opensearch-project:feature/api-tokens
Description
Changes index operations on the api token index to be action listeners instead of action get. Also implements 100 api token limit.
Issues Resolved
[List any issues this PR will resolve]
Is this a backport? If so, please add backport PR # and/or commits #, and remove
backport-failed
label from the original PR.Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.