Skip to content

feat: add scoped token support to CLI#19985

Merged
ThomasK33 merged 1 commit into
mainfrom
thomask33/09-26-add_token_scope_support_in_cli
Oct 27, 2025
Merged

feat: add scoped token support to CLI#19985
ThomasK33 merged 1 commit into
mainfrom
thomask33/09-26-add_token_scope_support_in_cli

Conversation

@ThomasK33
Copy link
Copy Markdown
Member

Add support for scoped API tokens in CLI

This PR adds CLI support for creating and viewing API tokens with scopes and allow lists. It includes:

  • New --scope and --allow flags for the tokens create command
  • A new tokens view command to display detailed information about a token
  • Updated table columns in tokens list to show scopes and allow list entries
  • Updated help text and examples

These changes enable users to create tokens with limited permissions through the CLI, similar to the existing functionality in the web UI.

Copy link
Copy Markdown
Member Author

ThomasK33 commented Sep 26, 2025

@ThomasK33 ThomasK33 linked an issue Sep 26, 2025 that may be closed by this pull request
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch 3 times, most recently from e31d661 to c68b64b Compare September 26, 2025 14:27
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from b0bed7f to acc9e28 Compare September 26, 2025 14:27
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from c68b64b to f277494 Compare September 26, 2025 18:05
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from acc9e28 to 53815d9 Compare September 26, 2025 18:05
@ThomasK33 ThomasK33 marked this pull request as ready for review September 26, 2025 18:58
@ThomasK33 ThomasK33 requested review from Emyrk and mafredri September 26, 2025 18:58
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from f277494 to 51502b5 Compare September 28, 2025 10:53
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 53815d9 to 326dbdc Compare September 28, 2025 10:53
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 51502b5 to 9384a37 Compare September 29, 2025 08:25
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 326dbdc to f4dd33e Compare September 29, 2025 08:25
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 1a42b23 to 1d1732b Compare October 6, 2025 10:09
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 6ec4b94 to d9f66ca Compare October 6, 2025 10:10
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 1d1732b to 518faff Compare October 6, 2025 10:48
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from d9f66ca to 11f6a63 Compare October 6, 2025 10:48
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 518faff to 4de874d Compare October 6, 2025 11:24
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 11f6a63 to 75d7b64 Compare October 6, 2025 11:24
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 4de874d to fd7a0fb Compare October 6, 2025 11:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 75d7b64 to f244193 Compare October 6, 2025 11:57
@Emyrk Emyrk self-assigned this Oct 6, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from fd7a0fb to d06529e Compare October 6, 2025 21:16
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from f244193 to 2f3304e Compare October 6, 2025 21:16
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from d06529e to a343213 Compare October 6, 2025 21:40
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 2f3304e to 1dae22e Compare October 6, 2025 21:40
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from a343213 to 95b0229 Compare October 7, 2025 16:38
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 1dae22e to 7eb739c Compare October 7, 2025 16:38
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 95b0229 to 8487b82 Compare October 9, 2025 12:54
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 7eb739c to dc96969 Compare October 9, 2025 12:54
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 8487b82 to c2459aa Compare October 9, 2025 13:06
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch 2 times, most recently from 521c665 to 411dc32 Compare October 9, 2025 15:38
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from c2459aa to 0587b0c Compare October 9, 2025 15:38
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 411dc32 to bef5a44 Compare October 14, 2025 13:36
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_api_key_patch_endpoint branch from 0587b0c to 3727a3d Compare October 14, 2025 13:36
Comment thread cli/tokens_scope_flag.go Outdated
Comment thread cli/tokens.go Outdated
Comment thread cli/tokens.go Outdated
Comment thread cli/tokens.go Outdated
Comment thread cli/tokens_allowlist_flag.go Outdated
Comment thread cli/tokens_allowlist_flag.go Outdated
Comment thread cli/tokens.go Outdated
This commit adds comprehensive support for token scoping and 
allow-listing in the CLI token management commands:

- Add --scope flag to create scoped tokens with specific 
  permissions
- Add --allow flag to create tokens restricted to specific 
  resources
- Display scopes and allow-list in token list/view commands
- Add tokens view subcommand for detailed token inspection
- Update help text and documentation with scoping examples
- Add comprehensive test coverage for new functionality
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: coder tokens create/list/update flags

2 participants