-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yaml
87 lines (84 loc) · 2.44 KB
/
example.yaml
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
User:
enums:
- name: user_role
options: webuser,admin,shadow-banned
domains:
- name: email
type: varchar(256)
check: length(value) > 6 AND value ~* '(?:[a-z0-9!#$%&''*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])'
columns:
- name: id
type: bigserial
primary_key: true
- name: email
type: email
nullable: false
modifiers: unique
- name: password
type: varchar(72)
nullable: false
check: length("password") > 12
- name: has_verified_email
type: boolean
nullable: false
default: false
- name: role
type: user_role
nullable: false
default: settings.get('auth.default-role')::user_role
rls:
read: self
alter: self
rabbitmq:
include: id,email
include:
created_at: true
updated_at: true
api:
exclude: password
UISetup:
columns:
- name: name
type: varchar(64)
primary_key: true
- name: details
type: jsonb
nullable: false
rls:
read: all
alter: none
Profile:
enums:
- name: gender
options: man,woman,cis man,cis woman,agender,androgynous,bigender,genderfluid,genderqueer,gender nonconforming,hijra,intersex,non binary,pangender,transfeminine,transgender,transmasculine,transsexual,trans man,trans woman,two spirits,other"
- name: diet
options: omnivore,vegetarian,pescatarian,vegan,carnivore,halal,kosher,paleo,keto,gluten free,pizza
columns:
- name: id
type: bigserial
primary_key: true
- name: name
type: varchar(128)
nullable: false
check: length(name)>2
- name: dob
type: date
nullable: false
check: dob BETWEEN '1905-01-01'::date AND CURRENT_DATE - interval '18 year'
- name: gender
type: gender
nullable: false
foreign_keys:
- name: owner_id # this is important for rlse
type: bigint
nullable: false
references:
table: user
column: id
rls:
read: all
alter: self
rabbitmq:
include: id,name
api:
exclude: owner_id # don't expose the owner_id in the api calls