-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathauth.out
117 lines (112 loc) · 3.79 KB
/
auth.out
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
-- auth schema owner
select
n.nspname as schema_name,
r.rolname as owner
from
pg_namespace n
join
pg_roles r on n.nspowner = r.oid
where
n.nspname = 'auth';
schema_name | owner
-------------+----------------
auth | supabase_admin
(1 row)
-- auth schema tables with owners and rls policies
select
ns.nspname as schema_name,
c.relname as table_name,
r.rolname as owner,
c.relrowsecurity as rls_enabled,
string_agg(p.polname, ', ' order by p.polname) as rls_policies
from
pg_class c
join
pg_namespace ns on c.relnamespace = ns.oid
join
pg_roles r on c.relowner = r.oid
left join
pg_policy p on p.polrelid = c.oid
where
ns.nspname = 'auth'
and c.relkind = 'r'
group by
ns.nspname, c.relname, r.rolname, c.relrowsecurity
order by
c.relname;
schema_name | table_name | owner | rls_enabled | rls_policies
-------------+-------------------+---------------------+-------------+--------------
auth | audit_log_entries | supabase_auth_admin | f |
auth | instances | supabase_auth_admin | f |
auth | refresh_tokens | supabase_auth_admin | f |
auth | schema_migrations | supabase_auth_admin | f |
auth | users | supabase_auth_admin | f |
(5 rows)
-- auth indexes with owners
select
ns.nspname as table_schema,
t.relname as table_name,
i.relname as index_name,
r.rolname as index_owner
from
pg_class t
join
pg_namespace ns on t.relnamespace = ns.oid
join
pg_index idx on t.oid = idx.indrelid
join
pg_class i on idx.indexrelid = i.oid
join
pg_roles r on i.relowner = r.oid
where
ns.nspname = 'auth'
order by
t.relname, i.relname;
table_schema | table_name | index_name | index_owner
--------------+-------------------+----------------------------------------+---------------------
auth | audit_log_entries | audit_log_entries_pkey | supabase_auth_admin
auth | audit_log_entries | audit_logs_instance_id_idx | supabase_auth_admin
auth | instances | instances_pkey | supabase_auth_admin
auth | refresh_tokens | refresh_tokens_instance_id_idx | supabase_auth_admin
auth | refresh_tokens | refresh_tokens_instance_id_user_id_idx | supabase_auth_admin
auth | refresh_tokens | refresh_tokens_pkey | supabase_auth_admin
auth | refresh_tokens | refresh_tokens_token_idx | supabase_auth_admin
auth | schema_migrations | schema_migrations_pkey | supabase_auth_admin
auth | users | users_email_key | supabase_auth_admin
auth | users | users_instance_id_email_idx | supabase_auth_admin
auth | users | users_instance_id_idx | supabase_auth_admin
auth | users | users_pkey | supabase_auth_admin
(12 rows)
-- auth schema functions with owners
select
n.nspname as schema_name,
p.proname as function_name,
r.rolname as owner
from
pg_proc p
join
pg_namespace n on p.pronamespace = n.oid
join
pg_roles r on p.proowner = r.oid
where
n.nspname = 'auth'
order by
p.proname;
schema_name | function_name | owner
-------------+---------------+---------------------
auth | email | supabase_auth_admin
auth | role | supabase_auth_admin
auth | uid | supabase_auth_admin
(3 rows)
-- auth service schema migrations
select * from auth.schema_migrations;
version
----------------
20171026211738
20171026211808
20171026211834
20180103212743
20180108183307
20180119214651
20180125194653
(7 rows)