scimgateway 6.1.6 → 6.1.7

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/README.md CHANGED
@@ -1303,6 +1303,13 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1303
1303
 
1304
1304
  ## Change log
1305
1305
 
1306
+ ### v6.1.7
1307
+
1308
+ [Fixed]
1309
+
1310
+ - Incorrect masking of secrets in the final info log message for requests
1311
+ - plugin-entra, fixed an issue where creating a user with a manager sometimes failed
1312
+
1306
1313
  ### v6.1.6
1307
1314
 
1308
1315
  [Fixed]
package/lib/logger.ts CHANGED
@@ -297,6 +297,7 @@ export class Logger {
297
297
  private async log(level: 'debug' | 'info' | 'warn' | 'error', message: string, obj?: Record<string, any>) {
298
298
  const time = new Date().toISOString()
299
299
  message = this.maskSecret(message)
300
+ if (typeof obj === 'object' && !Array.isArray(obj)) obj = JSON.parse(this.maskSecret(JSON.stringify(obj)))
300
301
  const msgObj: Record<string, any> = {
301
302
  time,
302
303
  level,
@@ -251,17 +251,22 @@ scimgateway.createUser = async (baseEntity, userObj, ctx) => {
251
251
  addonObj.manager = userObj.manager
252
252
  delete userObj.manager
253
253
  }
254
+ if (userObj.proxyAddresses) {
255
+ addonObj.proxyAddresses = userObj.proxyAddresses
256
+ delete userObj.proxyAddresses
257
+ }
254
258
 
255
259
  const method = 'POST'
256
260
  const path = '/users'
257
261
  const [body] = scimgateway.endpointMapper('outbound', userObj, config.map.user)
258
262
 
259
263
  try {
260
- await helper.doRequest(baseEntity, method, path, body, ctx)
264
+ const res = await helper.doRequest(baseEntity, method, path, body, ctx)
261
265
  if (Object.keys(addonObj).length > 0) {
262
- await scimgateway.modifyUser(baseEntity, userObj.userName, addonObj, ctx) // manager, servicePlan
263
- return null
264
- } else return (null)
266
+ const id = res?.body?.id || userObj.userName
267
+ await scimgateway.modifyUser(baseEntity, id, addonObj, ctx) // manager, proxyAddresses, servicePlan
268
+ }
269
+ return null
265
270
  } catch (err: any) {
266
271
  const newErr = new Error(`${action} error: ${err.message}`)
267
272
  if (err.message.includes('userPrincipalName already exists')) newErr.name += '#409' // customErrCode
@@ -548,7 +548,7 @@ export class ScimGateway {
548
548
  status: ctx.response.status,
549
549
  method: ctx.request.method,
550
550
  url: ctx.request.url,
551
- requestBody: JSON.stringify(ctx.request.body),
551
+ requestBody: ctx.request.body,
552
552
  responseBody: outbound,
553
553
  }
554
554
  let msg = utils.statusText(logEvent.status)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scimgateway",
3
- "version": "6.1.6",
3
+ "version": "6.1.7",
4
4
  "type": "module",
5
5
  "description": "Using SCIM protocol as a gateway for user provisioning to other endpoints",
6
6
  "author": "Jarle Elshaug <jarle.elshaug@gmail.com> (https://elshaug.xyz)",