Skip to content

feat: add default_privileges_expose_new_tables lint (0033) - #216

Open
mateuszingano wants to merge 1 commit into
supabase:mainfrom
mateuszingano:feat/default-privileges-lint
Open

mateuszingano wants to merge 1 commit into
supabase:mainfrom
mateuszingano:feat/default-privileges-lint

Conversation

@mateuszingano

@mateuszingano mateuszingano commented Nov 17, 2026 •

Copy link
Copy Markdown

after oct 30 new tables need an explicit grant, and the quick fix a lot of people reach for when they hit the first 42501 is just putting the old default back:

alter default privileges in schema public
  grant select, insert, update, delete on tables to anon, authenticated;

that makes the error go away, but every table created after that is exposed again on creation, rls or not. no current lint catches it because nothing is exposed yet at the moment the default is added.

this one flags table defaults in pg_default_acl that grant to anon, authenticated or PUBLIC, in a schema from pgrst.db_schemas (or with no in schema). it skips defaults owned by supabase_/pg_ roles since the project owner can't change those, and service_role-only defaults.

a couple of notes:

@mateuszingano
mateuszingano requested a review from a team as a code owner November 17, 2026 18:44
@Vishv07

Vishv07 commented Nov 22, 2026

Copy link
Copy Markdown

Nice lint. Heads up that #200 also claims 0033, opened 10-12, so one of the two will need renumbering. There is some context on #198 where this came up for an earlier batch.

Worth checking before you redo the expected output, since the number appears in the lint filename, docs, splinter.sql, mkdocs.yaml, bin/installcheck and test/expected/.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants