Skip to content

Commit

Permalink
fix: debug prints the password in plain text
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Buceta <[email protected]>
  • Loading branch information
frbuceta committed May 23, 2022
1 parent 61b5029 commit 1a863f3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/postgresql.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,17 @@ function PostgreSQL(postgresql, settings) {
}

this.settings = settings;
debug('Settings %j', settings);
debug('Settings %j', {
...settings,
...(typeof settings.url !== 'undefined' && {
get url() {
const url = new URL(settings.url);
if (url.password !== '') url.password = '***';
return url.toString();
},
}),
...(typeof settings.password !== 'undefined' && {password: '***'}),
});
}

// Inherit from loopback-datasource-juggler BaseSQL
Expand Down

0 comments on commit 1a863f3

Please sign in to comment.