Skip to content

feat: replace ExternalAPIKeyScopes with detailed ScopeCatalog#20248

Closed
ThomasK33 wants to merge 1 commit into
thomask33/09-30-api_allowlist_structured_jsonfrom
thomask33/10-09-add_scope_catalog_api
Closed

feat: replace ExternalAPIKeyScopes with detailed ScopeCatalog#20248
ThomasK33 wants to merge 1 commit into
thomask33/09-30-api_allowlist_structured_jsonfrom
thomask33/10-09-add_scope_catalog_api

Conversation

@ThomasK33
Copy link
Copy Markdown
Member

Enhance API Key Scopes Catalog

This PR enhances the API key scopes catalog by replacing the flat list of external scopes with a more structured and informative catalog. The new catalog organizes scopes into three categories:

  1. Special scopes - Legacy scopes like "all" and "application_connect" that remain for backward compatibility
  2. Low-level scopes - Basic resource:action pairs with metadata about the resource and action
  3. Composite scopes - Higher-level "coder:*" scopes with information about what low-level scopes they expand to

The changes include:

  • Replacing ExternalAPIKeyScopes with a more detailed ScopeCatalog structure
  • Adding helper functions to extract metadata about each scope type
  • Updating API documentation and tests to reflect the new structure
  • Renaming the endpoint handler from listExternalScopes to listScopeCatalog

This enhancement provides more context about each scope, making it easier for users to understand what permissions they're requesting when creating API keys.

Copy link
Copy Markdown
Member Author

ThomasK33 commented Oct 9, 2025

@ThomasK33 ThomasK33 force-pushed the thomask33/10-09-add_scope_catalog_api branch from d26265a to d8c07af Compare October 14, 2025 13:36
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 90212e3 to ac2e772 Compare October 14, 2025 13:36
@ThomasK33 ThomasK33 force-pushed the thomask33/10-09-add_scope_catalog_api branch from d8c07af to 8b28268 Compare October 14, 2025 13:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch 2 times, most recently from fd23c4d to a48aa91 Compare October 14, 2025 14:11
@ThomasK33 ThomasK33 force-pushed the thomask33/10-09-add_scope_catalog_api branch from 8b28268 to 2026c82 Compare October 14, 2025 14:11
@github-actions github-actions Bot added the stale This issue is like stale bread. label Oct 22, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/10-09-add_scope_catalog_api branch from 2026c82 to c0f9ab2 Compare October 22, 2025 11:17
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from a48aa91 to 6ed027c Compare October 22, 2025 11:17
@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-30-api_allowlist_structured_json branch from 6ed027c to 0126ab0 Compare October 24, 2025 14:20
@ThomasK33 ThomasK33 force-pushed the thomask33/10-09-add_scope_catalog_api branch from c0f9ab2 to 8108da0 Compare October 24, 2025 14:20
Replace the scopes endpoint response with a structured catalog so API
clients can inspect specials, low-level, and composite scopes.
Expose new metadata builders in rbac and codersdk, update swagger docs,
and adjust the API test to cover the richer catalog payload.
@ThomasK33 ThomasK33 force-pushed the thomask33/10-09-add_scope_catalog_api branch from 8108da0 to 680f589 Compare October 24, 2025 16:45
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 0126ab0 to 2d12da3 Compare October 24, 2025 16:45
@ThomasK33 ThomasK33 closed this Oct 24, 2025
@ThomasK33 ThomasK33 deleted the thomask33/10-09-add_scope_catalog_api branch October 24, 2025 16:49
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 24, 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.

1 participant