Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
feat(mongo): Support optional SCRAM auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Addon Factory template committed Apr 30, 2021
1 parent f6818c3 commit e0ca002
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions splunk_connect_for_snmp_poller/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ def __init__(self, mongo_config):
os.environ["MONGO_SERVICE_SERVICE_HOST"],
int(os.environ["MONGO_SERVICE_SERVICE_PORT"]),
)
if os.environ.get("MONGO_USER"):
self._client.admin.authenticate(
os.environ["MONGO_USER"],
os.environ["MONGO_PASS"],
mechanism="SCRAM-SHA-1",
)

self._walked_hosts = self._client[mongo_config["database"]][
mongo_config["collection"]
]
Expand Down

0 comments on commit e0ca002

Please sign in to comment.