-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhttp-client.http
More file actions
77 lines (62 loc) · 1.36 KB
/
http-client.http
File metadata and controls
77 lines (62 loc) · 1.36 KB
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
// README:
@api-url = https://localhost:8000/api
### Get all user roles
# @no-log
GET {{api-url}}/userroles
Host: {{host-url}}
Authorization: {{auth}}
### Get all user roles of specified role name and/or organization id
# @no-log
< {%
const searchRequest = {
roleName: "SUPER_ADMIN",
orgId: null,
}
const params = new URLSearchParams()
Object.entries(searchRequest).forEach(([key, value]) => {
if (value != null) {
params.append(key, value)
}
})
request.variables.set("query", params.toString())
%}
GET {{api-url}}/userroles?{{query}}
Host: {{host-url}}
Authorization: {{auth}}
### Get user roles for a specified user
# @no-log
< {%
request.variables.set("username", "gst")
%}
GET {{api-url}}/userroles/{{username}}
Host: {{host-url}}
Authorization: {{auth}}
### Set user roles for a specified user
# @no-log
< {%
request.variables.set("username", "gst")
%}
PUT {{api-url}}/userroles/{{username}}
Host: {{host-url}}
Authorization: {{auth}}
Content-Type: application/json
{
"roles": [
{
"applicationName": "ADMIN",
"roleName": "ORG_ADMIN"
},
{
"applicationName": "LOGISTICS",
"roleName": "ORG_ADMIN"
}
]
}
### Delete user roles for a specified user
# @no-log
< {%
request.variables.set("username", "gst")
%}
DELETE {{api-url}}/userroles/{{username}}
Host: {{host-url}}
Authorization: {{auth}}