-
Notifications
You must be signed in to change notification settings - Fork 0
/
Authorization.postman_collection.json
86 lines (86 loc) · 2.44 KB
/
Authorization.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
{
"info": {
"_postman_id": "31814179-08f2-4af9-ab15-046efaa35e0f",
"name": "goAuthSystem",
"description": "This collection contains endpoints for the goAuthSystem, a CRUD JWT-based authentication service built using Golang. The collection is designed to demonstrate user signup, login, and token validation, providing essential operations for user authentication.\n\n### API Endpoints:\n\n1. **POST** **`/signup`** \n Registers a new user by taking an email and password and storing the user in the database.\n \n2. **POST** **`/login`** \n Authenticates a registered user and provides a JWT token for further requests.\n \n3. **GET** **`/validate`** \n Validates the JWT token to allow access to protected routes.\n \n\n### Usage\n\nTo test these endpoints:\n\n- Use the **/signup** endpoint to create a new user.\n \n- After signing up, use the **/login** endpoint to receive a JWT token.\n \n- For protected routes, pass the JWT token in the `Authorization` header (e.g., `Bearer` ) when making requests to **/validate**.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "21691506"
},
"item": [
{
"name": "signup",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"[email protected]\",\r\n \"password\": \"12345\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/signup",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"signup"
]
}
},
"response": []
},
{
"name": "login",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"[email protected]\",\r\n \"password\": \"12345\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/login",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"login"
]
}
},
"response": []
},
{
"name": "validation",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/validate",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"validate"
]
}
},
"response": []
}
]
}