MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _auth_key

Function _auth_key

pymongo/asynchronous/auth.py:172–178  ·  view source on GitHub ↗

Get an auth key to use for authentication.

(nonce: str, username: str, password: str)

Source from the content-addressed store, hash-verified

170
171
172def _auth_key(nonce: str, username: str, password: str) -> str:
173 """Get an auth key to use for authentication."""
174 digest = _password_digest(username, password)
175 md5hash = hashlib.md5() # noqa: S324
176 data = f"{nonce}{username}{digest}"
177 md5hash.update(data.encode("utf-8"))
178 return md5hash.hexdigest()
179
180
181async def _canonicalize_hostname(hostname: str, option: str | bool) -> str:

Callers

nothing calls this directly

Calls 3

encodeMethod · 0.80
_password_digestFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected