1
0
Fork 0
fahrPool/supabase/migrations
Jonny d03052ca73 test: cover profiles UPDATE RLS boundary and privilege-escalation trigger
Final review found the RLS test suite only covered SELECT, never the
actual security-relevant path: a non-admin changing a profile's role.
Add pgTAP coverage for a fahrer's own-role UPDATE being blocked by RLS
(0 rows affected, role unchanged), the positive admin-can-update-others
case, and a regression test for handle_new_user() ignoring
raw_user_meta_data.role so a future edit reintroducing that read fails
loudly instead of quietly reopening the escalation hole.

Also add a migration giving the admin UPDATE policy an explicit
WITH CHECK (behavior unchanged, since Postgres already falls back to
USING for UPDATE policies without one) to document the pattern for
future sub-projects copying this RLS setup.
2026-07-05 00:45:27 +02:00
..
20260704092843_profiles.sql fix: never derive new user role from raw_user_meta_data (privilege escalation) 2026-07-04 11:48:26 +02:00
20260704095119_rls_profiles.sql feat: add RLS policies and pgTAP tests for profiles 2026-07-04 11:58:09 +02:00
20260704224211_add_profiles_update_with_check.sql test: cover profiles UPDATE RLS boundary and privilege-escalation trigger 2026-07-05 00:45:27 +02:00