@topconsultnpm/sdkui-react 6.21.0-dev4.2 → 6.21.0-dev4.3
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.
|
@@ -23,8 +23,8 @@ export var ButtonNames;
|
|
|
23
23
|
// Dimensioni minime di default per i popup
|
|
24
24
|
const DEFAULT_MIN_WIDTH = 500;
|
|
25
25
|
const DEFAULT_MIN_HEIGHT = 400;
|
|
26
|
-
// filtr
|
|
27
|
-
const
|
|
26
|
+
// filtr sensitive keys from all errors.
|
|
27
|
+
const SENSITIVE_KEYS = ['password', 'username'];
|
|
28
28
|
const redactSensitiveJsonString = (value) => {
|
|
29
29
|
const trimmed = value.trim();
|
|
30
30
|
const looksLikeJson = (trimmed.startsWith('{') && trimmed.endsWith('}')) || (trimmed.startsWith('[') && trimmed.endsWith(']'));
|
|
@@ -46,7 +46,7 @@ const redactSensitiveValue = (value) => {
|
|
|
46
46
|
return value;
|
|
47
47
|
const result = {};
|
|
48
48
|
for (const key of Object.keys(value)) {
|
|
49
|
-
result[key] = key.toLowerCase()
|
|
49
|
+
result[key] = SENSITIVE_KEYS.includes(key.toLowerCase()) ? '***' : redactSensitiveValue(value[key]);
|
|
50
50
|
}
|
|
51
51
|
return result;
|
|
52
52
|
};
|