Update revert-user-token script#180
Open
hippogr wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the revokeUserTokens.py operator tool to revoke user tokens through the rest-server REST API (DELETE /api/v1/token) instead of directly deleting Kubernetes secrets in the pai-user-token namespace. This ensures the rest-server's in-memory token cache is also invalidated, fixing the issue where stale cached tokens could still be accepted after a manual secret cleanup. The alert-manager application token is still restored afterwards via the existing Kubernetes secret path.
Changes:
- Added
revoke_all_tokens_via_api()that calls the rest-server token DELETE endpoint with an admin bearer token. - Removed the
delete_all_token_secrets()function that deleted secrets directly via the Kubernetes API. - Added interactive prompts for cluster name and admin bearer token, and simplified default-argument call sites for
get_application_token/add_token_to_k8s_secret.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Update revert-user-token script to use rest server API instead of cleaning K8S secrets directly so that the cache tokens can be also updated.