scimgateway 5.3.1 → 5.3.2
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 +7 -0
- package/lib/helper-rest.ts +1 -1
- package/lib/logger.ts +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1405,6 +1405,13 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
|
|
|
1405
1405
|
|
|
1406
1406
|
## Change log
|
|
1407
1407
|
|
|
1408
|
+
### v5.3.2
|
|
1409
|
+
|
|
1410
|
+
[Improved]
|
|
1411
|
+
|
|
1412
|
+
- helper-rest, retry on request error 504 Gateway Timeout
|
|
1413
|
+
- performance micro-optimization on log mask logic
|
|
1414
|
+
|
|
1408
1415
|
### v5.3.1
|
|
1409
1416
|
|
|
1410
1417
|
[Fixed]
|
package/lib/helper-rest.ts
CHANGED
|
@@ -699,7 +699,7 @@ export class HelperRest {
|
|
|
699
699
|
try { urlObj = new URL(path) } catch (err) { void 0 }
|
|
700
700
|
let isServiceClient = !urlObj && this._serviceClient[baseEntity] && !this.lock.isLocked() // !isLocked to avoid retry ongoing doRequest with failing getAccessToken()
|
|
701
701
|
let oAuthTokeErr = statusCode === 401 && this.config_entity[baseEntity].connection?.auth?.type && this.config_entity[baseEntity].connection.auth.type.startsWith('oauth')
|
|
702
|
-
if (isServiceClient && (err.code === 'ECONNREFUSED' || err.code === 'ENOTFOUND' || err.code === 'ABORT_ERR' || err.code === 'ETIMEDOUT' || oAuthTokeErr || retryAfter)) {
|
|
702
|
+
if (isServiceClient && (err.code === 'ECONNREFUSED' || err.code === 'ENOTFOUND' || err.code === 'ABORT_ERR' || err.code === 'ETIMEDOUT' || statusCode === 504 || oAuthTokeErr || retryAfter)) {
|
|
703
703
|
this.scimgateway.logDebug(baseEntity, `doRequest ${method} ${path} Body = ${JSON.stringify(body)} Error Response = ${err.message}`)
|
|
704
704
|
if (retryAfter) {
|
|
705
705
|
this.scimgateway.logDebug(baseEntity, `doRequest ${method} ${path} throttle/ratelimit error - awaiting ${retryAfter} seconds before automatic retry`)
|
package/lib/logger.ts
CHANGED
|
@@ -176,21 +176,23 @@ export class Logger {
|
|
|
176
176
|
msg = msg.replace(
|
|
177
177
|
this.reJson,
|
|
178
178
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
179
|
-
(_, keyValuePair, value) => `${keyValuePair}"
|
|
179
|
+
(_, keyValuePair, value) => `${keyValuePair}"******"`,
|
|
180
180
|
)
|
|
181
181
|
|
|
182
182
|
// Mask JSON path/value secrets (SCIM 2.0 PATCH Operations)
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
if (msg.includes('"path"')) {
|
|
184
|
+
msg = msg.replace(
|
|
185
|
+
this.reJsonPathValue,
|
|
186
|
+
(_, prefix, value, suffix) => `${prefix}******${suffix}`,
|
|
187
|
+
)
|
|
188
|
+
}
|
|
187
189
|
|
|
188
|
-
if (msg.includes('<?xml')) {
|
|
189
190
|
// Mask XML/Soap secrets
|
|
190
191
|
// console.log('XML matches found:', msg.match(this.reXml)
|
|
192
|
+
if (msg.includes('<?xml')) {
|
|
191
193
|
msg = msg.replace(
|
|
192
194
|
this.reXml,
|
|
193
|
-
(_, startTag, tagName, value, endTag) => `${startTag}
|
|
195
|
+
(_, startTag, tagName, value, endTag) => `${startTag}******${endTag}`,
|
|
194
196
|
)
|
|
195
197
|
}
|
|
196
198
|
|
package/package.json
CHANGED