Skip to content

Commit

Permalink
Remove MongoDB connection options from log, to avoid credentials display
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel-Nau committed Jul 5, 2023
1 parent 89cea3f commit d676425
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix: appendMode at general level (config.js / env var) changes its default from false to true
- Fix: remove sensitive MongoDB connection parameters from log traces (remove 'option' object from logs)
8 changes: 1 addition & 7 deletions lib/model/dbConn.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,7 @@ function init(host, db, port, options, callback) {
}

function connectionAttempt(url, options, callback) {
logger.info(
context,
'Attempting to connect to MongoDB instance with url %j and options %j. Attempt %d',
url,
options,
retries
);
logger.info(context, 'Attempting to connect to MongoDB instance with url %j. Attempt %d', url, retries);
// FIXME: useNewUrlParser is no longer used in underlying mongodb driver 4.x
// (see https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_4.0.0.md)
// but not sure if current mongoose version is still using mongodb 3.x internally
Expand Down

0 comments on commit d676425

Please sign in to comment.