forked from erikbos/gatekeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExample requests role.http
82 lines (72 loc) · 1.61 KB
/
Example requests role.http
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
# Example REST calls for role
### Get all roles
GET http://{{hostname}}/v1/roles
Authorization: Basic admin passwd
### Create a new role named "admin"
POST http://{{hostname}}/v1/roles HTTP/1.1
content-type: application/json
Authorization: Basic admin passwd
{
"name": "administrator",
"allows": [
{
"methods": [
"GET",
"POST",
],
"paths": [
"/**"
]
}
]
}
### Update an existing role called "admin"
POST http://{{hostname}}/v1/roles/administrator HTTP/1.1
content-type: application/json
Authorization: Basic admin passwd
{
"name": "administrator",
"displayName": "Administrator role",
"allows": [
{
"methods": [
"GET",
"POST",
"DELETE"
],
"paths": [
"/v1/**"
]
},
{
"methods": [
"GET"
],
"paths": [
"/v1/cluster/*"
]
}
]
}
### Create a new role named "clusteradmin"
POST http://{{hostname}}/v1/roles/clusteradmin HTTP/1.1
content-type: application/json
Authorization: Basic admin passwd
{
"name": "clusteradmin",
"allows": [
{
"methods": [
"get",
"post"
],
"paths": [
"/v1/clusters",
"/v1/clusters/*"
]
}
]
}
### Delete role "clusteradmin"
DELETE http://{{hostname}}/v1/roles/clusteradmin
Authorization: Basic admin passwd