Skip to content

Conversation

@ThomasK33
Copy link
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
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 changed the base branch from graphite-base/19985 to thomask33/09-25-resource_scoped_api_keys_in_codersdk October 22, 2025 11:18
@ThomasK33 ThomasK33 force-pushed the thomask33/09-25-resource_scoped_api_keys_in_codersdk branch from 1eb446d to 69ca337 Compare October 22, 2025 23:28
@github-actions github-actions bot removed the stale This issue is like stale bread. label Oct 23, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from d2ce8e3 to d7a97c4 Compare October 23, 2025 13:08
@ThomasK33 ThomasK33 force-pushed the thomask33/09-25-resource_scoped_api_keys_in_codersdk branch 2 times, most recently from 5a7d504 to a8de59d Compare October 23, 2025 13:29
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from d7a97c4 to 26ce0ed Compare October 23, 2025 13:29
@ThomasK33 ThomasK33 force-pushed the thomask33/09-25-resource_scoped_api_keys_in_codersdk branch from a8de59d to 71f4aa9 Compare October 23, 2025 16:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 26ce0ed to b5682aa Compare October 23, 2025 16:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-25-resource_scoped_api_keys_in_codersdk branch from 71f4aa9 to 42451c1 Compare October 23, 2025 17:05
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from b5682aa to 0f1027b Compare October 23, 2025 17:05
@ThomasK33 ThomasK33 changed the base branch from thomask33/09-25-resource_scoped_api_keys_in_codersdk to graphite-base/19985 October 24, 2025 11:33
@ThomasK33 ThomasK33 force-pushed the graphite-base/19985 branch from 42451c1 to f684831 Compare October 24, 2025 11:34
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 0f1027b to ddaca3e Compare October 24, 2025 11:34
@graphite-app graphite-app bot changed the base branch from graphite-base/19985 to main October 24, 2025 11:34
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch 4 times, most recently from 16cf91a to 33ee2a4 Compare October 24, 2025 14:53
@ThomasK33 ThomasK33 requested a review from Emyrk October 24, 2025 15:06
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 33ee2a4 to 6bdcaf5 Compare October 24, 2025 16:45
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
@ThomasK33 ThomasK33 force-pushed the thomask33/09-26-add_token_scope_support_in_cli branch from 6bdcaf5 to e41d7f4 Compare October 27, 2025 15:18
@ThomasK33 ThomasK33 merged commit cadf135 into main Oct 27, 2025
33 checks passed
@ThomasK33 ThomasK33 deleted the thomask33/09-26-add_token_scope_support_in_cli branch October 27, 2025 16:07
@github-actions github-actions bot locked and limited conversation to collaborators Oct 27, 2025
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

3 participants