feat(token-cache): add token-cache commands for GitLab Agent tokens

Description

Implement new glab cluster agent token-cache command group to manage cached agent tokens created by glab cluster agent get-token.

Features:

  • glab cluster agent token-cache list - List cached tokens from keyring and filesystem cache with filtering by agent IDs and cache sources
  • glab cluster agent token-cache clear - Clear cached tokens with automatic revocation on GitLab server (configurable)

Both commands support:

  • --agent flag to filter by specific agent IDs
  • --keyring and --filesystem flags to control cache sources
  • --revoke flag on clear command (default: true)

The cache was previously a black box to users. These commands provide visibility and control over cached credentials used by the Kubernetes credential plugin.

Related Issues

Resolves #7953 (closed)

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap

Closes #7953 (closed)

Edited by Swapnaneel Patra

Merge request reports

Loading