@dasmeta/event-manager-platform-helper
Advanced tools
Comparing version 1.0.3 to 1.1.0
{ | ||
"name": "@dasmeta/event-manager-platform-helper", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Event platform helper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,2 +16,3 @@ | ||
MONGODB_EVENT_DB=event | ||
MONGODB_EVENT_AUTHENTICATION_DATABASE=admin | ||
``` | ||
@@ -18,0 +19,0 @@ ## Usage |
@@ -25,4 +25,4 @@ const { MongoClient, ObjectId } = require("mongodb"); | ||
const { username, password, host, port, db } = options; | ||
const url = `mongodb://${username || password ? `${username}:${password}@` : ""}${host}:${port}/${db}`; | ||
const { username, password, host, port, db, authenticationDatabase } = options; | ||
const url = `mongodb://${username || password ? `${username}:${password}@` : ""}${host}:${port}/${db}?authSource=${authenticationDatabase}`; | ||
@@ -46,3 +46,5 @@ const connection = await MongoClient.connect(url, { | ||
const db = process.env[`MONGODB_${ALIAS}_DB`] || alias; | ||
return { username, password, host, port, db }; | ||
const authenticationDatabase = process.env[`MONGODB_${ALIAS}_AUTHENTICATION_DATABASE`] || 'admin'; | ||
return { username, password, host, port, db, authenticationDatabase }; | ||
}; | ||
@@ -49,0 +51,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24739
303
107
11