You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Derive low-level API key scope names directly from policy.RBACPermissions (coderd/rbac/policy/policy.go). For each resource’s allowed actions, expose <resource>:<action> scope names (e.g., template:use, workspace:start, workspace:ssh, api_key:create).
Introduce a collection of public low-level scope names that are exposed via an API endpoint for discovery and request by users/clients.
Support internal-only low-level scopes that are not exposed via the public catalog and cannot be requested by users, but may be attached by the system where needed.
Key files/areas
coderd/rbac/policy/policy.go (source of truth: RBACPermissions and policy.Action*).
coderd/rbac/scopes.go (expansion logic and mapping from scope string → RBAC permissions).
API surface to list public scope names (e.g., handler under coderd/ and OpenAPI docs) and validation in token creation to allow only public names.
Acceptance criteria
Table-driven tests validate that for every <resource>:<action> pair in RBACPermissions, if marked public, the corresponding scope exists and expands to the expected rbac.Scope.Site permissions.
No org-level permissions present in these expansions.
Public listing endpoint returns only public low-level scopes; internal-only scopes are not listed and cannot be requested (token creation with internal-only scope is rejected).
Activity
feat: add external API key scopes (#19916)