@manyos/smileconnect-api 1.46.4 → 1.48.0

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.
package/app.js CHANGED
@@ -50,6 +50,7 @@ const https = require('https');
50
50
  const maxHTTPSockets = process.env.MAX_HTTP_SOCKETS || 10;
51
51
 
52
52
  const SSO_CLIENTNAME_ATTRIBUTE = process.env.SSO_CLIENTNAME_ATTRIBUTE || 'azp';
53
+ const SSO_USERNAME_ATTRIBUTE = process.env.SSO_USERNAME_ATTRIBUTE || 'preferred_username';
53
54
 
54
55
  http.globalAgent.maxSockets = maxHTTPSockets;
55
56
  https.globalAgent.maxSockets = maxHTTPSockets;
@@ -157,7 +158,7 @@ passport.use(
157
158
  'scope': jwt_payload.scope,
158
159
  'exp': jwt_payload.exp,
159
160
  'config': clientConfig,
160
- 'username': jwt_payload.preferred_username
161
+ 'username': jwt_payload[SSO_USERNAME_ATTRIBUTE]
161
162
  }
162
163
  log.debug('Passport User', jwt_payload);
163
164
  const resource_access = jwt_payload.resource_access;
@@ -7,6 +7,7 @@ const basePath = 'conf';
7
7
  const basePathGlobalScripts = basePath + '/scripts';
8
8
 
9
9
  const fetch = require('node-fetch');
10
+ const xmlParser = require('fast-xml-parser')
10
11
 
11
12
  const {getClients} = require('../util/config');
12
13
 
