auth: show API key permissions in status - #333
Open
terencecho wants to merge 2 commits into
Open
Conversation
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.
Description
Adds API-key governance details to the existing
heygen auth statuscommand. When the active credential is an API key, the CLI callsGET /v3/api_keys/selfand 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 hasaccount.read; a valid custom-scoped key without that permission still gets its own metadata instead of failing status. JSON output keeps the existing top-leveldataandcredentialenvelope, while--humannow 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 buildaccount.read, malformed-response, error-path, and human-output tests