feat: update pgdelta to handle user-defined policies and comments - #2142
Open
leandrocp wants to merge 1 commit into
Open
feat: update pgdelta to handle user-defined policies and comments#2142leandrocp wants to merge 1 commit into
leandrocp wants to merge 1 commit into
Conversation
leandrocp
force-pushed
the
feat/pgdelta-rls
branch
from
August 28, 2026 19:00
e70d0fb to
e87b24d
Compare
leandrocp
force-pushed
the
feat/pgdelta-rls
branch
from
August 28, 2026 19:11
e87b24d to
99dcb6c
Compare
Contributor
CRAP Score Report |
8 tasks
avallete
pushed a commit
to supabase/pg-toolbelt
that referenced
this pull request
Aug 29, 2026
Auth-team decision (2026-08-29): the Auth service never ships or manages RLS policies on its own tables — every policy there is user-managed, and the post-2024 RLS/grant list drift is deliberate. That guarantee is schema-scoped, so the carve-out is too: any policy whose table is in the auth schema is user intent, included in diffs and exports via a new SUPABASE_USER_POLICY_SCHEMAS constant folded into the user-policy include rule (and its comment-satellite companion), instead of mirroring the 16 auth entries of supautils.policy_grants. Schema-wide beats the table list because it round-trips the legal-but-inert case (auth.oauth_clients: grantable, RLS never enabled) and is immune to future grant-list drift (auth.passkeys has no grant today). The per-table SURFACES list stays for storage/realtime until those teams give the same forward-looking guarantee. The pristine guard and the base-init fixture pin the observable half: zero policies on auth in the base image, RLS enabled on exactly the 16 tables of auth's 20240612123726_enable_rls_update_grants migration. Also corrects the PR #407 round-4 triage note in the follow-ups doc (its "CREATE POLICY requires ownership" premise is refuted by supautils.policy_grants) and records the customer-SELECT-re-grants-on-auth follow-up (ACLs carry a grantor, so a provenance discriminator exists; separate PR). RED (previous commit) on the surfaces-only branch state: unit: (fail) keeps ANY policy on an auth table managed (schema-wide rule) (Expected: false, Received: true) (fail) keeps comments ON allowlist policies managed (REAL-997) (Received: undefined) integ: (fail) diff/apply/converge an auth.users policy (schema-wide carve-out) (fail) export files the auth.users policy under the table without recreating it GREEN: unit 1381 pass / 0 fail; supabase-managed-policies 10/10 and base-init pins 4/4 on supabase/postgres:17.6.1.135. Refs CLI-1385 (Phase 5). Ref supabase/realtime#2142. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P4iJTUreVfKQhfAtuLfJNg
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref supabase/pg-toolbelt#433
Closes REAL-997