-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo_auth_server.postman_collection.json
209 lines (209 loc) · 4.71 KB
/
go_auth_server.postman_collection.json
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
{
"info": {
"_postman_id": "4b90eac8-1713-4b3c-9a58-a47b400b2139",
"name": "go_auth_server",
"description": "# 🚀 GO Auth Server\n\n- **GET /Auth** - Verificar si el servidor está funcionando.\n \n- **GET /Authenticated User** - Obtener datos del usuario autenticado.\n \n- **POST /Register** - Registrar un nuevo usuario.\n \n- **POST /Login** - Iniciar sesión con credenciales.\n \n- **POST /Logout** - Cerrar sesión.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "16888260"
},
"item": [
{
"name": "Auth",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{go_server}}/auth",
"host": [
"{{go_server}}"
],
"path": [
"auth"
]
}
},
"response": []
},
{
"name": "Authenticated User",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{go_server}}/auth/authenticated-user",
"host": [
"{{go_server}}"
],
"path": [
"auth",
"authenticated-user"
]
}
},
"response": []
},
{
"name": "Register",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"armando\",\r\n \t\"email\": \"armando@goauth.com\",\r\n \t\"password\": \"1234\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://127.0.0.1:8080/auth/register",
"protocol": "http",
"host": [
"127",
"0",
"0",
"1"
],
"port": "8080",
"path": [
"auth",
"register"
]
},
"description": "This is a GET request and it is used to \"get\" data from an endpoint. There is no request body for a GET request, but you can use query parameters to help specify the resource you want data on (e.g., in this request, we have `id=1`).\n\nA successful GET response will have a `200 OK` status, and should include some kind of response body - for example, HTML web content or JSON data."
},
"response": []
},
{
"name": "Login",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful POST request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"email\": \"armando@goauth.com\",\n \"password\": \"1234\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{go_server}}/auth/login",
"host": [
"{{go_server}}"
],
"path": [
"auth",
"login"
]
},
"description": "This is a POST request, submitting data to an API via the request body. This request submits JSON data, and the data is reflected in the response.\n\nA successful POST request typically returns a `200 OK` or `201 Created` response code."
},
"response": []
},
{
"name": "Logout",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful POST request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"name\": \"Add your name in the body\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{go_server}}/auth/logout",
"host": [
"{{go_server}}"
],
"path": [
"auth",
"logout"
]
},
"description": "This is a POST request, submitting data to an API via the request body. This request submits JSON data, and the data is reflected in the response.\n\nA successful POST request typically returns a `200 OK` or `201 Created` response code."
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "id",
"value": "1"
},
{
"key": "base_url",
"value": "https://postman-rest-api-learner.glitch.me/"
}
]
}