Skip to content

Commit efa8ddd

Browse files
author
kadraman
committed
Refactorings and validation for Site collection
1 parent 78c27d0 commit efa8ddd

20 files changed

+1113
-134
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"info": {
3+
"_postman_id": "3a2cadbd-426c-46f4-bfa7-41c25a12c383",
4+
"name": "InsecureRestAPI-Auth",
5+
"description": "An example collection for authenticating against IWA (Insecure Web Application) REST API",
6+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
7+
"_exporter_id": "13859659",
8+
"_collection_link": "https://mfdemouk.postman.co/workspace/My-Workspace~c71e9c5c-d86a-44e4-8a78-9b4f1d507064/collection/13859659-3a2cadbd-426c-46f4-bfa7-41c25a12c383?action=share&source=collection_link&creator=13859659"
9+
},
10+
"item": [
11+
{
12+
"name": "Authentication",
13+
"item": [
14+
{
15+
"name": "Sign In",
16+
"event": [
17+
{
18+
"listen": "test",
19+
"script": {
20+
"exec": [
21+
"pm.test(\"Status code is 200\", function () {\r",
22+
" pm.response.to.have.status(200);\r",
23+
"});\r",
24+
"pm.test(\"Access token returned\", function () {\r",
25+
" var jsonData = pm.response.json();\r",
26+
" pm.expect(jsonData.accessToken).exist;\r",
27+
" console.log('Saving JWT access token in environment: ' + jsonData.accessToken)\r",
28+
" pm.environmentVariables.set('jwt_token', jsonData.accessToken)\r",
29+
"});"
30+
],
31+
"type": "text/javascript",
32+
"packages": {}
33+
}
34+
}
35+
],
36+
"request": {
37+
"method": "POST",
38+
"header": [],
39+
"body": {
40+
"mode": "raw",
41+
"raw": "{\r\n \"email\": \"{{email}}\",\r\n \"password\": \"{{password}}\"\r\n}",
42+
"options": {
43+
"raw": {
44+
"language": "json"
45+
}
46+
}
47+
},
48+
"url": {
49+
"raw": "{{base_url}}/api/v1/site/sign-in",
50+
"host": [
51+
"{{base_url}}"
52+
],
53+
"path": [
54+
"api",
55+
"v1",
56+
"site",
57+
"sign-in"
58+
]
59+
},
60+
"description": "Sign in to the server, retrieve access token and store in variable \"jwt_token\""
61+
},
62+
"response": []
63+
}
64+
]
65+
}
66+
],
67+
"auth": {
68+
"type": "bearer",
69+
"bearer": [
70+
{
71+
"key": "token",
72+
"value": "{{jwt_token}}",
73+
"type": "string"
74+
}
75+
]
76+
},
77+
"event": [
78+
{
79+
"listen": "prerequest",
80+
"script": {
81+
"type": "text/javascript",
82+
"exec": [
83+
""
84+
]
85+
}
86+
},
87+
{
88+
"listen": "test",
89+
"script": {
90+
"type": "text/javascript",
91+
"exec": [
92+
""
93+
]
94+
}
95+
}
96+
]
97+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"id": "6eef6d6f-f18e-4bb5-97c1-d3d6916a5488",
3+
"name": "InsecureRestAPI-Development",
4+
"values": [
5+
{
6+
"key": "base_url",
7+
"value": "http://localhost:5000",
8+
"type": "default",
9+
"enabled": true
10+
},
11+
{
12+
"key": "email",
13+
"value": "admin@localhost.com",
14+
"type": "default",
15+
"enabled": true
16+
},
17+
{
18+
"key": "password",
19+
"value": "password",
20+
"type": "default",
21+
"enabled": true
22+
},
23+
{
24+
"key": "jwt_token",
25+
"value": "",
26+
"type": "default",
27+
"enabled": true
28+
},
29+
{
30+
"key": "new-email",
31+
"value": "test@localhost.com",
32+
"type": "default",
33+
"enabled": true
34+
},
35+
{
36+
"key": "existing-email",
37+
"value": "user1@localhost.com",
38+
"type": "default",
39+
"enabled": true
40+
}
41+
],
42+
"_postman_variable_scope": "environment",
43+
"_postman_exported_at": "2025-06-26T08:40:42.877Z",
44+
"_postman_exported_using": "Postman/11.51.3"
45+
}

0 commit comments

Comments
 (0)