Skip to content

Commit e9e2d50

Browse files
committed
add supabase_read_only_user role
1 parent 2fe5cf5 commit e9e2d50

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

ansible/files/postgresql_config/supautils.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ supautils.privileged_extensions_superuser = 'supabase_admin'
99
supautils.privileged_role = 'postgres'
1010
supautils.privileged_role_allowed_configs = 'pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, session_replication_role, track_io_timing'
1111
supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, authenticator'
12-
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'
12+
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'

common.vars.pkr.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.0.54-rc0"
1+
postgres-version = "15.1.0.55"

migrations/db/init-scripts/00000000000000-initial-schema.sql

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ alter user supabase_admin with superuser createdb createrole replication bypass
1111
-- Supabase replication user
1212
create user supabase_replication_admin with login replication;
1313

14+
-- Supabase read-only user
15+
create role supabase_read_only_user with login bypassrls;
16+
grant pg_read_all_data to supabase_read_only_user;
17+
1418
-- Extension namespacing
1519
create schema if not exists extensions;
1620
create extension if not exists "uuid-ossp" with schema extensions;

0 commit comments

Comments
 (0)