@@ -79,6 +80,7 @@ async function executeCode(code, requestData, params, logStream, executedByScrip
79
80
  adapter,
80
81
  log,
81
82
  clientId,
83
+ xmlParser,
82
84
  script:executeScriptByScript,
83
85
  globalScriptParams,
84
86
  env: process.env,
@@ -86,6 +86,16 @@ Sample:
86
86
 
87
87
  *SSO_CLIENTNAME_ATTRIBUTE = "preferred_username"*
88
88
 
89
+ ### SSO_USERNAME_ATTRIBUTE
90
+
91
+ The attribute that contains the user name in the token. User name is used to identify admins. It is only needed for configuration.
92
+
93
+ Default: *preferred_username*
94
+
95
+ Sample:
96
+
97
+ *SSO_CLIENTNAME_ATTRIBUTE = "email"*
98
+
89
99
  ### ADMIN_USERS
90
100
 
91
101
  List of users who are allowed to access /v1/appconfig endpoints.
@@ -267,6 +277,34 @@ Sample:
267
277
 
268
278
  *SSO_ISSUER=https://sso.mydomain.io/auth/realms/itsmproxy*
269
279
 
280
+ ### SSO_CLIENTNAME_ATTRIBUTE
281
+
282
+ The attribute that contains the client name in the token.
283
+
284
+ Default: *azp*
285
+
286
+ Set this value if you only want to use a single client in the SSO and service accounts as clients in SMILEconnect. This can be used to manage your SMILEconnect clients via a directory service like LDAP/AD. [More Info](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.3)
287
+
288
+ Sample:
289
+
290
+ *SSO_CLIENTNAME_ATTRIBUTE = "preferred_username"*
291
+
292
+ ### SSO_USERNAME_ATTRIBUTE
293
+
294
+ The attribute that contains the user name in the token. User name is used to identify admins. It is only needed for configuration.
295
+
296
+ Default: *preferred_username*
297
+
298
+ Sample:
299
+
300
+ *SSO_CLIENTNAME_ATTRIBUTE = "email"*
301
+
302
+ ### ADMIN_USERS
303
+
304
+ List of users who are allowed to access /v1/appconfig endpoints.
305
+
306
+ Sample:
307
+ ADMIN_USERS=username1, username2
270
308
 
271
309
  ## Logging
272
310
 
@@ -306,6 +344,22 @@ The URL of the OIDC Provider for user authentication
306
344
  Sample:
307
345
  *REACT_APP_SSO_URL=https://sso.mydomain.io/auth/realms/itsmproxy*
308
346
 
347
+ since version 1.5.2:
348
+ For manual OICD endpoint configuration you must provide all of the following parameters:
349
+ *REACT_APP_OIDC_AUTHORIZATION_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/auth*
350
+ *REACT_APP_OIDC_USERINFO_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/userinfo*
351
+ *REACT_APP_OIDC_END_SESSION_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/logout*
352
+ *REACT_APP_OIDC_JWKS_URI=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/certs*
353
+ *REACT_APP_OIDC_TOKEN_ENDPOINT=https://sso.mydomain.io/auth/realms/itsmproxy/protocol/openid-connect/token*
354
+
355
+ To allow Authorization Flow with PKCE set
356
+ REACT_APP_OIDC_RESPONSE_TYPE=code
357
+ Default value is "token id_token", which uses Implicit Flow.
358
+
359
+ Use REACT_APP_OIDC_TOKEN to choose the token to use. Default is access_token
360
+
361
+ Use REACT_APP_OIDC_SCOPE to choose the oidc scope
362
+
309
363
  ## GUI
310
364
 
311
365
  ### REACT_APP_GUI_URL
package/docs/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.2",
3
3
  "info": {
4
4
  "title": "SMILEconnect",
5
- "version": "1.41.4",
5
+ "version": "1.47.0",
6
6
  "contact": {
7
7
  "name": "manyos technology GmbH",
8
8
  "url": "https://manyos.it",
@@ -4330,6 +4330,212 @@
4330
4330
  "required": false
4331
4331
  }
4332
4332
  ]
4333
+ },
4334
+ "/customForms/{formAlias}": {
4335
+ "get": {
4336
+ "tags": [
4337
+ "CustomForms"
4338
+ ],
4339
+ "parameters": [
4340
+ {
4341
+ "name": "limit",
4342
+ "description": "limit the number of results returned",
4343
+ "schema": {
4344
+ "type": "integer"
4345
+ },
4346
+ "in": "query",
4347
+ "required": false
4348
+ },
4349
+ {
4350
+ "name": "offset",
4351
+ "description": "offset used for pagination together with limit",
4352
+ "schema": {
4353
+ "type": "integer"
4354
+ },
4355
+ "in": "query",
4356
+ "required": false
4357
+ }
4358
+ ],
4359
+ "responses": {
4360
+ "200": {
4361
+ "$ref": "#/components/responses/CustomFormResponseArray"
4362
+ }
4363
+ },
4364
+ "security": [
4365
+ {
4366
+ "OIDC": [
4367
+ ]
4368
+ }
4369
+ ],
4370
+ "summary": "Receive all records of the custom from",
4371
+ "description": "Will return all records that are found based on the defined base query and the set limits"
4372
+ },
4373
+ "post": {
4374
+ "requestBody": {
4375
+ "content": {
4376
+ "application/json": {
4377
+ "schema": {
4378
+ "$ref": "#/components/schemas/CustomFormRequest"
4379
+ }
4380
+ }
4381
+ },
4382
+ "required": true
4383
+ },
4384
+ "tags": [
4385
+ "CustomForms"
4386
+ ],
4387
+ "responses": {
4388
+ "200": {
4389
+ "$ref": "#/components/responses/CustomFormResponseSingle"
4390
+ }
4391
+ },
4392
+ "security": [
4393
+ {
4394
+ "OIDC": [
4395
+ ]
4396
+ }
4397
+ ],
4398
+ "summary": "Create a new record",
4399
+ "description": "Create a new record in the custom form"
4400
+ },
4401
+ "parameters": [
4402
+ {
4403
+ "name": "formAlias",
4404
+ "description": "The configured alias name of the custom form.",
4405
+ "schema": {
4406
+ "type": "string"
4407
+ },
4408
+ "in": "path",
4409
+ "required": true
4410
+ }
4411
+ ]
4412
+ },
4413
+ "/customForms/{formAlias}/search": {
4414
+ "post": {
4415
+ "requestBody": {
4416
+ "content": {
4417
+ "application/json": {
4418
+ "schema": {
4419
+ "$ref": "#/components/schemas/SearchRequest"
4420
+ }
4421
+ }
4422
+ },
4423
+ "required": true
4424
+ },
4425
+ "tags": [
4426
+ "CustomForms"
4427
+ ],
4428
+ "responses": {
4429
+ "200": {
4430
+ "$ref": "#/components/responses/CustomFormResponseArray"
4431
+ }
4432
+ },
4433
+ "security": [
4434
+ {
4435
+ "OIDC": [
4436
+ ]
4437
+ }
4438
+ ],
4439
+ "summary": "Execute a search in a custom form"
4440
+ },
4441
+ "parameters": [
4442
+ {
4443
+ "examples": {
4444
+ "sample": {
4445
+ "value": "abc123"
4446
+ }
4447
+ },
4448
+ "name": "impersonateUser",
4449
+ "description": "If the clientConfig has the option allowDynamicImpersonate set to *true* then the URL Parameter *impersonateUser* can be used to determine the used Remedy User.",
4450
+ "schema": {
4451
+ "type": "string"
4452
+ },
4453
+ "in": "query",
4454
+ "required": false
4455
+ },
4456
+ {
4457
+ "name": "formAlias",
4458
+ "description": "The configured alias name of the custom form.",
4459
+ "schema": {
4460
+ "type": "string"
4461
+ },
4462
+ "in": "path",
4463
+ "required": true
4464
+ }
4465
+ ]
4466
+ },
4467
+ "/customForms/{formAlias}/{id}": {
4468
+ "get": {
4469
+ "tags": [
4470
+ "CustomForms"
4471
+ ],
4472
+ "responses": {
4473
+ "200": {
4474
+ "$ref": "#/components/responses/CustomFormResponseSingle"
4475
+ }
4476
+ },
4477
+ "security": [
4478
+ {
4479
+ "OIDC": [
4480
+ ]
4481
+ }
4482
+ ],
4483
+ "summary": "Get a single record",
4484
+ "description": "Receive a single record from a custom form, identified by its id."
4485
+ },
4486
+ "put": {
4487
+ "requestBody": {
4488
+ "content": {
4489
+ "application/json": {
4490
+ "schema": {
4491
+ "$ref": "#/components/schemas/CustomFormRequest"
4492
+ }
4493
+ }
4494
+ },
4495
+ "required": true
4496
+ },
4497
+ "tags": [
4498
+ "CustomForms"
4499
+ ],
4500
+ "responses": {
4501
+ "200": {
4502
+ "$ref": "#/components/responses/CustomFormResponseSingle"
4503
+ }
4504
+ },
4505
+ "security": [
4506
+ {
4507
+ "OIDC": [
4508
+ ]
4509
+ }
4510
+ ],
4511
+ "summary": "Update a record",
4512
+ "description": "Update a single record on a custom form, identified by its id."
4513
+ },
4514
+ "parameters": [
4515
+ {
4516
+ "name": "formAlias",
4517
+ "description": "The configured alias name of the custom form.",
4518
+ "schema": {
4519
+ "type": "string"
4520
+ },
4521
+ "in": "path",
4522
+ "required": true
4523
+ },
4524
+ {
4525
+ "examples": {
4526
+ "id": {
4527
+ "value": "ENV12345"
4528
+ }
4529
+ },
4530
+ "name": "id",
4531
+ "description": "The id record",
4532
+ "schema": {
4533
+ "type": "string"
4534
+ },
4535
+ "in": "path",
4536
+ "required": true
4537
+ }
4538
+ ]
4333
4539
  }
