@pgpmjs/core 3.0.9 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,55 +0,0 @@
1
- BEGIN;
2
- DO $do$
3
- BEGIN
4
- -- anonymous
5
- BEGIN
6
- EXECUTE format('CREATE ROLE %I', 'anonymous');
7
- EXCEPTION
8
- WHEN duplicate_object THEN
9
- -- Role already exists; optionally sync attributes here with ALTER ROLE
10
- NULL;
11
- END;
12
-
13
- -- authenticated
14
- BEGIN
15
- EXECUTE format('CREATE ROLE %I', 'authenticated');
16
- EXCEPTION
17
- WHEN duplicate_object THEN
18
- -- Role already exists; optionally sync attributes here with ALTER ROLE
19
- NULL;
20
- END;
21
-
22
- -- administrator
23
- BEGIN
24
- EXECUTE format('CREATE ROLE %I', 'administrator');
25
- EXCEPTION
26
- WHEN duplicate_object THEN
27
- -- Role already exists; optionally sync attributes here with ALTER ROLE
28
- NULL;
29
- END;
30
- END
31
- $do$;
32
-
33
- -- Set role attributes (safe to run even if role already exists)
34
- ALTER USER anonymous WITH NOCREATEDB;
35
- ALTER USER anonymous WITH NOSUPERUSER;
36
- ALTER USER anonymous WITH NOCREATEROLE;
37
- ALTER USER anonymous WITH NOLOGIN;
38
- ALTER USER anonymous WITH NOREPLICATION;
39
- ALTER USER anonymous WITH NOBYPASSRLS;
40
-
41
- ALTER USER authenticated WITH NOCREATEDB;
42
- ALTER USER authenticated WITH NOSUPERUSER;
43
- ALTER USER authenticated WITH NOCREATEROLE;
44
- ALTER USER authenticated WITH NOLOGIN;
45
- ALTER USER authenticated WITH NOREPLICATION;
46
- ALTER USER authenticated WITH NOBYPASSRLS;
47
-
48
- ALTER USER administrator WITH NOCREATEDB;
49
- ALTER USER administrator WITH NOSUPERUSER;
50
- ALTER USER administrator WITH NOCREATEROLE;
51
- ALTER USER administrator WITH NOLOGIN;
52
- ALTER USER administrator WITH NOREPLICATION;
53
- -- they CAN bypass RLS
54
- ALTER USER administrator WITH BYPASSRLS;
55
- COMMIT;
@@ -1,72 +0,0 @@
1
- BEGIN;
2
- DO $do$
3
- BEGIN
4
- BEGIN
5
- EXECUTE format('CREATE ROLE %I LOGIN PASSWORD %L', 'app_user', 'app_password');
6
- EXCEPTION
7
- WHEN duplicate_object THEN
8
- -- Role already exists; optionally sync attributes here with ALTER ROLE
9
- NULL;
10
- END;
11
-
12
- BEGIN
13
- EXECUTE format('CREATE ROLE %I LOGIN PASSWORD %L', 'app_admin', 'admin_password');
14
- EXCEPTION
15
- WHEN duplicate_object THEN
16
- -- Role already exists; optionally sync attributes here with ALTER ROLE
17
- NULL;
18
- END;
19
- END
20
- $do$;
21
-
22
- DO $do$
23
- BEGIN
24
- BEGIN
25
- EXECUTE format('GRANT %I TO %I', 'anonymous', 'app_user');
26
- EXCEPTION
27
- WHEN unique_violation THEN
28
- -- Membership was granted concurrently; ignore.
29
- NULL;
30
- WHEN undefined_object THEN
31
- -- One of the roles doesn't exist yet; order operations as needed.
32
- RAISE NOTICE 'Missing role when granting % to %', 'anonymous', 'app_user';
33
- END;
34
-
35
- BEGIN
36
- EXECUTE format('GRANT %I TO %I', 'authenticated', 'app_user');
37
- EXCEPTION
38
- WHEN unique_violation THEN
39
- NULL;
40
- WHEN undefined_object THEN
41
- RAISE NOTICE 'Missing role when granting % to %', 'authenticated', 'app_user';
42
- END;
43
-
44
- BEGIN
45
- EXECUTE format('GRANT %I TO %I', 'anonymous', 'administrator');
46
- EXCEPTION
47
- WHEN unique_violation THEN
48
- NULL;
49
- WHEN undefined_object THEN
50
- RAISE NOTICE 'Missing role when granting % to %', 'anonymous', 'administrator';
51
- END;
52
-
53
- BEGIN
54
- EXECUTE format('GRANT %I TO %I', 'authenticated', 'administrator');
55
- EXCEPTION
56
- WHEN unique_violation THEN
57
- NULL;
58
- WHEN undefined_object THEN
59
- RAISE NOTICE 'Missing role when granting % to %', 'authenticated', 'administrator';
60
- END;
61
-
62
- BEGIN
63
- EXECUTE format('GRANT %I TO %I', 'administrator', 'app_admin');
64
- EXCEPTION
65
- WHEN unique_violation THEN
66
- NULL;
67
- WHEN undefined_object THEN
68
- RAISE NOTICE 'Missing role when granting % to %', 'administrator', 'app_admin';
69
- END;
70
- END
71
- $do$;
72
- COMMIT;