Skip to content

feat: add grant revoke command for session revocation - #14

Merged
aaearon merged 5 commits into
mainfrom
feat/revoke-sessions
Feb 19, 2026
Merged

feat: add grant revoke command for session revocation#14
aaearon merged 5 commits into
mainfrom
feat/revoke-sessions

Conversation

@aaearon

@aaearon aaearon commented Feb 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds grant revoke command with three execution modes: direct (by session ID), --all, and interactive (multi-select prompt)
  • --yes/-y flag skips confirmation for scripting use cases
  • --provider/-p flag filters sessions in --all and interactive modes
  • Session IDs displayed in grant status output for easy reference
  • Code review fixes: factory pattern for revoke command, --provider rejected in direct mode, DRY session formatting via shared ui.FormatSessionOption, buildWorkspaceNameMap moved to shared helpers

Test plan

  • Unit tests for all three revoke modes (direct, --all, interactive)
  • Tests for mutual exclusivity: --all + args, --provider + args
  • Tests for error paths: auth failure, list error, selection error, API error
  • Tests for --yes skipping confirmation in both all and interactive modes
  • Existing status tests pass with shared ui.FormatSessionOption
  • make test, make lint, make build all pass

Add RevokeRequest, RevocationResult (with camel/snake case support),
and RevokeResponse types. Update formatSession() to display session ID.
…erfaces

Add RevokeSessions() method to SCAAccessService, session multi-select
UI components, and interfaces/mocks for the revoke command.
Support direct (by ID), --all, and interactive (multi-select) modes.
Includes --yes flag to skip confirmation and --provider filter.
- Refactor revoke command to use newRevokeCommand(runFn) factory pattern,
  eliminating duplicated command definition between New/NewWithDeps
- Reject --provider flag in direct mode (mutual exclusivity with args)
- Replace duplicated formatSession with shared ui.FormatSessionOption
- Move buildWorkspaceNameMap to cmd/helpers.go for cross-command reuse
- Add test cases: --provider+direct error, list sessions error,
  selection error, --yes skips confirmation in interactive mode
@aaearon
aaearon merged commit 6270f34 into main Feb 19, 2026
1 check passed
@aaearon
aaearon deleted the feat/revoke-sessions branch February 19, 2026 07:07
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