4334
4540
  },
4335
4541
  "components": {
@@ -16078,6 +16284,61 @@
16078
16284
  "text": "Status Marked: Resolved by Allen",
16079
16285
  "isPublic": true
16080
16286
  }
16287
+ },
16288
+ "CustomFormRecord": {
16289
+ "title": "Root Type for customFormRecord",
16290
+ "description": "A record stored in a custom form. The fields (besides id) are samples and will depend on the config.",
16291
+ "type": "object",
16292
+ "properties": {
16293
+ "id": {
16294
+ "type": "string"
16295
+ },
16296
+ "userId": {
16297
+ "type": "string"
16298
+ },
16299
+ "classId": {
16300
+ "type": "string"
16301
+ },
16302
+ "classTitle": {
16303
+ "type": "string"
16304
+ },
16305
+ "location": {
16306
+ "type": "string"
16307
+ },
16308
+ "startDate": {
16309
+ "type": "string"
16310
+ },
16311
+ "cost": {
16312
+ "format": "int32",
16313
+ "type": "integer"
16314
+ },
16315
+ "department": {
16316
+ "type": "string"
16317
+ }
16318
+ },
16319
+ "example": {
16320
+ "id": "00001",
16321
+ "userId": "Demo",
16322
+ "classId": "00001",
16323
+ "classTitle": "Managing Within the Law",
16324
+ "location": "Munich, Germany",
16325
+ "startDate": "Mon Nov 07 16:00:00 GMT 2005",
16326
+ "cost": 100,
16327
+ "department": "Sales"
16328
+ }
16329
+ },
16330
+ "CustomFormRequest": {
16331
+ "description": "Creates a new Record in a custum form",
16332
+ "required": [
16333
+ "data"
16334
+ ],
16335
+ "type": "object",
16336
+ "properties": {
16337
+ "data": {
16338
+ "$ref": "#/components/schemas/CustomFormRecord",
16339
+ "description": ""
16340
+ }
16341
+ }
16081
16342
  }
