Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #27 from alercebroker/fix-auth-source
Browse files Browse the repository at this point in the history
fix: auth source field optional
  • Loading branch information
dirodriguezm authored Mar 21, 2022
2 parents 311a4e1 + 2294725 commit 5289fc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db_plugins/db/mongo/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def connect(self, config):
"PORT": 27017, # mongo tipically runs on port 27017.
# Notice that we use an int here.
"DATABASE": "database",
"AUTH_SOURCE": "admin" # could be admin or the same as DATABASE
}
base : db_plugins.db.mongo.models.Base
Base class to initialize the database
Expand All @@ -54,7 +55,7 @@ def connect(self, config):
username=config["USER"],
password=config["PASSWORD"],
port=config["PORT"],
authSource=config["DATABASE"],
authSource=config.get("AUTH_SOURCE", config["DATABASE"]),
)
self.base.set_database(config["DATABASE"])
self.database = self.client[config["DATABASE"]]
Expand Down

0 comments on commit 5289fc5

Please sign in to comment.