mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
d0db9ec88f
# Canonicalize API Key Scopes This PR introduces canonical API key scopes with a `coder:` namespace prefix to avoid collisions with low-level resource:action names. It: 1. Renames special API key scopes in the database: - `all` → `coder:all` - `application_connect` → `coder:application_connect` 2. Adds support for a new `scopes` field in the API key creation request, allowing multiple scopes to be specified while maintaining backward compatibility with the singular `scope` field. 3. Updates the API documentation to reflect these changes, including the new endpoint for listing public API key scopes. 4. Ensures backward compatibility by mapping between legacy and canonical scope names in relevant code paths.
6 lines
309 B
SQL
6 lines
309 B
SQL
-- Revert canonicalization of special API key scopes
|
|
-- Rename enum values back: 'coder:all' -> 'all', 'coder:application_connect' -> 'application_connect'
|
|
|
|
ALTER TYPE api_key_scope RENAME VALUE 'coder:all' TO 'all';
|
|
ALTER TYPE api_key_scope RENAME VALUE 'coder:application_connect' TO 'application_connect';
|