Repository navigation
feat(gitlab): list the access tokens of all groups - #66
Merged
Merged
Conversation
Add `opsi gitlab group access-tokens`, which walks through every group and prints the group (path and URL) with its access tokens: name, scopes and expiration. Revoked tokens are left out. With --expiring <days> it shows only the tokens already expired or expiring within that number of days. Groups where the tokens cannot be read (no permission) are listed at the end instead of stopping the command. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Summary
GitLab has no UI to see all the group access tokens at once, so renewing them means opening every group and some get forgotten. New command:
For every group with tokens it prints the group (path and URL) and, for each token, name, scopes and expiration:
--expiring <days>shows only the tokens already expired or expiring within that number of days (tokens without expiration are not shown).apiandadmin_modeis enough, no need to be owner of each group.Test plan
go vet ./...andgo test ./...(expiration formatting and filter, revoked tokens excluded, group with 403 does not stop the listing)git.beliven.dev: 85 groups, 4 tokens, no errors. Cross-checked with a separate read-onlycurl/jqscan of the API: same groups, same tokens and expirationsopsi gitlab group access-tokens --expiring 30🤖 Generated with Claude Code