完善 API Key 能力范围可视化和维护

This commit is contained in:
2026-06-07 19:01:32 +08:00
parent dc14866210
commit f47132a653
19 changed files with 1165 additions and 49 deletions
@@ -0,0 +1,11 @@
UPDATE gateway_api_keys
SET scopes = '["chat","embedding","rerank","image","video","music","audio"]'::jsonb,
updated_at = now()
WHERE deleted_at IS NULL
AND (
(scopes @> '["chat","image","video"]'::jsonb
AND scopes <@ '["chat","image","video"]'::jsonb)
OR
(scopes @> '["chat","embedding","rerank","image","video"]'::jsonb
AND scopes <@ '["chat","embedding","rerank","image","video"]'::jsonb)
);