16082
16343
  },
16083
16344
  "responses": {
@@ -16169,6 +16430,39 @@
16169
16430
  }
16170
16431
  },
16171
16432
  "description": "Returns deletion confirmation for the requested item"
16433
+ },
16434
+ "CustomFormResponseSingle": {
16435
+ "content": {
16436
+ "application/json": {
16437
+ "schema": {
16438
+ "type": "object",
16439
+ "properties": {
16440
+ "data": {
16441
+ "$ref": "#/components/schemas/CustomFormRecord"
16442
+ }
16443
+ }
16444
+ }
16445
+ }
16446
+ },
16447
+ "description": "Returns a single custom form record"
16448
+ },
16449
+ "CustomFormResponseArray": {
16450
+ "content": {
16451
+ "application/json": {
16452
+ "schema": {
16453
+ "type": "object",
16454
+ "properties": {
16455
+ "data": {
16456
+ "type": "array",
16457
+ "items": {
16458
+ "$ref": "#/components/schemas/CustomFormRecord"
16459
+ }
16460
+ }
16461
+ }
16462
+ }
16463
+ }
16464
+ },
16465
+ "description": "Returns an array of Custom Form Records"
16172
16466
  }
16173
16467
  },
16174
16468
  "securitySchemes": {
@@ -16214,6 +16508,10 @@
16214
16508
  "name": "CMDBObjects",
16215
16509
  "description": ""
16216
16510
  },
