Skip to content

feat: add service-account api-keys commands#938

Merged
mbevc1 merged 10 commits into
mainfrom
20260606_feat_api_keys
Jun 9, 2026
Merged

feat: add service-account api-keys commands#938
mbevc1 merged 10 commits into
mainfrom
20260606_feat_api_keys

Conversation

@mbevc1

@mbevc1 mbevc1 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Add api-keys (alias ak) resource to existing and extend verbs to manage Service Account API keys via the CLI:

  • create — create an API key (requires --service-account and --description; optional --expires-at)
  • revoke — revoke an API key by KEY-ID, with a confirmation prompt (--assume-yes to skip)
  • rotate — rotate an API key by KEY-ID, with a configurable grace period
  • list — list a service account's API keys

Also adds a shared util for using terminal colours.

Closes #937

Add a `service-account` (alias `sa`) command group with an `api-keys`
(alias `ak`) subgroup to manage Service Account API keys via the CLI:

- `create`  — create an API key (requires --service-account and --description;
  optional --expires-at)
- `revoke`  — revoke an API key by KEY-ID, with a confirmation prompt (--yes to skip)
- `rotate`  — rotate an API key by KEY-ID, with a configurable grace period
- `list`    — list a service account's API keys

Closes #937
@mbevc1 mbevc1 added enhancement New feature or request tech-debt go Pull requests that update go code labels Jun 6, 2026
@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2m 23s —— View job


PR Review: feat: add service-account api-keys commands

Working on a comprehensive review...

  • Phase 1: Static analysis (build, vet, mod tidy)
  • Phase 2: Read and review code changes
  • Phase 3: Post inline comments and summary

Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/listApiKeys.go Outdated
Comment thread cmd/kosli/serviceAccountApiKeys.go
Comment thread cmd/kosli/revokeApiKey.go Outdated
Comment thread cmd/kosli/revokeApiKey.go Outdated
Comment thread cmd/kosli/rotateApiKey.go Outdated
Comment thread cmd/kosli/createApiKey.go
Comment thread cmd/kosli/serviceAccountApiKeys.go
Comment thread cmd/kosli/rotateApiKey.go
Comment thread cmd/kosli/revokeApiKey.go
Comment thread cmd/kosli/revokeApiKey.go Outdated
Comment thread cmd/kosli/revokeApiKey.go Outdated
Comment thread cmd/kosli/serviceAccountApiKeys.go
Comment thread cmd/kosli/rotateApiKey.go Outdated
Comment thread cmd/kosli/listApiKeys.go
Comment thread cmd/kosli/revokeApiKey.go
Comment thread cmd/kosli/serviceAccountApiKeys.go
Comment thread cmd/kosli/revokeApiKey.go Outdated
Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/rotateApiKey.go
Comment thread cmd/kosli/rotateApiKey.go
Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/serviceAccount.go Outdated
Comment thread cmd/kosli/revokeApiKey.go
Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/serviceAccount_test.go Outdated
Comment thread cmd/kosli/listApiKeys.go
@mbevc1

mbevc1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

How confident are we that the tests using fakes are going to standup to the API changing?

Could you please expand on that @tooky?

Also introduced fixured from API specs now, which should address this @tooky

Comment thread cmd/kosli/serviceAccountApiKeys.go Outdated
Comment thread cmd/kosli/rotateApiKey.go
Comment thread cmd/kosli/revokeApiKey.go Outdated
Comment thread cmd/kosli/serviceAccount_test.go Outdated
Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/updateApiKey.go Outdated
Comment thread cmd/kosli/deleteApiKey.go
Comment thread cmd/kosli/deleteApiKey.go
Comment thread cmd/kosli/apiKey_test.go
Comment thread cmd/kosli/delete.go
Comment thread cmd/kosli/deleteApiKey.go
Comment thread cmd/kosli/updateApiKey.go Outdated
Comment thread cmd/kosli/deleteApiKey.go Outdated
Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/cli_utils.go
Comment thread cmd/kosli/apiKey.go
@dangrondahl dangrondahl self-requested a review June 9, 2026 09:08
@mbevc1 mbevc1 merged commit 2cb999e into main Jun 9, 2026
22 of 26 checks passed
@mbevc1 mbevc1 deleted the 20260606_feat_api_keys branch June 9, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code tech-debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add support for Service Account keys

3 participants