@northern.tech/testing 0.19.2 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/mockData.d.ts +0 -2
  2. package/dist/mockData.js +1 -2
  3. package/dist/openapi.yaml.d.ts +0 -2
  4. package/dist/public/baseTestConfig.json +3 -0
  5. package/dist/requestHandlers/deploymentHandlers.d.ts +1 -3
  6. package/dist/requestHandlers/deploymentHandlers.js +3 -4
  7. package/dist/requestHandlers/deploymentHandlers.js.map +1 -1
  8. package/dist/requestHandlers/deviceHandlers.d.ts +1 -3
  9. package/dist/requestHandlers/deviceHandlers.js +3 -4
  10. package/dist/requestHandlers/deviceHandlers.js.map +1 -1
  11. package/dist/requestHandlers/monitorHandlers.d.ts +1 -3
  12. package/dist/requestHandlers/monitorHandlers.js +3 -4
  13. package/dist/requestHandlers/monitorHandlers.js.map +1 -1
  14. package/dist/requestHandlers/organizationHandlers.d.ts +1 -3
  15. package/dist/requestHandlers/organizationHandlers.js +3 -4
  16. package/dist/requestHandlers/organizationHandlers.js.map +1 -1
  17. package/dist/requestHandlers/releaseHandlers.d.ts +1 -3
  18. package/dist/requestHandlers/releaseHandlers.js +3 -4
  19. package/dist/requestHandlers/releaseHandlers.js.map +1 -1
  20. package/dist/requestHandlers/requestHandlers.d.ts +1 -3
  21. package/dist/requestHandlers/requestHandlers.js +2 -3
  22. package/dist/requestHandlers/requestHandlers.js.map +1 -1
  23. package/dist/requestHandlers/userHandlers.d.ts +1 -3
  24. package/dist/requestHandlers/userHandlers.js +3 -4
  25. package/dist/requestHandlers/userHandlers.js.map +1 -1
  26. package/dist/requestHandlers/validation.d.ts +0 -2
  27. package/dist/requestHandlers/validation.js +1 -1
  28. package/dist/setupTests.d.ts +9 -12
  29. package/dist/setupTests.js +2 -13
  30. package/dist/setupTests.js.map +1 -1
  31. package/dist/theme/light.d.ts +0 -2
  32. package/dist/theme/light.js +0 -1
  33. package/dist/theme/mui.d.ts +0 -2
  34. package/dist/utils.d.ts +0 -2
  35. package/dist/utils.js +1 -2
  36. package/dist/{validation-DgBXU2ez.js → validation-BwwNVIxo.js} +3 -5
  37. package/dist/{validation-DgBXU2ez.js.map → validation-BwwNVIxo.js.map} +1 -1
  38. package/package.json +7 -8
  39. package/dist/mockData.cjs +0 -1408
  40. package/dist/mockData.cjs.map +0 -1
  41. package/dist/mockData.d.cts +0 -721
  42. package/dist/openapi.yaml.d.cjs +0 -0
  43. package/dist/openapi.yaml.d.cts +0 -4
  44. package/dist/requestHandlers/deploymentHandlers.cjs +0 -193
  45. package/dist/requestHandlers/deploymentHandlers.cjs.map +0 -1
  46. package/dist/requestHandlers/deploymentHandlers.d.cts +0 -4
  47. package/dist/requestHandlers/deviceHandlers.cjs +0 -467
  48. package/dist/requestHandlers/deviceHandlers.cjs.map +0 -1
  49. package/dist/requestHandlers/deviceHandlers.d.cts +0 -31
  50. package/dist/requestHandlers/monitorHandlers.cjs +0 -23
  51. package/dist/requestHandlers/monitorHandlers.cjs.map +0 -1
  52. package/dist/requestHandlers/monitorHandlers.d.cts +0 -4
  53. package/dist/requestHandlers/organizationHandlers.cjs +0 -313
  54. package/dist/requestHandlers/organizationHandlers.cjs.map +0 -1
  55. package/dist/requestHandlers/organizationHandlers.d.cts +0 -4
  56. package/dist/requestHandlers/releaseHandlers.cjs +0 -244
  57. package/dist/requestHandlers/releaseHandlers.cjs.map +0 -1
  58. package/dist/requestHandlers/releaseHandlers.d.cts +0 -4
  59. package/dist/requestHandlers/requestHandlers.cjs +0 -27
  60. package/dist/requestHandlers/requestHandlers.cjs.map +0 -1
  61. package/dist/requestHandlers/requestHandlers.d.cts +0 -4
  62. package/dist/requestHandlers/userHandlers.cjs +0 -164
  63. package/dist/requestHandlers/userHandlers.cjs.map +0 -1
  64. package/dist/requestHandlers/userHandlers.d.cts +0 -4
  65. package/dist/requestHandlers/validation.cjs +0 -4
  66. package/dist/requestHandlers/validation.d.cts +0 -5
  67. package/dist/setupTests.cjs +0 -172
  68. package/dist/setupTests.cjs.map +0 -1
  69. package/dist/setupTests.d.cts +0 -76
  70. package/dist/theme/light.cjs +0 -9
  71. package/dist/theme/light.cjs.map +0 -1
  72. package/dist/theme/light.d.cts +0 -5
  73. package/dist/theme/mui.d.cjs +0 -0
  74. package/dist/theme/mui.d.cts +0 -11
  75. package/dist/utils.cjs +0 -22
  76. package/dist/utils.cjs.map +0 -1
  77. package/dist/utils.d.cts +0 -5
  78. package/dist/validation-DAMYMdv9.cjs +0 -75
  79. package/dist/validation-DAMYMdv9.cjs.map +0 -1