16511
+ {
16512
+ "name": "CustomForms",
16513
+ "description": "All custom form requests"
16514
+ },
16217
16515
  {
16218
16516
  "name": "AppConfig",
16219
16517
  "description": "Application Configuration"
package/docs/releases.md CHANGED
@@ -2,11 +2,22 @@
2
2
 
3
3
  ## API
4
4
 
5
+ ### 1.48.0 - 03.11.21
6
+ Add parameter SSO_USERNAME_ATTRIBUTE to config.
7
+
8
+ ### 1.47.0 - 22.10.21
9
+ Add xmlParser to scripts.
10
+
11
+ See https://www.npmjs.com/package/fast-xml-parser
12
+
13
+ Add customForms
14
+
5
15
  ### 1.46.4 - 20.10.21
6
16
  Fix known issue: Check for activation Task Phase and activate if reached
7
17
 
8
18
  ### 1.46.3 - 18.10.21
9
19
  Fix issue: Task not activated when phase already active
20
+
10
21
  Known issues: Tasks might get activated early
11
22
 
12
23
  ### 1.46.2 - 14.10.21
@@ -41,7 +52,9 @@ Allow also "isPublic": "true" instead of "isPublic": true for Ticket Worklogs
41
52
 
42
53
  ### 1.43.0 - 20.09.21
43
54
  Allow bypassCache option in Remedy Adapter
55
+
44
56
  Add support for Task Phasing
57
+
45
58
  Regenrate Task Flow on Task Update
46
59
 
47
60
  ### 1.42.1 - 09.09.21
@@ -53,7 +66,9 @@ Add IDs to POST Actions for After Execution Scripts
53
66
  ### 1.41.4 - 10.08.21
54
67
 
55
68
  Fix mapping for Ticket Worklogs
69
+
56
70
  Fix mapping for Task Worklogs
71
+
57
72
  Fix issue with sort in Remedy Adapter
58
73
 
59
74
  ### 1.41.0 - 03.08.21
@@ -72,6 +87,9 @@ e.g.
72
87
 
73
88
  ## Event Manager
74
89
 
90
+ ### 1.18.0 - 03.11.21
91
+ Add parameter SSO_USERNAME_ATTRIBUTE to config.
92
+
75
93
  ### 1.17.1 - 01.10.21
76
94
  Fix issue: TicketNumber3 added to Event Data
77
95
 
@@ -88,6 +106,22 @@ Update Record added to [Remedy Adapter](adapter#remedy).
88
106
  The eventmanager will check all outbound webhooks for an event. If one fails, the whole Event will be set to error and the details will be added to the error message.
89
107
 
90
108
  ## GUI
109
+ ### 1.5.5 - 03.11.21
110
+ Add Parameter REACT_APP_OIDC_SCOPE to choose the oicd scope
111
+
112
+ ### 1.5.4 - 03.11.21
113
+ Add Parameter REACT_APP_OIDC_TOKEN to choose the token to use (access_token/id_token)
114
+
115
+ ### 1.5.3 - 03.11.21
116
+ Allow Authorization Flow with PKCE. Added Parameter: REACT_APP_OIDC_RESPONSE_TYPE.
117
+ Default value is "token id_token". To use Authorization Flow with PKCE you need to set "REACT_APP_OIDC_RESPONSE_TYPE=code"
118
+
119
+ ### 1.5.2 - 03.11.21
120
+ Fix: OIDC Endpoints URL are wrong for some OIDC Providers. Also added parameters for manual endpoint configuration
121
+
122
+ ### 1.5.1 - 22.10.21
123
+ Custom Forms added
124
+
91
125
 
92
126
  ### 1.4.18 - 11.08.21
93
127
  hovering on fields in mappingtable, destroys values in "new" mapping, in some situations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.46.4",
3
+ "version": "1.48.0",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {
@@ -23,6 +23,7 @@
23
23
  "express-rate-limit": "^5.2.6",
24
24
  "express-request-id": "^1.4.1",
25
25
  "express-validator": "^6.10.1",
26
+ "fast-xml-parser": "^3.20.3",
26
27
  "moment": "^2.29.1",
27
28
  "mongoose": "^5.12.5",
28
29
  "node-cache": "^4.2.1",