Skip to content
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

Endpoint getting all expired tokens #21500

Open
cafsenra opened this issue Jan 15, 2025 · 3 comments
Open

Endpoint getting all expired tokens #21500

cafsenra opened this issue Jan 15, 2025 · 3 comments
Labels
enhancement New feature or request more-information-needed Further information is requested

Comments

@cafsenra
Copy link

Summary

We need an api endpoint to get all expired tokens

Motivation

We are generating temporary tokens for argocd. However, tokens get accumulated in UI even if they are expired. Would be nice to have an api endpoint that get all expired endpoints so that we can cleanup easily in bach.

Proposal

We could create an endpoint /api/v1/account/user/tokens that accept querying for expired, is /api/v1/account/user/tokens?expired=true

@cafsenra cafsenra added the enhancement New feature or request label Jan 15, 2025
@crenshaw-dev
Copy link
Member

tokens get accumulated in UI even if they are expired

Can you provide a screenshot of where the tokens are getting accumulated? It sounds like you may be referring to project tokens rather than user account tokens.

@agaudreault
Copy link
Member

What is the business value for a user to have this API? It seems like that would be used more by an argo admin.

If used by an admin, the tokens are in the AppProject manifest, so you can just get the manifest, compare the jwtTokens[].exp with the date of your choosing, and delete them as needed.

There is also already a List token and a Delete token API. These can be used by scripts to delete expired tokens.

The UI can also have logic to add a button "Delete expired tokens" and call the existing delete token API.

I don't think the current API need to be modified, but I could see value on having that button in the UI.

@cafsenra What do you think?

@agaudreault agaudreault added more-information-needed Further information is requested and removed component:security labels Jan 16, 2025
@cafsenra
Copy link
Author

Thank you for your quick reply.
@agaudreault the button in the ui would be a nice addition, however IMHO I see value in the possibility of removing in batch all expired token using the api, as it would avoid to make a request for each token deletion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request more-information-needed Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants