Repository navigation
feat: add allow list to API keys #19972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- Drop all CHECK constraints added in the up migration | ||
| ALTER TABLE api_keys | ||
| DROP CONSTRAINT api_keys_allow_list_not_empty; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| -- Defensively update any API keys with empty allow_list to have default '*:*' | ||
| -- This ensures all existing keys have at least one entry before adding the constraint | ||
| UPDATE api_keys | ||
| SET allow_list = ARRAY['*:*'] | ||
| WHERE allow_list = ARRAY[]::text[] OR array_length(allow_list, 1) IS NULL; | ||
|
|
||
| -- Add CHECK constraint to ensure allow_list array is never empty | ||
| ALTER TABLE api_keys | ||
| ADD CONSTRAINT api_keys_allow_list_not_empty | ||
| CHECK (array_length(allow_list, 1) > 0); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.