scimgateway 6.1.6 → 6.1.8

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,19 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1303
1303
 
1304
1304
  ## Change log
1305
1305
 
1306
+ ### v6.1.8
1307
+
1308
+ [Fixed]
1309
+
1310
+ - Incorrect masking of secrets in the final info log message for requests
1311
+
1312
+ ### v6.1.7
1313
+
1314
+ [Fixed]
1315
+
1316
+ - Incorrect masking of secrets in the final info log message for requests
1317
+ - plugin-entra, fixed an issue where creating a user with a manager sometimes failed
1318
+
1306
1319
  ### v6.1.6
1307
1320
 
1308
1321
  [Fixed]
package/lib/logger.ts CHANGED
@@ -297,6 +297,13 @@ 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
+
301
+ if (typeof obj === 'object' && !Array.isArray(obj)) {
302
+ obj = JSON.parse(JSON.stringify(obj, (_k, v) => {
303
+ if (typeof v === 'string') return this.maskSecret(v)
304
+ return v
305
+ }))
306
+ }
300
307
  const msgObj: Record<string, any> = {
301
308
  time,
302
309
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scimgateway",
3
- "version": "6.1.6",
3
+ "version": "6.1.8",
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)",