feat: add grant revoke command for session revocation - #14
Merged
Conversation
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
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.
Summary
grant revokecommand with three execution modes: direct (by session ID),--all, and interactive (multi-select prompt)--yes/-yflag skips confirmation for scripting use cases--provider/-pflag filters sessions in--alland interactive modesgrant statusoutput for easy reference--providerrejected in direct mode, DRY session formatting via sharedui.FormatSessionOption,buildWorkspaceNameMapmoved to shared helpersTest plan
--all+ args,--provider+ args--yesskipping confirmation in both all and interactive modesui.FormatSessionOptionmake test,make lint,make buildall pass