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
Migrate API keys from a single scope column to scopes api_key_scope[] and add allow_list text[] supporting entries like workspace:<uuid>, template:*, or *:*.
Default/backfill existing rows to scopes=['all'] and allow_list=['*:*'] to maintain backward compatibility.
Extend the existing api_key_scope enum with the new low-level scope names introduced in this RFC (e.g., workspace:read, template:read, api_key:create, etc.).
Key files/areas
SQL migrations in coderd/database/migrations/ (both up/down).
Generated models in coderd/database/models.go (via make gen).
Reference low-level scope names from coderd/rbac/policy/policy.go (RBACPermissions) when updating api_key_scope enum values.
Acceptance criteria
Running make gen succeeds; compiled models expose []APIKeyScope (or []string) and []string allow_list.
Existing installations upgrade without breaking token usage; no data loss.
Add a down migration returning to the old schema.
Enum updated with new low-level scope values when enum array is selected; down migration accounts for removed enum variants if needed.
api_key_scope enum includes all known <resource>:<action> from policy.RBACPermissions (public and internal). The public catalog exposed to users is a filtered subset defined in the low‑level catalog task; document how to update the enum when RBAC evolves.
Activity
feat: implement API key scopes database migration (#19861)