-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgateway.http
69 lines (58 loc) · 2.07 KB
/
gateway.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
### gRPC - Create User
# curl -X POST -H "Content-Type: application/json" -d '{"username":"test", "password": "ThisIsMyPassword"}' http://localhost:3000/api/users
POST http://localhost:8000/api/v1/create_user
Content-Type: application/json
{
"username":"test2",
"password": "ThisIsMyPassword",
"email": "[email protected]",
"full_name": "Test2User"
}
##########################################################################################
### gRPC - Login
POST http://localhost:8000/api/v1/login_user
Content-Type: application/json
{
"username":"test2",
"password": "ThisIsMyPassword"
}
> {%
client.global.set("access_token", response.body.access_token);
client.global.set("refresh_token", response.body.refresh_token);
%}
##########################################################################################
### gRPC - Refresh the token
POST http://localhost:8000/api/tokens/refresh
Content-Type: application/json
{
"refresh_token": "{{ refresh_token }}"
}
> {%
client.global.set("access_token", response.body.access_token);
%}
##########################################################################################
### gRPC - Update User
PATCH http://localhost:8000/api/v1/update_user
Content-Type: application/json
Authorization: Bearer {{ access_token }}
{
"username":"test2",
"full_name": "Test Tester2",
"email": "[email protected]",
"password": "yolo123456"
}
##########################################################################################
### gRPC - Get All Domains
# curl -X POST -H "Content-Type: application/json" -d '{"name":"example.com"}' http://localhost:3000/domains
GET http://localhost:8000/api/domains
Content-Type: application/json
Authorization: Bearer {{ access_token }}
##########################################################################################
### gRPC - Add new Domain
# curl -X POST -H "Content-Type: application/json" -d '{"name":"example.com"}' http://localhost:3000/domains
POST http://localhost:8000/api/domains
Content-Type: application/json
Authorization: Bearer {{ access_token }}
{
"name":"example.com"
}