-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into erik/assert-upload-index
- Loading branch information
Showing
37 changed files
with
504 additions
and
103 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
compute_tools/src/migrations/tests/0001-neon_superuser_bypass_rls.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DO $$ | ||
DECLARE | ||
bypassrls boolean; | ||
BEGIN | ||
SELECT rolbypassrls INTO bypassrls FROM pg_roles WHERE rolname = 'neon_superuser'; | ||
IF NOT bypassrls THEN | ||
RAISE EXCEPTION 'neon_superuser cannot bypass RLS'; | ||
END IF; | ||
END $$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
DO $$ | ||
DECLARE | ||
role record; | ||
BEGIN | ||
FOR role IN | ||
SELECT rolname AS name, rolinherit AS inherit | ||
FROM pg_roles | ||
WHERE pg_has_role(rolname, 'neon_superuser', 'member') | ||
LOOP | ||
IF NOT role.inherit THEN | ||
RAISE EXCEPTION '% cannot inherit', quote_ident(role.name); | ||
END IF; | ||
END LOOP; | ||
|
||
FOR role IN | ||
SELECT rolname AS name, rolbypassrls AS bypassrls | ||
FROM pg_roles | ||
WHERE NOT pg_has_role(rolname, 'neon_superuser', 'member') | ||
AND NOT starts_with(rolname, 'pg_') | ||
LOOP | ||
IF role.bypassrls THEN | ||
RAISE EXCEPTION '% can bypass RLS', quote_ident(role.name); | ||
END IF; | ||
END LOOP; | ||
END $$; |
10 changes: 10 additions & 0 deletions
10
compute_tools/src/migrations/tests/0003-grant_pg_create_subscription_to_neon_superuser.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DO $$ | ||
BEGIN | ||
IF (SELECT current_setting('server_version_num')::numeric < 160000) THEN | ||
RETURN; | ||
END IF; | ||
|
||
IF NOT (SELECT pg_has_role('neon_superuser', 'pg_create_subscription', 'member')) THEN | ||
RAISE EXCEPTION 'neon_superuser cannot execute pg_create_subscription'; | ||
END IF; | ||
END $$; |
Oops, something went wrong.