@ikonintegration/ikapi 3.0.19 → 3.0.20
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/package.json +1 -1
- package/src/Logger/IKLogger.js +4 -4
package/package.json
CHANGED
package/src/Logger/IKLogger.js
CHANGED
|
@@ -9,7 +9,7 @@ const LOG_STRINGS = ['DEBUG', 'INFO', 'WARN', 'ERROR'];
|
|
|
9
9
|
const PURE_CONSOLE = (console.flushLogs ? console.origin : console);
|
|
10
10
|
const DEFAULT_LOG_FUNCTION = PURE_CONSOLE.log.bind(PURE_CONSOLE);
|
|
11
11
|
//
|
|
12
|
-
const blacklist = ['password','phonenumber'
|
|
12
|
+
const blacklist = ['password','phonenumber'/*,'code'*/,'resetCode','recaptchaToken','token','mfa','REFRESH_TOKEN','SECRET_HASH','SecretHash','AccessToken','UserCode','paymentMethodNonce'];
|
|
13
13
|
//
|
|
14
14
|
export default class IKLogger {
|
|
15
15
|
constructor(_config, _LOG_LEVEL, transactionID) {
|
|
@@ -81,7 +81,7 @@ export default class IKLogger {
|
|
|
81
81
|
if (Utils.isOffline()) {
|
|
82
82
|
return ` [${this._timestamp()} - ${LOG_STRINGS[level]}] [${caller}] ${msg.join(" ")}`;
|
|
83
83
|
} else if (Utils.isHybridlessContainer() && this._transactionID) {
|
|
84
|
-
return (isRaw ? '' : ` ${this._transactionID}`) + ` [${LOG_STRINGS[level]}] [${caller}] ${this._supressSensitiveInfo
|
|
84
|
+
return (isRaw ? '' : ` ${this._transactionID}`) + ` [${LOG_STRINGS[level]}] [${caller}] ${(msg.map(this._supressSensitiveInfo).join(" "))}`;
|
|
85
85
|
} else {
|
|
86
86
|
return ` [${LOG_STRINGS[level]}] [${caller}] ${msg.join(" ")}`;
|
|
87
87
|
}
|
|
@@ -127,10 +127,10 @@ export default class IKLogger {
|
|
|
127
127
|
Object.keys(value).forEach(function (elt, i, array) {
|
|
128
128
|
const match = blacklist.find((f) => elt.toLowerCase().includes(f.toLowerCase()));
|
|
129
129
|
if (match) value[elt] = '**SUPRESSED_SENSITIVE_DATA**';
|
|
130
|
-
else value[elt] =
|
|
130
|
+
else value[elt] = value[elt];
|
|
131
131
|
});
|
|
132
132
|
return value;
|
|
133
|
-
} else if (Array.isArray(value)) return value.map(v=>
|
|
133
|
+
} else if (Array.isArray(value)) return value.map(v=>this._supressSensitiveInfo(v));
|
|
134
134
|
return value;
|
|
135
135
|
}
|
|
136
136
|
}
|