chore(db): commit production RLS policies as a baseline migration - #42
Merged
Merged
Conversation
Snapshot of all 44 policies on 17 RLS tables (public + storage), generated from pg_policies in production after the GHSA-xq84-qm9j-hf6p fixes. Explicitly drops the four policies removed during the incident so that replaying 20260602130000 cannot restore escrow_update_buyer. No behavior change: a no-op against production. .gitignore ignored all of supabase/ since the initial commit, so new migrations and edge functions were silently left out of git. Only local CLI state and .env files are ignored now. Co-authored-by: Copilot App <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Puts every row-level security policy production enforces into version control, and fixes why it wasn't there.
What
supabase/migrations/20260927220000_rls_policies_baseline.sql: 17enable row level security+ 44 policies (publicandstorageschemas), generated frompg_policies/pg_classin production on 2026-09-27 — not hand-written.drop policy if existsfor the four policies removed tonight. Needed because20260602130000_escrow_payment_flow.sqlstill createsescrow_update_buyer; replaying migrations would otherwise restore it..gitignore: it ignored all ofsupabase/since the initial commit, so every new migration or edge function was silently left out unless force-added. Now onlysupabase/.branches/,supabase/.temp/and.envfiles are ignored.Behavior
No change. Against production it drops and recreates each policy with its current definition. Run it in one transaction (the Supabase CLI does per migration).
Deliberately not fixed here (each gets its own migration): self-editable columns via
profiles/listingsUPDATE, publicboost_paymentsSELECT, anonymousdonationsinserts, duplicatefavorites/messagespolicies,booksbucket upload without a folder check.Test plan
git check-ignorestill ignoressupabase/.temp/andsupabase/**/.env.supabase/-only PR (confirms ci: run Flutter check on every PR so it can be required #41).