-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide endpoint for token usage overview page #21315
base: master
Are you sure you want to change the base?
Conversation
…ntation to TokenUsageResource and deal with errors while parsing a search-query.
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.
Nice work!
However, the endpoint should return the data transfer object, and the TokenUsage
be the persisted entity. So I suggest renaming the two classes.
@ApiParam(name = "sort", | ||
value = "The field to sort the result on", | ||
required = true, | ||
allowableValues = "title,description") |
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.
title and description are no available fields.
Fixes #21396
To allow an overview of all existing access-tokens and their owners, there's a new searchable, paginated endpoint providing all necessary data.
Description
The endpoint returns the following fields per existing token:
Motivation and Context
An admin can create auth tokens for token access for a user. If this user is a user from OIDC/LDAP (e.g. keycloak) and that user is disabled later in the auth server, the auth tokens still remain valid, because the user still has the "enabled" flag in the Graylog Database. There is no sync process which will subsequently remove the enabled flag on the record, regardless of the status of the external account. As a result, an API token belonging to a disabled or deleted user can potentially be used to perform actions.
This PR provides all required information for an overview-page across al users and tokens, so the admin doesn't need to check all tokens user by user manually, but gets all of them in one place.
How Has This Been Tested?
There are some unit-tests for the newly created classes, but the functionality was also tested locally using curl.
Types of changes
Checklist: