Skip to content

Commit ae728fa

Browse files
authored
feat: add supabase_etl_admin user
1 parent 4433e21 commit ae728fa

File tree

8 files changed

+22
-10
lines changed

8 files changed

+22
-10
lines changed

ansible/files/postgresql_config/supautils.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-cust
1111
supautils.privileged_extensions_superuser = 'supabase_admin'
1212
supautils.privileged_role = 'postgres'
1313
supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, 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.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression'
14-
supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator'
15-
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'
14+
supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, supabase_etl_admin, dashboard_user, pgbouncer, authenticator'
15+
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, supabase_etl_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ postgres_major:
99

1010
# Full version strings for each major version
1111
postgres_release:
12-
postgresorioledb-17: "17.5.1.016-orioledb"
13-
postgres17: "17.4.1.073"
14-
postgres15: "15.8.1.130"
12+
postgresorioledb-17: "17.5.1.017-orioledb"
13+
postgres17: "17.4.1.074"
14+
postgres15: "15.8.1.131"
1515

1616
# Non Postgres Extensions
1717
pgbouncer_release: "1.19.0"

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ alter user supabase_admin with superuser createdb createrole replication bypass
1010
-- Supabase replication user
1111
create user supabase_replication_admin with login replication;
1212

13+
-- Supabase etl user
14+
create user supabase_etl_admin with login replication;
15+
grant pg_read_all_data to supabase_etl_admin;
16+
grant create on database postgres to supabase_etl_admin;
17+
1318
-- Supabase read-only user
1419
create role supabase_read_only_user with login bypassrls;
1520
grant pg_read_all_data to supabase_read_only_user;

nix/tests/expected/roles.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ order by rolname;
4646
service_role | f | f | f | t | f | f | -1 | t |
4747
supabase_admin | t | t | t | t | t | t | -1 | t |
4848
supabase_auth_admin | t | t | f | f | f | f | -1 | f |
49+
supabase_etl_admin | f | t | f | t | f | t | -1 | f |
4950
supabase_functions_admin | t | t | f | f | f | f | -1 | f |
5051
supabase_read_only_user | f | t | f | t | f | f | -1 | t |
5152
supabase_replication_admin | f | t | f | t | f | t | -1 | f |
5253
supabase_storage_admin | t | t | f | f | f | f | -1 | f |
53-
(29 rows)
54+
(30 rows)
5455

5556
select
5657
rolname,
@@ -85,11 +86,12 @@ order by rolname;
8586
service_role |
8687
supabase_admin | {"search_path=\"$user\", public, auth, extensions",log_statement=none}
8788
supabase_auth_admin | {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none}
89+
supabase_etl_admin |
8890
supabase_functions_admin |
8991
supabase_read_only_user | {default_transaction_read_only=on}
9092
supabase_replication_admin |
9193
supabase_storage_admin | {search_path=storage,log_statement=none}
92-
(29 rows)
94+
(30 rows)
9395

9496
-- Check all privileges of the roles on the schemas
9597
select schema_name, privilege_type, grantee, default_for

nix/tests/expected/z_15_roles.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ order by
2929
postgres | pg_signal_backend | f
3030
postgres | pgtle_admin | f
3131
postgres | service_role | f
32+
supabase_etl_admin | pg_read_all_data | f
3233
supabase_read_only_user | pg_read_all_data | f
3334
supabase_storage_admin | authenticator | f
34-
(18 rows)
35+
(19 rows)
3536

nix/tests/expected/z_17_roles.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ order by
6666
postgres | pg_signal_backend | t
6767
postgres | pgtle_admin | f
6868
postgres | service_role | t
69+
supabase_etl_admin | pg_read_all_data | f
6970
supabase_read_only_user | pg_read_all_data | f
7071
supabase_storage_admin | authenticator | f
71-
(20 rows)
72+
(21 rows)
7273

7374
-- Check version-specific privileges of the roles on the schemas
7475
select schema_name, privilege_type, grantee, default_for
@@ -157,7 +158,8 @@ order by
157158
postgres | pg_signal_backend | t
158159
postgres | pgtle_admin | f
159160
postgres | service_role | t
161+
supabase_etl_admin | pg_read_all_data | f
160162
supabase_read_only_user | pg_read_all_data | f
161163
supabase_storage_admin | authenticator | f
162-
(19 rows)
164+
(20 rows)
163165

nix/tools/postgresql_schema.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ ALTER USER pgbouncer WITH PASSWORD 'postgres';
77
ALTER USER supabase_auth_admin WITH PASSWORD 'postgres';
88
ALTER USER supabase_storage_admin WITH PASSWORD 'postgres';
99
ALTER USER supabase_replication_admin WITH PASSWORD 'postgres';
10+
ALTER USER supabase_etl_admin WITH PASSWORD 'postgres';
1011
ALTER ROLE supabase_read_only_user WITH PASSWORD 'postgres';
1112
ALTER ROLE supabase_admin SET search_path TO "$user",public,auth,extensions;

testinfra/test_ami_nix.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
ALTER USER supabase_auth_admin WITH PASSWORD 'postgres';
3333
ALTER USER supabase_storage_admin WITH PASSWORD 'postgres';
3434
ALTER USER supabase_replication_admin WITH PASSWORD 'postgres';
35+
ALTER USER supabase_etl_admin WITH PASSWORD 'postgres';
3536
ALTER ROLE supabase_read_only_user WITH PASSWORD 'postgres';
3637
ALTER ROLE supabase_admin SET search_path TO "$user",public,auth,extensions;
3738
"""

0 commit comments

Comments
 (0)