Skip to content

Commit 9762753

Browse files
committed
feat: hide all personal data from config
1 parent f14bab4 commit 9762753

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

app/utils/tracer-logger.js

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,38 @@ const logger = tracer.colorConsole({
1818
if (data.args.length > 1) {
1919
// have more than only just a string passed to the logger
2020
for (const [key, value] of Object.entries(data.args)) {
21-
if (typeof(value) === 'object'){
22-
if ('immobilienScout24' in value) {
21+
if (typeof value === 'object') {
22+
if (
23+
'applicationText' in value &&
24+
'immobilienScout24' in value &&
25+
'contactData' in value
26+
) {
2327
// found something that looks like a configuration
2428
// we don't want to modify the object, so we copy it
25-
// do not feed back name and password
26-
let { immobilienScout24, ...other } = value;
27-
data.args[key] = Object.assign({}, other);
28-
let { userName, password, ...other24} = immobilienScout24;
29-
data.args[key].immobilienScout24 = Object.assign({}, other24);
29+
data.args[key] = Object.assign({}, value);
30+
data.args[key].applicationText = 'HIDDEN';
31+
data.args[key].immobilienScout24 = Object.assign(
32+
{},
33+
value.immobilienScout24
34+
);
35+
data.args[key].immobilienScout24.userName = 'HIDDEN';
36+
data.args[key].immobilienScout24.password = 'HIDDEN';
37+
data.args[key].contactData = Object.assign({}, value.contactData);
38+
data.args[key].contactData.salutation = 'HIDDEN';
39+
data.args[key].contactData.firstName = 'HIDDEN';
40+
data.args[key].contactData.lastName = 'HIDDEN';
41+
data.args[key].contactData.eMail = 'HIDDEN';
42+
data.args[key].contactData.street = 'HIDDEN';
43+
data.args[key].contactData.houseNumber = 'HIDDEN';
44+
data.args[key].contactData.postcode = 'HIDDEN';
45+
data.args[key].contactData.city = 'HIDDEN';
46+
data.args[key].contactData.telephone = 'HIDDEN';
47+
data.args[key].additionalInformation = Object.assign(
48+
{},
49+
value.additionalInformation
50+
);
51+
data.args[key].additionalInformation.employmentStatus = 'HIDDEN';
52+
data.args[key].additionalInformation.income = 0;
3053
}
3154
}
3255
}

0 commit comments

Comments
 (0)