package/dist/mockData.cjs DELETED
@@ -1,1408 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
3
- //#region src/mockData.ts
4
- const undefineds = /undefined|\[object Object\]/;
5
- const menderEnvironment = {
6
- features: { hasMultitenancy: true },
7
- version: "saas-123.34"
8
- };
9
- const TEST_SESSION_DATETIME = "2019-01-13T13:00:00.000Z";
10
- const testDate = /* @__PURE__ */ new Date(TEST_SESSION_DATETIME);
11
- const mockDate = new Date(testDate.setMilliseconds(testDate.getMilliseconds() + _northern_tech_utils_constants.maxSessionAge));
12
- const defaultPassword = "mysecretpassword!123";
13
- const defaultCreationDate = "2019-01-13T06:25:00.000Z";
14
- const defaultMacAddress = "dc:a6:32:12:ad:bf";
15
- const testSsoId = "sso_id";
16
- const permissionSetObjectTypes = {
17
- any: "Any",
18
- artifacts: "Artifacts",
19
- empty: "",
20
- groups: "Device groups",
21
- releases: "Releases",
22
- tenantManagement: "Tenant management",
23
- userManagement: "User management"
24
- };
25
- const commonEndpoints = {
26
- artifacts: "^/api/management/v1/deployments/artifacts",
27
- artifactDetails: "^/api/management/v1/deployments/artifacts/[^/]+",
28
- deviceManagement: "^/api/management/(v[1-9])/(devauth|inventory)/"
29
- };
30
- const token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjZTNkMGY4Yy1hZWRlLTQwMzAtYjM5MS03ZDUwMjBlYjg3M2UiLCJzdWIiOiJhMzBhNzgwYi1iODQzLTUzNDQtODBlMy0wZmQ5NWE0ZjZmYzMiLCJleHAiOjE2MDY4MTUzNjksImlhdCI6MTYwNjIxMDU2OSwibWVuZGVyLnRlbmFudCI6IjVmODVjMTdiY2U2MmI3ZmE3ZjVmNzA0MCIsIm1lbmRlci51c2VyIjp0cnVlLCJpc3MiOiJNZW5kZXIgVXNlcnMiLCJzY3AiOiJtZW5kZXIuKiIsIm1lbmRlci5wbGFuIjoicHJvZmVzc2lvbmFsIiwibmJmIjoxNjA2MjEwNTY5fQ.qVgYdCzLTf8OdK9uUctqqaY_HWkIiwpekuGvuGQAXCEgOv4bRNDlZRN_ZRSbxQoARG3pquhScbQrjBV9tcF4irTUPlTn3yrsXNO17DpcbTVeKRkb88RDtIKiRw3orVZ_GlIb-ckTQ5dS-Nqlyyf3Fmrhca-gwt6m_xv2UrmJK6eYYTMfggdRRWb-4u7mEkBI_pHPMTQrT8kJ2BeX-vHgazH9AoH0k85LHtFZQXD7pXHlDZRnLxJXukncwMGDmF17374gavYAIyDIzcC8sEBMDnVXgpikeA1sauzirqix6mAVs6XmxdQO7aF0wfXO1_PTYUA3Nk1oQfMYNlEI3U9uLRJRZIq2L8fmrrBryhstKd4y0KlBbGAQrx8NtRkgajjd1ljMfPBUEZrb7uSerVjneiO-aIBO76CuH0zdklphIjpGJeogkBhe8pAYNggp1XsZHgpZfl7IE5faKaDkMGnutaea--Czor6bhqUNCuY4tR0cpQJbNwy6LS9o1CFy4Log";
31
- const accessTokens = [{
32
- id: "some-id-1",
33
- expiration_date: "2022-06-02T11:11:21.725Z",
34
- name: "some-name-1"
35
- }, {
36
- id: "some-id-2",
37
- expiration_date: "2022-06-02T11:11:21.725Z",
38
- last_used: "2022-06-02T11:05:21.725Z",
39
- name: "some-name-2"
40
- }];
41
- const pendingEmailChange = {
42
- new_email: "new_email@acme.com",
43
- created_ts: "2019-01-13T07:25:00.000Z",
44
- valid_until: "2019-01-13T08:25:00.000Z"
45
- };
46
- const webhookEvents = [{
47
- id: "1",
48
- type: "device-status-changed",
49
- data: {
50
- id: "1",
51
- status: "accepted"
52
- },
53
- time: "2020-09-01T12:00:00.000Z",
54
- delivery_statuses: [{
55
- integration_id: "1",
56
- success: true,
57
- status_code: 200
58
- }]
59
- }, {
60
- id: "2",
61
- type: "device-status-changed",
62
- data: {
63
- id: "3",
64
- status: "accepted"
65
- },
66
- time: "2020-09-01T12:00:05.000Z",
67
- delivery_statuses: [{
68
- integration_id: "1",
69
- success: true,
70
- status_code: 200
71
- }]
72
- }];
73
- const spTenantLimits = {
74
- max_devices: {
75
- current_value: 0,
76
- name: "max_devices",
77
- tenant_id: "699f07a3e783def54cf6201f",
78
- value: 200
79
- },
80
- max_micro_devices: {
81
- current_value: 0,
82
- name: "max_micro_devices",
83
- tenant_id: "699f07a3e783def54cf6201f",
84
- value: 280
85
- },
86
- max_system_devices: {
87
- current_value: 0,
88
- name: "max_system_devices",
89
- tenant_id: "699f07a3e783def54cf6201f",
90
- value: 20
91
- }
92
- };
93
- const tenants = [{
94
- id: "671a0f1dd58c813118fe8622",
95
- parent_tenant_id: "6718de64b42e08dea2a2065d",
96
- name: "child2",
97
- tenant_token: "mQDYRCr-tGbDuJhPp7fArbfTA5htVTWE9G204AzhDUM",
98
- status: "active",
99
- additional_info: {
100
- marketing: false,
101
- campaign: ""
102
- },
103
- plan: "enterprise",
104
- trial: false,
105
- trial_expiration: null,
106
- service_provider: false,
107
- created_at: "2024-10-24T09:10:53.281Z",
108
- cancelled_at: null,
109
- children_tenants: null,
110
- max_child_tenants: 0,
111
- device_count: 0,
112
- device_limit: 100,
113
- device_limits: {
114
- max_devices: {
115
- current_value: 0,
116
- name: "max_devices",
117
- tenant_id: "699f07a3e783def54cf6201f",
118
- value: 200
119
- },
120
- max_micro_devices: {
121
- current_value: 0,
122
- name: "max_micro_devices",
123
- tenant_id: "699f07a3e783def54cf6201f",
124
- value: 280
125
- },
126
- max_system_devices: {
127
- current_value: 0,
128
- name: "max_system_devices",
129
- tenant_id: "699f07a3e783def54cf6201f",
130
- value: 20
131
- }
132
- },
133
- binary_delta: true
134
- }];
135
- const adminUserCapabilities = {
136
- canAuditlog: true,
137
- canConfigure: true,
138
- canDeploy: true,
139
- canManageDevices: true,
140
- canManageReleases: true,
141
- canManageUsers: true,
142
- canReadDeployments: true,
143
- canReadDevices: true,
144
- canReadReleases: true,
145
- canReadUsers: true,
146
- canTroubleshoot: true,
147
- canUploadReleases: true,
148
- canWriteDevices: true
149
- };
150
- const userId = "a30a780b-b843-5344-80e3-0fd95a4f6fc3";
151
- const defaultUser = {
152
- created_ts: "2019-01-01T10:30:00.000Z",
153
- email: "a@b.com",
154
- id: "a1",
155
- roles: ["RBAC_ROLE_PERMIT_ALL"],
156
- tfa_status: "enabled",
157
- verified: true
158
- };
159
- const deviceTypes = { qemu: "qemux86-64" };
160
- const checkInTimeRounded = "2019-01-01T00:00:00.000Z";
161
- const checkInTimeExact = "2019-01-01T10:25:00.000Z";
162
- const mockApiResponses = {
163
- deployments: {
164
- byId: {
165
- d1: {
166
- id: "d1",
167
- name: "test deployment",
168
- created: "2019-01-01T12:30:00.000Z",
169
- devices: { a1: {
170
- id: "a1",
171
- status: "installing",
172
- attributes: {},
173
- image: { size: 123 }
174
- } },
175
- statistics: {
176
- status: {
177
- "already-installed": 0,
178
- decommissioned: 0,
179
- downloading: 0,
180
- failure: 0,
181
- installing: 1,
182
- noartifact: 0,
183
- pending: 0,
184
- rebooting: 0,
185
- success: 0
186
- },
187
- total_size: 1234
188
- }
189
- },
190
- d2: {
191
- id: "d2",
192
- name: "test deployment 2",
193
- artifact_name: "r1",
194
- artifacts: ["123"],
195
- created: "2019-01-01T12:25:00.000Z",
196
- device_count: 1,
197
- devices: { b1: {
198
- attributes: {},
199
- id: "b1",
200
- status: "pending"
201
- } },
202
- filter: void 0,
203
- group: void 0,
204
- statistics: { status: {
205
- downloading: 0,
206
- decommissioned: 0,
207
- failure: 0,
208
- installing: 0,
209
- noartifact: 0,
210
- pending: 1,
211
- rebooting: 0,
212
- success: 0,
213
- "already-installed": 0
214
- } }
215
- },
216
- d3: {
217
- id: "d3",
218
- name: "Test",
219
- phases: [
220
- {
221
- id: "0",
222
- batch_size: 2,
223
- device_count: 2
224
- },
225
- {
226
- id: "1",
227
- start_ts: "2019-02-04T11:45:10.002Z",
228
- batch_size: 3,
229
- device_count: 3
230
- },
231
- {
232
- id: "2",
233
- start_ts: "2019-02-05T11:45:10.002Z",
234
- batch_size: 5,
235
- device_count: 5
236
- },
237
- {
238
- id: "3",
239
- start_ts: "2019-02-06T11:45:10.002Z",
240
- batch_size: 5,
241
- device_count: 5
242
- },
243
- {
244
- id: "4",
245
- start_ts: "2019-02-21T11:45:10.002Z",
246
- batch_size: 5,
247
- device_count: 0
248
- }
249
- ],
250
- max_devices: 0,
251
- created: "2019-01-31T12:59:30.020Z",
252
- devices: {},
253
- filter: void 0,
254
- group: void 0,
255
- stats: {
256
- pending: 3,
257
- decommissioned: 0,
258
- failure: 23,
259
- pause_before_committing: 0,
260
- pause_before_rebooting: 0,
261
- installing: 0,
262
- rebooting: 0,
263
- "already-installed": 0,
264
- pause_before_installing: 0,
265
- downloading: 0,
266
- success: 6,
267
- aborted: 0,
268
- noartifact: 0
269
- },
270
- statistics: { total_size: "1234" },
271
- status: "inprogress",
272
- active: true,
273
- device_count: 100,
274
- retries: 0,
275
- type: "software"
276
- }
277
- },
278
- byStatus: {
279
- pending: { deploymentIds: ["d2"] },
280
- inprogress: { deploymentIds: ["d3"] }
281
- }
282
- },
283
- devices: {
284
- byId: {
285
- a1: {
286
- id: "a1",
287
- auth_sets: [{
288
- id: "auth1",
289
- identity_data: { mac: defaultMacAddress },
290
- pubkey: "-----BEGIN PUBLIC KEY-----\nMIIBojWELzgJ62hcXIhAfqfoNiaB1326XZByZwcnHr5BuSPAgMBAAE=\n-----END PUBLIC KEY-----\n",
291
- status: "accepted",
292
- ts: defaultCreationDate
293
- }],
294
- updated_ts: "2019-01-01T09:25:00.000Z"
295
- },
296
- b1: {
297
- id: "b1",
298
- attributes: {
299
- ipv4_wlan0: "192.168.10.141/24",
300
- device_type: [deviceTypes.qemu]
301
- },
302
- system: { check_in_time: checkInTimeRounded },
303
- check_in_time: checkInTimeExact,
304
- check_in_time_exact: checkInTimeExact,
305
- check_in_time_rounded: checkInTimeRounded,
306
- identity_data: { mac: defaultMacAddress },
307
- status: "accepted",
308
- decommissioning: false,
309
- created_ts: defaultCreationDate,
310
- updated_ts: "2019-01-01T09:25:00.000Z",
311
- auth_sets: [{
312
- id: "auth1",
313
- identity_data: { mac: defaultMacAddress },
314
- pubkey: "-----BEGIN PUBLIC KEY-----\nMIIBojWELzgJ62hcXIhAfqfoNiaB1326XZByZwcnHr5BuSPAgMBAAE=\n-----END PUBLIC KEY-----\n",
315
- ts: defaultCreationDate,
316
- status: "accepted"
317
- }]
318
- }
319
- },
320
- groups: { byId: {
321
- testGroup: {
322
- deviceIds: ["a1", "b1"],
323
- filters: [],
324
- total: 2
325
- },
326
- testGroupDynamic: {
327
- id: "filter1",
328
- name: "filter1",
329
- filters: [{
330
- scope: "system",
331
- key: "group",
332
- operator: "$eq",
333
- value: "things"
334
- }]
335
- }
336
- } },
337
- limits: {
338
- standard: 500,
339
- micro: 0,
340
- system: 0,
341
- test: 50
342
- },
343
- byStatus: {
344
- accepted: {
345
- deviceIds: ["a1", "b1"],
346
- total: 2
347
- },
348
- active: {
349
- deviceIds: [],
350
- total: 0
351
- },
352
- inactive: {
353
- deviceIds: [],
354
- total: 0
355
- },
356
- pending: {
357
- deviceIds: ["c1"],
358
- total: 1
359
- },
360
- preauthorized: {
361
- deviceIds: [],
362
- total: 0
363
- },
364
- rejected: {
365
- deviceIds: [],
366
- total: 0
367
- }
368
- }
369
- },
370
- organization: {
371
- organization: {
372
- id: "1",
373
- addons: [],
374
- name: "test",
375
- plan: "os",
376
- trial: false
377
- },
378
- tenantToken: "aaabbbcccdddeeefff",
379
- products: [{
380
- name: "mender_standard",
381
- billing_unit: "devices",
382
- prices: [{
383
- plan: "os",
384
- constraints: {
385
- min: 50,
386
- max: 1e3,
387
- div: 50
388
- }
389
- }, {
390
- plan: "professional",
391
- constraints: {
392
- min: 250,
393
- max: 1e4,
394
- div: 50
395
- }
396
- }],
397
- addons: [
398
- {
399
- name: "troubleshoot",
400
- prices: [{ plan: "os" }, { plan: "professional" }]
401
- },
402
- {
403
- name: "configure",
404
- prices: [{ plan: "os" }, { plan: "professional" }]
405
- },
406
- {
407
- name: "monitor",
408
- prices: [{ plan: "professional" }]
409
- }
410
- ]
411
- }, {
412
- name: "mender_micro",
413
- billing_unit: "devices",
414
- prices: [{
415
- plan: "os",
416
- constraints: {
417
- min: 50,
418
- max: 5e3,
419
- div: 50
420
- }
421
- }, {
422
- plan: "professional",
423
- constraints: {
424
- min: 500,
425
- max: 1e5,
426
- div: 50
427
- }
428
- }]
429
- }],
430
- intentId: "testIntent",
431
- auditlog: { events: [
432
- {
433
- actor: {
434
- id: "string",
435
- type: "user",
436
- email: "string@example.com"
437
- },
438
- time: "2019-01-01T12:10:22.667Z",
439
- action: "create",
440
- object: {
441
- id: "string",
442
- type: "user",
443
- user: { email: "user@acme.com" }
444
- },
445
- change: "change1"
446
- },
447
- {
448
- actor: {
449
- id: "string",
450
- type: "user",
451
- email: "string",
452
- identity_data: "string"
453
- },
454
- time: "2019-01-01T12:16:22.667Z",
455
- action: "create",
456
- object: {
457
- id: "string",
458
- type: "deployment",
459
- deployment: {
460
- name: "production",
461
- artifact_name: "Application 0.0.1"
462
- }
463
- },
464
- change: "change2"
465
- },
466
- {
467
- actor: {
468
- id: "string",
469
- type: "user",
470
- email: "string@example.com"
471
- },
472
- time: "2019-01-01T12:10:22.669Z",
473
- action: "open_terminal",
474
- meta: { session_id: ["abd313a8-ee88-48ab-9c99-fbcd80048e6e"] },
475
- object: {
476
- id: "a1",
477
- type: "device"
478
- },
479
- change: "change3"
480
- }
481
- ] }
482
- },
483
- releases: { byId: { r1: {
484
- name: "r1",
485
- artifacts: [{
486
- id: "art1",
487
- description: "test description",
488
- device_types_compatible: [deviceTypes.qemu],
489
- modified: "2020-09-10T12:16:22.667Z",
490
- updates: [{ type_info: { type: "testtype" } }],
491
- artifact_depends: { device_type: [deviceTypes.qemu] },
492
- artifact_provides: {
493
- artifact_name: "myapp",
494
- "data-partition.myapp.version": "v2020.10",
495
- list_of_fancy: [deviceTypes.qemu, "x172"]
496
- },
497
- clears_artifact_provides: ["data-partition.myapp.*"]
498
- }],
499
- device_types_compatible: [deviceTypes.qemu],
500
- modified: "2020-09-10T12:16:22.667Z",
501
- metaData: {}
502
- } } },
503
- manifests: { byId: { m1000: {
504
- name: "m1000",
505
- modified: "2020-01-01T00:16:39.000Z",
506
- artifact: {
507
- id: "art-m1000",
508
- name: "m1000",
509
- description: "test manifest description",
510
- device_types_compatible: [deviceTypes.qemu],
511
- modified: "2020-01-01T00:16:39.000Z"
512
- },
513
- manifest: {
514
- api_version: "mender/v1",
515
- kind: "manifest",
516
- name: "m1000",
517
- system_types_compatible: [deviceTypes.qemu],
518
- component_types: { "component-a": {
519
- artifact_name: "art-m1000-component",
520
- update_strategy: { order: 10 }
521
- } }
522
- },
523
- tags: [],
524
- notes: ""
525
- } } },
526
- users: {
527
- byId: {
528
- a1: defaultUser,
529
- [userId]: {
530
- ...defaultUser,
531
- id: userId,
532
- email: "a2@b.com",
533
- created_ts: "2019-01-01T12:30:00.000Z"
534
- }
535
- },
536
- rolesById: {
537
- admin: {
538
- name: "admin",
539
- description: "Administrator role",
540
- permissions: []
541
- },
542
- test: {
543
- name: "test",
544
- description: "test description",
545
- permissions: []
546
- }
547
- },
548
- globalSettings: {
549
- "2fa": "enabled",
550
- id_attribute: void 0,
551
- previousFilters: []
552
- },
553
- userSettings: {
554
- "2fa": "disabled",
555
- columnSelection: [],
556
- onboarding: { something: "here" },
557
- tooltips: {},
558
- previousFilters: []
559
- }
560
- }
561
- };
562
- const manifestsList = Array.from({ length: 1e3 }, (_, i) => ({
563
- name: `m${i + 1}`,
564
- modified: new Date(2020, 0, 1, 0, 0, i).toISOString(),
565
- artifact: {
566
- id: `art-m${i + 1}`,
567
- name: `m${i + 1}`,
568
- description: "test manifest description",
569
- device_types_compatible: [deviceTypes.qemu],
570
- modified: new Date(2020, 0, 1, 0, 0, i).toISOString()
571
- },
572
- manifest: {
573
- api_version: "mender/v1",
574
- kind: "manifest",
575
- name: `m${i + 1}`,
576
- system_types_compatible: [deviceTypes.qemu],
577
- component_types: { "component-a": {
578
- artifact_name: `art-m${i + 1}-component`,
579
- update_strategy: { order: 10 }
580
- } }
581
- },
582
- tags: [],
583
- notes: ""
584
- }));
585
- const softwareList = [...Array.from({ length: 500 }, (_, i) => ({
586
- name: `release-${i + 1}`,
587
- modified: new Date(2020, 8, 10, 12, 16, i).toISOString(),
588
- kind: "release",
589
- tags: i < 5 ? ["some-tag"] : [],
590
- update_type: i < 5 ? "single-file" : void 0,
591
- compatible_types: ["raspberrypi4", "qemux86-64"],
592
- notes: ""
593
- })), ...Array.from({ length: 500 }, (_, i) => ({
594
- name: `m${i + 1}`,
595
- modified: new Date(2020, 0, 1, 0, 0, i).toISOString(),
596
- kind: "manifest",
597
- tags: i < 3 ? ["some-tag"] : [],
598
- update_type: i < 2 ? "single-file" : void 0,
599
- compatible_types: ["system-core"],
600
- notes: ""
601
- }))];
602
- const releasesList = Array.from({ length: 5e3 }, (x, i) => ({
603
- artifacts: [{
604
- id: "art1",
605
- description: "test description",
606
- device_types_compatible: [deviceTypes.qemu],
607
- modified: "2020-09-10T12:16:22.667Z",
608
- updates: [{ type_info: { type: "testtype" } }],
609
- artifact_depends: { device_type: [deviceTypes.qemu] },
610
- artifact_provides: {
611
- artifact_name: "myapp",
612
- "data-partition.myapp.version": "v2020.10",
613
- list_of_fancy: [deviceTypes.qemu, "x172"]
614
- },
615
- clears_artifact_provides: ["data-partition.myapp.*"]
616
- }],
617
- device_types_compatible: [deviceTypes.qemu],
618
- metaData: {},
619
- name: `release-${i + 1}`,
620
- modified: i
621
- }));
622
- const permissionSets = [
623
- {
624
- ..._northern_tech_utils_constants.defaultPermissionSets.Basic,
625
- object: permissionSetObjectTypes.empty,
626
- description: "Set containing basic permissions.",
627
- permissions: [
628
- {
629
- action: "http",
630
- object: {
631
- type: "any",
632
- value: "^/api/management/v1/useradm/settings$"
633
- }
634
- },
635
- {
636
- action: "http",
637
- object: {
638
- type: "any",
639
- value: "^/api/management/v1/useradm/users/me$"
640
- }
641
- },
642
- {
643
- action: "http",
644
- object: {
645
- type: "any",
646
- value: "^/api/management/1.0/auth/verify$"
647
- }
648
- },
649
- {
650
- action: "http",
651
- object: {
652
- type: "PUT",
653
- value: "^/api/management/v1/useradm/2faverify$"
654
- }
655
- },
656
- {
657
- action: "http",
658
- object: {
659
- type: "POST",
660
- value: "^/api/management/v1/useradm/users/me/2fa/(enable|disable)$"
661
- }
662
- },
663
- {
664
- action: "http",
665
- object: {
666
- type: "GET",
667
- value: "^/api/management/(v[1-9])/useradm/roles"
668
- }
669
- },
670
- {
671
- action: "http",
672
- object: {
673
- type: "GET",
674
- value: "^/api/management/(v[1-9])/tenantadm/user/tenant"
675
- }
676
- },
677
- {
678
- action: "http",
679
- object: {
680
- type: "GET",
681
- value: "^/api/management/(v[1-9])/tenantadm/tenants/me$"
682
- }
683
- }
684
- ]
685
- },
686
- {
687
- ..._northern_tech_utils_constants.defaultPermissionSets.ManageReleases,
688
- action: _northern_tech_utils_constants.uiPermissionsById.manage.title,
689
- object: permissionSetObjectTypes.releases,
690
- description: "Set of permissions which allows user to manage releases",
691
- permissions: [
692
- {
693
- action: "http",
694
- object: {
695
- type: "GET",
696
- value: commonEndpoints.artifacts
697
- }
698
- },
699
- {
700
- action: "http",
701
- object: {
702
- type: "GET",
703
- value: commonEndpoints.artifactDetails
704
- }
705
- },
706
- {
707
- action: "http",
708
- object: {
709
- type: "PUT",
710
- value: commonEndpoints.artifactDetails
711
- }
712
- },
713
- {
714
- action: "http",
715
- object: {
716
- type: "DELETE",
717
- value: commonEndpoints.artifactDetails
718
- }
719
- },
720
- {
721
- action: "http",
722
- object: {
723
- type: "GET",
724
- value: "^/api/management/v1/deployments/artifacts/[^/]+/download"
725
- }
726
- },
727
- {
728
- action: "http",
729
- object: {
730
- type: "GET",
731
- value: "^/api/management/v1alpha1/deployments/software"
732
- }
733
- }
734
- ]
735
- },
736
- {
737
- ..._northern_tech_utils_constants.defaultPermissionSets.ReadUsers,
738
- action: _northern_tech_utils_constants.uiPermissionsById.read.title,
739
- object: permissionSetObjectTypes.userManagement,
740
- description: "Set of permissions which allows user to view other users",
741
- permissions: [{
742
- action: "http",
743
- object: {
744
- type: "GET",
745
- value: "^/api/management/(v[1-9])/useradm/"
746
- }
747
- }]
748
- },
749
- {
750
- ..._northern_tech_utils_constants.defaultPermissionSets.ManageUsers,
751
- action: _northern_tech_utils_constants.uiPermissionsById.manage.title,
752
- object: permissionSetObjectTypes.userManagement,
753
- description: "Set of permissions which allows user manage other user accounts",
754
- permissions: [{
755
- action: "http",
756
- object: {
757
- type: "any",
758
- value: "^/api/management/(v[1-9])/useradm/"
759
- }
760
- }]
761
- },
762
- {
763
- ..._northern_tech_utils_constants.defaultPermissionSets.ReadTenants,
764
- action: _northern_tech_utils_constants.uiPermissionsById.read.title,
765
- object: permissionSetObjectTypes.tenantManagement,
766
- description: "Set of permissions which allows user to list other tenants and their config",
767
- permissions: [{
768
- action: "http",
769
- object: {
770
- type: "GET",
771
- value: "^/api/management/(v[1-9])/tenantadm/"
772
- }
773
- }, {
774
- action: "http",
775
- object: {
776
- type: "POST",
777
- value: "^/api/management/(v[1-9])/tenantadm/"
778
- }
779
- }]
780
- },
781
- {
782
- ..._northern_tech_utils_constants.defaultPermissionSets.ManageTenants,
783
- action: _northern_tech_utils_constants.uiPermissionsById.manage.title,
784
- object: permissionSetObjectTypes.tenantManagement,
785
- description: "Set of permissions which allows user to manage other tenants and their config",
786
- permissions: [
787
- {
788
- action: "http",
789
- object: {
790
- type: "GET",
791
- value: "^/api/management/(v[1-9])/tenantadm/"
792
- }
793
- },
794
- {
795
- action: "http",
796
- object: {
797
- type: "POST",
798
- value: "^/api/management/(v[1-9])/tenantadm/"
799
- }
800
- },
801
- {
802
- action: "http",
803
- object: {
804
- type: "PUT",
805
- value: "^/api/management/(v[1-9])/tenantadm/"
806
- }
807
- }
808
- ]
809
- },
810
- {
811
- ..._northern_tech_utils_constants.defaultPermissionSets.ReadAuditLogs,
812
- action: _northern_tech_utils_constants.uiPermissionsById.read.title,
813
- object: "System Audit Log",
814
- description: "Set of permissions which allows user to view system audit log",
815
- permissions: [{
816
- action: "http",
817
- object: {
818
- type: "GET",
819
- value: "^/api/management/(v[1-9]|0.1.0)/auditlogs/logs"
820
- }
821
- }]
822
- },
823
- {
824
- ..._northern_tech_utils_constants.defaultPermissionSets.DeployToDevices,
825
- action: "Deploy",
826
- object: permissionSetObjectTypes.groups,
827
- description: "Set of permissions which allows user to deploy to devices",
828
- permissions: [{
829
- action: "http",
830
- object: {
831
- type: "any",
832
- value: "^/api/management/(v[1-9])/(deployments|deviceconfig)/"
833
- }
834
- }],
835
- supported_scope_types: [_northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType]
836
- },
837
- {
838
- ..._northern_tech_utils_constants.defaultPermissionSets.ConfigureDevices,
839
- action: "Configure",
840
- object: permissionSetObjectTypes.groups,
841
- description: "Set of permissions which allows user to manage configuration of the devices",
842
- permissions: [{
843
- action: "http",
844
- object: {
845
- type: "any",
846
- value: "^/api/management/(v[1-9])/deviceconfig/"
847
- }
848
- }],
849
- supported_scope_types: [_northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType]
850
- },
851
- {
852
- ..._northern_tech_utils_constants.defaultPermissionSets.ConnectToDevices,
853
- action: "Connect",
854
- object: permissionSetObjectTypes.groups,
855
- description: "Set of permissions which allows user to use remote terminal and file transfer",
856
- permissions: [
857
- {
858
- action: "http",
859
- object: {
860
- type: "GET",
861
- value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+/connect$"
862
- }
863
- },
864
- {
865
- action: "http",
866
- object: {
867
- type: "GET",
868
- value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+/download\\?path=[^&]+$"
869
- }
870
- },
871
- {
872
- action: "http",
873
- object: {
874
- type: "PUT",
875
- value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+/upload$"
876
- }
877
- }
878
- ],
879
- supported_scope_types: [_northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType]
880
- },
881
- {
882
- ..._northern_tech_utils_constants.defaultPermissionSets.SuperUser,
883
- action: "Any",
884
- object: permissionSetObjectTypes.any,
885
- description: "Set of permissions which allows user to do anything",
886
- permissions: [{
887
- action: "any",
888
- object: {
889
- type: "any",
890
- value: "any"
891
- }
892
- }]
893
- },
894
- {
895
- ..._northern_tech_utils_constants.defaultPermissionSets.UploadArtifacts,
896
- action: "Upload",
897
- object: permissionSetObjectTypes.artifacts,
898
- description: "Set of permissions which allows user to upload artifacts",
899
- permissions: [{
900
- action: "http",
901
- object: {
902
- type: "POST",
903
- value: commonEndpoints.artifacts
904
- }
905
- }, {
906
- action: "http",
907
- object: {
908
- type: "POST",
909
- value: "^/api/management/v1/deployments/artifacts/generate"
910
- }
911
- }]
912
- },
913
- {
914
- ..._northern_tech_utils_constants.defaultPermissionSets.ReadDevices,
915
- action: _northern_tech_utils_constants.uiPermissionsById.read.title,
916
- object: permissionSetObjectTypes.groups,
917
- description: "Set of permissions which allows user to view devices",
918
- permissions: [
919
- {
920
- action: "http",
921
- object: {
922
- type: "POST",
923
- value: "^/api/management/v2/inventory/filters/search"
924
- }
925
- },
926
- {
927
- action: "http",
928
- object: {
929
- type: "GET",
930
- value: "^/api/management/(v[1-9])/(deployments|devauth|inventory|deviceconfig|devicemonitor)/"
931
- }
932
- },
933
- {
934
- action: "http",
935
- object: {
936
- type: "GET",
937
- value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+$"
938
- }
939
- }
940
- ],
941
- supported_scope_types: [_northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType]
942
- },
943
- {
944
- ..._northern_tech_utils_constants.defaultPermissionSets.ManageDevices,
945
- action: _northern_tech_utils_constants.uiPermissionsById.manage.title,
946
- object: permissionSetObjectTypes.groups,
947
- description: "Set of permissions which allows user to manage devices",
948
- permissions: [
949
- {
950
- action: "http",
951
- object: {
952
- type: "POST",
953
- value: commonEndpoints.deviceManagement
954
- }
955
- },
956
- {
957
- action: "http",
958
- object: {
959
- type: "PUT",
960
- value: commonEndpoints.deviceManagement
961
- }
962
- },
963
- {
964
- action: "http",
965
- object: {
966
- type: "DELETE",
967
- value: commonEndpoints.deviceManagement
968
- }
969
- }
970
- ],
971
- supported_scope_types: [_northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType]
972
- },
973
- {
974
- ..._northern_tech_utils_constants.defaultPermissionSets.ReadReleases,
975
- action: _northern_tech_utils_constants.uiPermissionsById.read.title,
976
- object: permissionSetObjectTypes.releases,
977
- description: "Set of permissions which allows user to view releases",
978
- permissions: [
979
- {
980
- action: "http",
981
- object: {
982
- type: "GET",
983
- value: commonEndpoints.artifacts
984
- }
985
- },
986
- {
987
- action: "http",
988
- object: {
989
- type: "GET",
990
- value: commonEndpoints.artifactDetails
991
- }
992
- },
993
- {
994
- action: "http",
995
- object: {
996
- type: "GET",
997
- value: "^/api/management/v1/deployments/artifacts/[^/]+/download"
998
- }
999
- },
1000
- {
1001
- action: "http",
1002
- object: {
1003
- type: "GET",
1004
- value: "^/api/management/v1alpha1/deployments/software"
1005
- }
1006
- }
1007
- ]
1008
- },
1009
- {
1010
- name: "almostAdmin",
1011
- object: permissionSetObjectTypes.empty,
1012
- description: "Set containing all the permissions.",
1013
- permissions: [
1014
- {
1015
- action: "http",
1016
- object: {
1017
- type: "any",
1018
- value: "^/api/management/(v[1-9])/auditlogs/.*"
1019
- }
1020
- },
1021
- {
1022
- action: "http",
1023
- object: {
1024
- type: "any",
1025
- value: "^/api/management/(v[1-9])/deployments/.*"
1026
- }
1027
- },
1028
- {
1029
- action: "http",
1030
- object: {
1031
- type: "any",
1032
- value: "^/api/management/(v[1-9])/deployments/config/.*"
1033
- }
1034
- },
1035
- {
1036
- action: "http",
1037
- object: {
1038
- type: "any",
1039
- value: "^/api/management/(v[1-9])/deployments/deployments/.*"
1040
- }
1041
- },
1042
- {
1043
- action: "http",
1044
- object: {
1045
- type: "any",
1046
- value: "^/api/management/(v[1-9])/deployments/deployments/releases/.*"
1047
- }
1048
- },
1049
- {
1050
- action: "http",
1051
- object: {
1052
- type: "GET",
1053
- value: "^/api/management/v1alpha1/deployments/*"
1054
- }
1055
- },
1056
- {
1057
- action: "http",
1058
- object: {
1059
- type: "any",
1060
- value: "^/api/management/(v[1-9])/devauth/.*"
1061
- }
1062
- },
1063
- {
1064
- action: "http",
1065
- object: {
1066
- type: "any",
1067
- value: "^/api/management/(v[1-9])/deviceconfig/.*"
1068
- }
1069
- },
1070
- {
1071
- action: "http",
1072
- object: {
1073
- type: "any",
1074
- value: "^/api/management/(v[1-9])/deviceconnect/.*"
1075
- }
1076
- },
1077
- {
1078
- action: "http",
1079
- object: {
1080
- type: "any",
1081
- value: "^/api/management/(v[1-9])/deviceconnect/devices"
1082
- }
1083
- },
1084
- {
1085
- action: "http",
1086
- object: {
1087
- type: "any",
1088
- value: "^/api/management/(v[1-9])/inventory/.*"
1089
- }
1090
- },
1091
- {
1092
- action: "http",
1093
- object: {
1094
- type: "any",
1095
- value: "^/api/management/(v[1-9])/iot-manager/.*"
1096
- }
1097
- },
1098
- {
1099
- action: "http",
1100
- object: {
1101
- type: "any",
1102
- value: "^/api/management/(v[1-9])/monitor/.*"
1103
- }
1104
- },
1105
- {
1106
- action: "http",
1107
- object: {
1108
- type: "any",
1109
- value: "^/api/management/(v[1-9])/useradm/.*"
1110
- }
1111
- }
1112
- ]
1113
- }
1114
- ];
1115
- const rbacRoles = [
1116
- {
1117
- name: "dyn",
1118
- description: "",
1119
- permissions: [{
1120
- action: "CREATE_DEPLOYMENT",
1121
- object: {
1122
- type: "DEVICE_GROUP",
1123
- value: "dyn"
1124
- }
1125
- }, {
1126
- action: "VIEW_DEVICE",
1127
- object: {
1128
- type: "DEVICE_GROUP",
1129
- value: "dyn"
1130
- }
1131
- }]
1132
- },
1133
- {
1134
- name: "asdasd",
1135
- description: "123",
1136
- permissions: [{
1137
- action: "http",
1138
- object: {
1139
- type: "any",
1140
- value: "/api/management/v1/useradm/.*"
1141
- }
1142
- }]
1143
- },
1144
- {
1145
- name: "141sasd",
1146
- description: "1313adg",
1147
- permission_sets_with_scope: [
1148
- {
1149
- ..._northern_tech_utils_constants.defaultPermissionSets.ReadDevices,
1150
- scope: {
1151
- type: _northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType,
1152
- value: ["bestgroup"]
1153
- }
1154
- },
1155
- {
1156
- ..._northern_tech_utils_constants.defaultPermissionSets.ConnectToDevices,
1157
- scope: {
1158
- type: _northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType,
1159
- value: ["bestgroup"]
1160
- }
1161
- },
1162
- { ..._northern_tech_utils_constants.defaultPermissionSets.ManageUsers }
1163
- ]
1164
- },
1165
- {
1166
- name: "kljlkk",
1167
- description: "lkl",
1168
- permission_sets_with_scope: [{
1169
- ..._northern_tech_utils_constants.defaultPermissionSets.ConnectToDevices,
1170
- scope: {
1171
- type: _northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType,
1172
- value: ["bestgroup"]
1173
- }
1174
- }]
1175
- },
1176
- {
1177
- name: "yyyyy",
1178
- description: "asd",
1179
- permission_sets_with_scope: [{
1180
- ..._northern_tech_utils_constants.defaultPermissionSets.ManageDevices,
1181
- scope: {
1182
- type: _northern_tech_utils_constants.scopedPermissionAreas.groups.scopeType,
1183
- value: ["dockerclient"]
1184
- }
1185
- }, { ..._northern_tech_utils_constants.defaultPermissionSets.ManageReleases }]
1186
- },
1187
- {
1188
- name: "RBAC_ROLE_DEPLOYMENTS_MANAGER",
1189
- description: "Intended for users responsible for managing deployments, this role can create and abort deployments",
1190
- permission_sets_with_scope: [{ ..._northern_tech_utils_constants.defaultPermissionSets.DeployToDevices }]
1191
- },
1192
- {
1193
- name: "RBAC_ROLE_REMOTE_TERMINAL",
1194
- description: `Intended for tech support accounts, this role can access the devices' Remote Terminal.`,
1195
- permission_sets_with_scope: [{ ..._northern_tech_utils_constants.defaultPermissionSets.ConnectToDevices }]
1196
- },
1197
- {
1198
- name: "RBAC_ROLE_PERMIT_ALL",
1199
- description: "",
1200
- permission_sets_with_scope: [{ ..._northern_tech_utils_constants.defaultPermissionSets.SuperUser }]
1201
- },
1202
- {
1203
- name: "RBAC_ROLE_OBSERVER",
1204
- description: "Intended for team leaders or limited tech support accounts, this role can see all Devices, Artifacts and Deployment reports but not make any changes.",
1205
- permission_sets_with_scope: [{ ..._northern_tech_utils_constants.defaultPermissionSets.ReadReleases }, { ..._northern_tech_utils_constants.defaultPermissionSets.ReadDevices }]
1206
- },
1207
- {
1208
- name: "RBAC_ROLE_CI",
1209
- description: "Intended for automation accounts building software (e.g. CI/CD systems), this role can only manage Artifacts, including upload new Artifacts and delete Artifacts. It does not have access to Devices or Deployments.",
1210
- permission_sets_with_scope: [
1211
- { ..._northern_tech_utils_constants.defaultPermissionSets.ReadReleases },
1212
- { ..._northern_tech_utils_constants.defaultPermissionSets.ManageReleases },
1213
- { ..._northern_tech_utils_constants.defaultPermissionSets.UploadArtifacts }
1214
- ]
1215
- },
1216
- {
1217
- name: "almostAdmin",
1218
- description: "almost admin rights",
1219
- permissions: permissionSets.find((item) => item.name === "almostAdmin")?.permissions
1220
- },
1221
- {
1222
- name: "almostAdminNew",
1223
- description: "almost admin rights",
1224
- permission_sets_with_scope: Object.values(_northern_tech_utils_constants.defaultPermissionSets)
1225
- }
1226
- ];
1227
- const expectedParsedRoles = {
1228
- "141sasd": {
1229
- editable: true,
1230
- isCustom: void 0,
1231
- uiPermissions: {
1232
- ..._northern_tech_utils_constants.emptyUiPermissions,
1233
- groups: { bestgroup: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.connect.value] },
1234
- userManagement: [_northern_tech_utils_constants.uiPermissionsById.manage.value]
1235
- }
1236
- },
1237
- asdasd: {
1238
- editable: false,
1239
- isCustom: true,
1240
- uiPermissions: {
1241
- ..._northern_tech_utils_constants.emptyUiPermissions,
1242
- userManagement: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.manage.value]
1243
- }
1244
- },
1245
- dyn: {
1246
- editable: false,
1247
- isCustom: true,
1248
- uiPermissions: {
1249
- ..._northern_tech_utils_constants.emptyUiPermissions,
1250
- deployments: [_northern_tech_utils_constants.uiPermissionsById.deploy.value],
1251
- groups: { dyn: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.deploy.value] }
1252
- }
1253
- },
1254
- kljlkk: {
1255
- editable: true,
1256
- isCustom: false,
1257
- uiPermissions: {
1258
- ..._northern_tech_utils_constants.emptyUiPermissions,
1259
- groups: { bestgroup: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.connect.value] }
1260
- }
1261
- },
1262
- yyyyy: {
1263
- editable: true,
1264
- isCustom: void 0,
1265
- uiPermissions: {
1266
- ..._northern_tech_utils_constants.emptyUiPermissions,
1267
- groups: { dockerclient: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.manage.value] },
1268
- releases: { [_northern_tech_utils_constants.ALL_SOFTWARE]: [_northern_tech_utils_constants.uiPermissionsById.manage.value] }
1269
- }
1270
- },
1271
- almostAdmin: {
1272
- editable: false,
1273
- isCustom: true,
1274
- uiPermissions: {
1275
- ..._northern_tech_utils_constants.emptyUiPermissions,
1276
- auditlog: [_northern_tech_utils_constants.uiPermissionsById.read.value],
1277
- deployments: [
1278
- _northern_tech_utils_constants.uiPermissionsById.manage.value,
1279
- _northern_tech_utils_constants.uiPermissionsById.deploy.value,
1280
- _northern_tech_utils_constants.uiPermissionsById.read.value
1281
- ],
1282
- groups: { [_northern_tech_utils_constants.ALL_DEVICES]: [
1283
- _northern_tech_utils_constants.uiPermissionsById.read.value,
1284
- _northern_tech_utils_constants.uiPermissionsById.manage.value,
1285
- _northern_tech_utils_constants.uiPermissionsById.connect.value,
1286
- _northern_tech_utils_constants.uiPermissionsById.configure.value
1287
- ] },
1288
- releases: { [_northern_tech_utils_constants.ALL_SOFTWARE]: [
1289
- _northern_tech_utils_constants.uiPermissionsById.read.value,
1290
- _northern_tech_utils_constants.uiPermissionsById.upload.value,
1291
- _northern_tech_utils_constants.uiPermissionsById.manage.value
1292
- ] },
1293
- userManagement: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.manage.value]
1294
- }
1295
- },
1296
- almostAdminNew: {
1297
- editable: true,
1298
- isCustom: void 0,
1299
- uiPermissions: {
1300
- ..._northern_tech_utils_constants.emptyUiPermissions,
1301
- auditlog: [_northern_tech_utils_constants.uiPermissionsById.read.value],
1302
- deployments: [
1303
- _northern_tech_utils_constants.uiPermissionsById.read.value,
1304
- _northern_tech_utils_constants.uiPermissionsById.deploy.value,
1305
- _northern_tech_utils_constants.uiPermissionsById.manage.value
1306
- ],
1307
- groups: { [_northern_tech_utils_constants.ALL_DEVICES]: [
1308
- _northern_tech_utils_constants.uiPermissionsById.read.value,
1309
- _northern_tech_utils_constants.uiPermissionsById.manage.value,
1310
- _northern_tech_utils_constants.uiPermissionsById.deploy.value,
1311
- _northern_tech_utils_constants.uiPermissionsById.connect.value,
1312
- _northern_tech_utils_constants.uiPermissionsById.configure.value
1313
- ] },
1314
- releases: { [_northern_tech_utils_constants.ALL_SOFTWARE]: [
1315
- _northern_tech_utils_constants.uiPermissionsById.manage.value,
1316
- _northern_tech_utils_constants.uiPermissionsById.upload.value,
1317
- _northern_tech_utils_constants.uiPermissionsById.read.value
1318
- ] },
1319
- tenantManagement: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.manage.value],
1320
- userManagement: [_northern_tech_utils_constants.uiPermissionsById.read.value, _northern_tech_utils_constants.uiPermissionsById.manage.value]
1321
- }
1322
- }
1323
- };
1324
- const defaultRolesById = {
1325
- ..._northern_tech_utils_constants.rolesById,
1326
- test: {
1327
- ..._northern_tech_utils_constants.emptyRole,
1328
- name: "test",
1329
- description: "test description",
1330
- editable: true,
1331
- uiPermissions: {
1332
- ..._northern_tech_utils_constants.emptyUiPermissions,
1333
- groups: { testGroup: [_northern_tech_utils_constants.uiPermissionsById.read.value] },
1334
- releases: { bar: [_northern_tech_utils_constants.uiPermissionsById.read.value] }
1335
- }
1336
- }
1337
- };
1338
- const receivedRoles = rbacRoles.reduce((accu, role) => {
1339
- const { name, description, ...roleRemainder } = role;
1340
- if (name.startsWith("RBAC")) accu[name] = {
1341
- ...defaultRolesById[name],
1342
- ...roleRemainder,
1343
- editable: false,
1344
- isCustom: false,
1345
- description: defaultRolesById[name].description ? defaultRolesById[name].description : description
1346
- };
1347
- else {
1348
- const result = expectedParsedRoles[name] ?? {};
1349
- accu[name] = {
1350
- ..._northern_tech_utils_constants.emptyRole,
1351
- ...role,
1352
- ...result,
1353
- name
1354
- };
1355
- }
1356
- return accu;
1357
- }, { ...defaultRolesById });
1358
- const receivedPermissionSets = permissionSets.reduce((accu, set) => {
1359
- const result = _northern_tech_utils_constants.defaultPermissionSets[set.name]?.result ?? {};
1360
- accu[set.name] = {
1361
- ...set,
1362
- result: {
1363
- ..._northern_tech_utils_constants.emptyUiPermissions,
1364
- ...result
1365
- }
1366
- };
1367
- return accu;
1368
- }, {});
1369
- const ssoEndpoint = {
1370
- id: "1",
1371
- saml: {
1372
- entity_id: "https://hosted.mender.io/api/management/v1/useradm/sso/sp/metadata/1",
1373
- acs_url: "https://hosted.mender.io/api/management/v1/useradm/auth/sso/1/acs",
1374
- start_url: "https://hosted.mender.io/api/management/v1/useradm/auth/sso/1/login"
1375
- },
1376
- oidc: {
1377
- callback_url: "https://hosted.mender.io/api/management/v1/useradm/oidc/1/callback",
1378
- start_url: "https://hosted.mender.io/api/management/v1/useradm/oidc/1/start"
1379
- }
1380
- };
1381
- //#endregion
1382
- exports.TEST_SESSION_DATETIME = TEST_SESSION_DATETIME;
1383
- exports.accessTokens = accessTokens;
1384
- exports.adminUserCapabilities = adminUserCapabilities;
1385
- exports.defaultCreationDate = defaultCreationDate;
1386
- exports.defaultMacAddress = defaultMacAddress;
1387
- exports.defaultPassword = defaultPassword;
1388
- exports.manifestsList = manifestsList;
1389
- exports.menderEnvironment = menderEnvironment;
1390
- exports.mockApiResponses = mockApiResponses;
1391
- exports.mockDate = mockDate;
1392
- exports.pendingEmailChange = pendingEmailChange;
1393
- exports.permissionSets = permissionSets;
1394
- exports.rbacRoles = rbacRoles;
1395
- exports.receivedPermissionSets = receivedPermissionSets;
1396
- exports.receivedRoles = receivedRoles;
1397
- exports.releasesList = releasesList;
1398
- exports.softwareList = softwareList;
1399
- exports.spTenantLimits = spTenantLimits;
1400
- exports.ssoEndpoint = ssoEndpoint;
1401
- exports.tenants = tenants;
1402
- exports.testSsoId = testSsoId;
1403
- exports.token = token;
1404
- exports.undefineds = undefineds;
1405
- exports.userId = userId;
1406
- exports.webhookEvents = webhookEvents;
1407
-
1408
- //# sourceMappingURL=mockData.cjs.map