From 4e9e50cf031e8f0a08d7c46af8763596c346b808 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Wed, 20 Mar 2024 12:51:44 +0700 Subject: [PATCH] chore: update migration tests --- ...19072844_lock_down_postgres_access_to_auth_migrations.sql} | 4 ---- migrations/tests/database/privs.sql | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) rename migrations/db/migrations/{20240319072844_lock_down_postgres_access_to_auth_and_storage.sql => 20240319072844_lock_down_postgres_access_to_auth_migrations.sql} (55%) diff --git a/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_and_storage.sql b/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_migrations.sql similarity index 55% rename from migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_and_storage.sql rename to migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_migrations.sql index a6470f7eb..7f8f30d73 100644 --- a/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_and_storage.sql +++ b/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_migrations.sql @@ -3,8 +3,4 @@ revoke supabase_auth_admin from postgres; revoke all on table auth.schema_migrations from postgres; grant select on table auth.schema_migrations to postgres; -revoke supabase_storage_admin from postgres; -revoke all on table storage.migrations from postgres; -grant select on table storage.migrations to postgres; - -- migrate:down diff --git a/migrations/tests/database/privs.sql b/migrations/tests/database/privs.sql index 217da662a..57f746b64 100644 --- a/migrations/tests/database/privs.sql +++ b/migrations/tests/database/privs.sql @@ -28,3 +28,7 @@ SELECT schema_privs_are('extensions', 'postgres', array['CREATE', 'USAGE']); SELECT schema_privs_are('extensions', 'anon', array['USAGE']); SELECT schema_privs_are('extensions', 'authenticated', array['USAGE']); SELECT schema_privs_are('extensions', 'service_role', array['USAGE']); + +-- Verify auth schema privileges +SELECT schema_privs_are('auth', 'postgres', array['CREATE', 'USAGE']); +SELECT table_privs_are('auth', 'schema_migrations', 'postgres', array['SELECT']);