Skip to content

auth: show API key permissions in status - #333

Open
terencecho wants to merge 2 commits into
mainfrom
codex/api-key-self-introspection-status
Open

auth: show API key permissions in status#333
terencecho wants to merge 2 commits into
mainfrom
codex/api-key-self-introspection-status

Conversation

@terencecho

@terencecho terencecho commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds API-key governance details to the existing heygen auth status command. When the active credential is an API key, the CLI calls GET /v3/api_keys/self and reports the key name, status, permission mode and scopes, lifecycle timestamps, and expiration alongside the local credential-source information. It continues to include account information when the key has account.read; a valid custom-scoped key without that permission still gets its own metadata instead of failing status. JSON output keeps the existing top-level data and credential envelope, while --human now renders both available sections instead of hiding credential metadata.

OAuth behavior is unchanged and does not call the API-key-only endpoint. This is intentionally a hand-written enhancement to auth status; the backend endpoint is excluded from generated CLI commands and remains excluded from MCP.

Depends on heygen-com/experiment-framework#49894 and should merge after that backend PR: https://github.com/heygen-com/experiment-framework/pull/49894

Testing

  • go test ./...
  • golangci-lint run ./... (v2.11.4)
  • make build
  • Focused API-key, OAuth, missing-account.read, malformed-response, error-path, and human-output tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant