feat(store): add token lifetime limit and tokens.manage permission
The built-in Admin role gains tokens.manage. Refs #48 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
d7d4821e3e
commit
da128c5081
8 files changed
+69
-19
No files matched your search
@@ -0,0 +1,9 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE orgs ADD COLUMN api_token_max_days integer CHECK (api_token_max_days BETWEEN 1 AND 3650);
|
||||
|
||||
UPDATE roles SET permissions = array_append(permissions, 'tokens.manage')
|
||||
WHERE key = 'admin' AND NOT 'tokens.manage' = ANY (permissions);
|
||||
|
||||
-- +goose Down
|
||||
UPDATE roles SET permissions = array_remove(permissions, 'tokens.manage') WHERE key = 'admin';
|
||||
ALTER TABLE orgs DROP COLUMN api_token_max_days;
|
||||
Reference in new issue
Block a user