scimgateway 6.1.7 → 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,12 @@ 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
+
1306
1312
  ### v6.1.7
1307
1313
 
1308
1314
  [Fixed]
package/lib/logger.ts CHANGED
@@ -297,7 +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
- if (typeof obj === 'object' && !Array.isArray(obj)) obj = JSON.parse(this.maskSecret(JSON.stringify(obj)))
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
+ }
301
307
  const msgObj: Record<string, any> = {
302
308
  time,
303
309
  level,
@@ -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: ctx.request.body,
551
+ requestBody: JSON.stringify(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.7",
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)",