Skip to content

Commit 672216a

Browse files
Merge pull request #82 from com-pas/postmna-files
Added Postman collections
2 parents 9600bf6 + 40c3d78 commit 672216a

6 files changed

+385
-0
lines changed

postman/auth.collection.json

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
{
2+
"info": {
3+
"_postman_id": "1cb5ef5a-b707-4e19-a271-fc1522a87ef6",
4+
"name": "Compas Auth",
5+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6+
"_exporter_id": "1434829"
7+
},
8+
"item": [
9+
{
10+
"name": "Get JWT (SCL Data Editor)",
11+
"event": [
12+
{
13+
"listen": "test",
14+
"script": {
15+
"exec": [
16+
"let responseData=pm.response.json();",
17+
"pm.environment.set(\"bearer\", responseData.access_token);",
18+
"",
19+
"let template = `",
20+
"<html>",
21+
"<head>",
22+
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js\"></script>",
23+
" <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js\"></script>",
24+
"</head>",
25+
"<body>",
26+
" <div>",
27+
" <div>",
28+
" <pre><code style=\"width:max-content!important;\" id=\"copyText\">Bearer ${pm.environment.get('bearer')}</code></pre>",
29+
" </div>",
30+
" <button id=\"copyButton\" class=\"copyButton\" type=\"button\" data-clipboard-action=\"copy\" data-clipboard-target=\"#copyText\" style=\"background:green;color:white;\">Copy to Clipboard</button>",
31+
" </div>",
32+
"</body>",
33+
"</html>",
34+
"<script>",
35+
" var clipboard = new ClipboardJS('#copyButton');",
36+
"",
37+
" clipboard.on('success', function(e) {",
38+
" e.clearSelection();",
39+
" e.trigger.textContent = '✔ Copied!';",
40+
" window.setTimeout(function() {",
41+
" e.trigger.textContent = 'Copy to Clipboard';",
42+
" }, 2000);",
43+
" });",
44+
" clipboard.on('error', function(e) {",
45+
" e.clearSelection();",
46+
" e.trigger.textContent = '✗ Not Copied';",
47+
" window.setTimeout(function() {",
48+
" e.trigger.textContent = 'Copy to Clipboard';",
49+
" }, 2000);",
50+
" });",
51+
" document.getElementById('copyButton').click()",
52+
"</script>`;",
53+
"",
54+
"pm.visualizer.set(template, pm.response.json());",
55+
""
56+
],
57+
"type": "text/javascript"
58+
}
59+
}
60+
],
61+
"request": {
62+
"method": "POST",
63+
"header": [],
64+
"body": {
65+
"mode": "urlencoded",
66+
"urlencoded": [
67+
{
68+
"key": "grant_type",
69+
"value": "password",
70+
"type": "text"
71+
},
72+
{
73+
"key": "client_id",
74+
"value": "openscd",
75+
"type": "text"
76+
},
77+
{
78+
"key": "username",
79+
"value": "scl-data-editor",
80+
"type": "text"
81+
},
82+
{
83+
"key": "password",
84+
"value": "editor",
85+
"type": "text"
86+
}
87+
]
88+
},
89+
"url": {
90+
"raw": "{{authUrl}}/realms/compas/protocol/openid-connect/token",
91+
"host": [
92+
"{{authUrl}}"
93+
],
94+
"path": [
95+
"realms",
96+
"compas",
97+
"protocol",
98+
"openid-connect",
99+
"token"
100+
]
101+
}
102+
},
103+
"response": []
104+
},
105+
{
106+
"name": "Get JWT (SCL Data Reader)",
107+
"event": [
108+
{
109+
"listen": "test",
110+
"script": {
111+
"exec": [
112+
"let responseData=pm.response.json();",
113+
"pm.environment.set(\"bearer\", responseData.access_token);",
114+
"",
115+
"let template = `",
116+
"<html>",
117+
"<head>",
118+
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js\"></script>",
119+
" <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js\"></script>",
120+
"</head>",
121+
"<body>",
122+
" <div>",
123+
" <div>",
124+
" <pre><code style=\"width:max-content!important;\" id=\"copyText\">${pm.environment.get('bearer')}</code></pre>",
125+
" </div>",
126+
" <button id=\"copyButton\" class=\"copyButton\" type=\"button\" data-clipboard-action=\"copy\" data-clipboard-target=\"#copyText\" style=\"background:green;color:white;\">Copy to Clipboard</button>",
127+
" </div>",
128+
"</body>",
129+
"</html>",
130+
"<script>",
131+
" var clipboard = new ClipboardJS('#copyButton');",
132+
"",
133+
" clipboard.on('success', function(e) {",
134+
" e.clearSelection();",
135+
" e.trigger.textContent = '✔ Copied!';",
136+
" window.setTimeout(function() {",
137+
" e.trigger.textContent = 'Copy to Clipboard';",
138+
" }, 2000);",
139+
" });",
140+
" clipboard.on('error', function(e) {",
141+
" e.clearSelection();",
142+
" e.trigger.textContent = '✗ Not Copied';",
143+
" window.setTimeout(function() {",
144+
" e.trigger.textContent = 'Copy to Clipboard';",
145+
" }, 2000);",
146+
" });",
147+
" document.getElementById('copyButton').click()",
148+
"</script>`;",
149+
"",
150+
"pm.visualizer.set(template, pm.response.json());",
151+
""
152+
],
153+
"type": "text/javascript"
154+
}
155+
}
156+
],
157+
"request": {
158+
"method": "POST",
159+
"header": [],
160+
"body": {
161+
"mode": "urlencoded",
162+
"urlencoded": [
163+
{
164+
"key": "grant_type",
165+
"value": "password",
166+
"type": "text"
167+
},
168+
{
169+
"key": "client_id",
170+
"value": "openscd",
171+
"type": "text"
172+
},
173+
{
174+
"key": "username",
175+
"value": "scl-data-reader",
176+
"type": "text"
177+
},
178+
{
179+
"key": "password",
180+
"value": "reader",
181+
"type": "text"
182+
}
183+
]
184+
},
185+
"url": {
186+
"raw": "{{authUrl}}/realms/compas/protocol/openid-connect/token",
187+
"host": [
188+
"{{authUrl}}"
189+
],
190+
"path": [
191+
"realms",
192+
"compas",
193+
"protocol",
194+
"openid-connect",
195+
"token"
196+
]
197+
}
198+
},
199+
"response": []
200+
},
201+
{
202+
"name": "Get JWT (SCD Reader)",
203+
"event": [
204+
{
205+
"listen": "test",
206+
"script": {
207+
"exec": [
208+
"let responseData=pm.response.json();",
209+
"pm.environment.set(\"bearer\", responseData.access_token);",
210+
"",
211+
"let template = `",
212+
"<html>",
213+
"<head>",
214+
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js\"></script>",
215+
" <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js\"></script>",
216+
"</head>",
217+
"<body>",
218+
" <div>",
219+
" <div>",
220+
" <pre><code style=\"width:max-content!important;\" id=\"copyText\">${pm.environment.get('bearer')}</code></pre>",
221+
" </div>",
222+
" <button id=\"copyButton\" class=\"copyButton\" type=\"button\" data-clipboard-action=\"copy\" data-clipboard-target=\"#copyText\" style=\"background:green;color:white;\">Copy to Clipboard</button>",
223+
" </div>",
224+
"</body>",
225+
"</html>",
226+
"<script>",
227+
" var clipboard = new ClipboardJS('#copyButton');",
228+
"",
229+
" clipboard.on('success', function(e) {",
230+
" e.clearSelection();",
231+
" e.trigger.textContent = '✔ Copied!';",
232+
" window.setTimeout(function() {",
233+
" e.trigger.textContent = 'Copy to Clipboard';",
234+
" }, 2000);",
235+
" });",
236+
" clipboard.on('error', function(e) {",
237+
" e.clearSelection();",
238+
" e.trigger.textContent = '✗ Not Copied';",
239+
" window.setTimeout(function() {",
240+
" e.trigger.textContent = 'Copy to Clipboard';",
241+
" }, 2000);",
242+
" });",
243+
" document.getElementById('copyButton').click()",
244+
"</script>`;",
245+
"",
246+
"pm.visualizer.set(template, pm.response.json());",
247+
""
248+
],
249+
"type": "text/javascript"
250+
}
251+
}
252+
],
253+
"request": {
254+
"method": "POST",
255+
"header": [],
256+
"body": {
257+
"mode": "urlencoded",
258+
"urlencoded": [
259+
{
260+
"key": "grant_type",
261+
"value": "password",
262+
"type": "text"
263+
},
264+
{
265+
"key": "client_id",
266+
"value": "openscd",
267+
"type": "text"
268+
},
269+
{
270+
"key": "username",
271+
"value": "scd-reader",
272+
"type": "text"
273+
},
274+
{
275+
"key": "password",
276+
"value": "reader",
277+
"type": "text"
278+
}
279+
]
280+
},
281+
"url": {
282+
"raw": "{{authUrl}}/realms/compas/protocol/openid-connect/token",
283+
"host": [
284+
"{{authUrl}}"
285+
],
286+
"path": [
287+
"realms",
288+
"compas",
289+
"protocol",
290+
"openid-connect",
291+
"token"
292+
]
293+
}
294+
},
295+
"response": []
296+
}
297+
]
298+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
3+
SPDX-License-Identifier: Apache-2.0
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"id": "42022eb4-7cc9-483c-919f-145bb2c5ba61",
3+
"name": "Docker Compose",
4+
"values": [
5+
{
6+
"key": "sclDataServiceBaseUrl",
7+
"value": "http://localhost:9090/compas-scl-data-service",
8+
"enabled": true
9+
},
10+
{
11+
"key": "cimMappingBaseUrl",
12+
"value": "http://localhost:9091/compas-cim-mapping",
13+
"enabled": true
14+
},
15+
{
16+
"key": "authUrl",
17+
"value": "http://localhost:8089/auth",
18+
"enabled": true
19+
},
20+
{
21+
"key": "bearer",
22+
"value": "",
23+
"enabled": true
24+
},
25+
{
26+
"key": "sclAutoAlignServiceBaseUrl",
27+
"value": "http://localhost:9092/compas-scl-auto-alignment",
28+
"enabled": true
29+
},
30+
{
31+
"key": "sclValidatorBaseUrl",
32+
"value": "http://localhost:9093/compas-scl-validator",
33+
"enabled": true
34+
}
35+
],
36+
"_postman_variable_scope": "environment",
37+
"_postman_exported_at": "2022-07-11T08:51:37.380Z",
38+
"_postman_exported_using": "Postman/9.24.1"
39+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
3+
SPDX-License-Identifier: Apache-2.0

postman/local.environment.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"id": "bf50c1be-fa5a-4b32-b372-098bc6190d42",
3+
"name": "Local",
4+
"values": [
5+
{
6+
"key": "sclDataServiceBaseUrl",
7+
"value": "http://localhost:9090/compas-scl-data-service",
8+
"enabled": true
9+
},
10+
{
11+
"key": "cimMappingBaseUrl",
12+
"value": "http://localhost:9091/compas-cim-mapping",
13+
"enabled": true
14+
},
15+
{
16+
"key": "authUrl",
17+
"value": "http://localhost:8089/auth",
18+
"enabled": true
19+
},
20+
{
21+
"key": "bearer",
22+
"value": "",
23+
"enabled": true
24+
},
25+
{
26+
"key": "sclAutoAlignServiceBaseUrl",
27+
"value": "http://localhost:9092/compas-scl-auto-alignment",
28+
"enabled": true
29+
},
30+
{
31+
"key": "sclValidatorBaseUrl",
32+
"value": "http://localhost:9093/compas-scl-validator",
33+
"enabled": true
34+
}
35+
],
36+
"_postman_variable_scope": "environment",
37+
"_postman_exported_at": "2022-07-11T08:50:55.958Z",
38+
"_postman_exported_using": "Postman/9.24.1"
39+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
3+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)