-
Notifications
You must be signed in to change notification settings - Fork 0
/
psql.sql
76 lines (63 loc) · 1.66 KB
/
psql.sql
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
CREATE SCHEMA api;
CREATE TABLE api.book1x (
sl serial primary key,
id uuid not null,
name text not null,
phone text not null,
email text
);
CREATE TABLE api.book2x (
sl serial primary key,
id uuid not null,
name text not null,
phone text not null,
email text
);
CREATE TABLE api.book3x (
sl serial primary key,
id uuid not null,
name text not null,
phone text not null,
email text
);
CREATE TABLE api.book4x (
sl serial primary key,
id uuid not null,
name text not null,
phone text not null,
email text
);
CREATE TABLE api.book5x (
sl serial primary key,
id uuid not null,
name text not null,
phone text not null,
email text
);
CREATE TABLE api.book6x (
sl serial primary key,
id uuid not null,
name text not null,
phone text not null,
email text
);
create role web_anon nologin;
grant usage on schema api to web_anon;
grant ALL on api.book1x to web_anon;
grant ALL on api.book2x to web_anon;
grant ALL on api.book3x to web_anon;
grant ALL on api.book4x to web_anon;
grant ALL on api.book5x to web_anon;
grant ALL on api.book6x to web_anon;
create role authenticator noinherit login password 'fu11motion';
grant web_anon to authenticator;
curl http://localhost:3000/book1x -X POST \
-H "Content-Type: application/json" \
-d '{
"name": "risto bu",
"phone": "8913544312",
"email": "[email protected]"
"id": "f42345434-1f20-4646-b707-f2ff40f1d141"
}'
curl -X POST http://localhost:3000/book1x?'id=uuid_generate_v4()'&name=ristobu&phone=9496873452
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoid2ViX2Fub24ifQ.uGm4VKf7JEgCYn6xHTjhtNp8GcD_ZbOHJmSQkHQe04M