Skip to content

Commit

Permalink
Merge pull request telefonicaid#1387 from ngeconnect/master
Browse files Browse the repository at this point in the history
Remove MongoDB connection options from log, to avoid credentials display
  • Loading branch information
fgalan authored Jul 6, 2023
2 parents 4591e7f + d676425 commit 5954076
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
Expand Up @@ -7,3 +7,4 @@
- Fix: use 'options=upsert' when update ngsiv2 CB entities and appendMode is enabled (#956)
- Fix: do not propagate group config (timestamp and explicitAttrs) to autoprovisioned devices (at database level) (#1377)
- 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 5954076

Please sign in to comment.