-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.toml
50 lines (43 loc) · 1.51 KB
/
config.toml
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
['dev.cloud.shuosc.com']
superuser = "17120238"
[['dev.cloud.shuosc.com'.urls]]
prefix = "/api/semester"
read = { everybody = true } # 对每个人:可读
write = { superuser = true } # 对管理员:可写
[['dev.cloud.shuosc.com'.urls]]
prefix = "/api/course"
read = { authed = true } # 对所有合法登录用户可读
write = { superuser = true }
[['dev.cloud.shuosc.com'.urls]]
prefix = "/api/student"
['dev.cloud.shuosc.com'.urls.write.authed]
url_segment = 2 # 将 url 的第2段(从0开始计数)和 header 中的 jwt token 中的 id 比较,相等则允许访问
['dev.cloud.shuosc.com'.urls.read.authed]
url_segment = 2
[['dev.cloud.shuosc.com'.urls]]
prefix = "/api/course-selection"
write = { superuser = true }
['dev.cloud.shuosc.com'.urls.read]
superuser = true
['dev.cloud.shuosc.com'.urls.read.authed]
query = "student_id"
[['dev.cloud.shuosc.com'.urls]]
prefix = "/api/todo"
['dev.cloud.shuosc.com'.urls.write]
superuser = true
authed = { query = "student_id" } # 将 query 中的 student_id 和 header 中的 jwt token 中的 id 比较,相等则允许访问
['dev.cloud.shuosc.com'.urls.read]
superuser = true
['dev.cloud.shuosc.com'.urls.read.authed]
query = "student_id"
['cloud.shuosc.com']
superuser = "17120238"
[['cloud.shuosc.com'.urls]]
prefix = "/api/semester"
read = { everybody = true }
write = { everybody = true }
[['dev.cloud.shuosc.com'.urls]]
prefix = "/api/xxx"
redirect_location = "/ping"
read = { everybody = true } # 对每个人:可读
write = { superuser = true } # 对管理员:可写