mirror of
https://github.com/coder/coder.git
synced 2026-06-03 21:18:24 +00:00
79126ab6c7
# Add Composite API Key Scopes This PR adds high-level composite API key scopes to simplify token creation with common permission sets: - `coder:workspaces.create` - Create and update workspaces - `coder:workspaces.operate` - Read and update workspaces - `coder:workspaces.delete` - Read and delete workspaces - `coder:workspaces.access` - Read, SSH, and connect to workspace applications - `coder:templates.build` - Read templates and create/read files - `coder:templates.author` - Full template management with insights - `coder:apikeys.manage_self` - Manage your own API keys These composite scopes are persisted in the database and expanded during authorization, providing a more intuitive way to grant permissions compared to the granular resource:action scopes.
10 lines
662 B
SQL
10 lines
662 B
SQL
-- Add high-level composite coder:* API key scopes
|
|
-- These values are persisted so that tokens can store coder:* names directly.
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:workspaces.create';
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:workspaces.operate';
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:workspaces.delete';
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:workspaces.access';
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:templates.build';
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:templates.author';
|
|
ALTER TYPE api_key_scope ADD VALUE IF NOT EXISTS 'coder:apikeys.manage_self';
|