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

Function _auth_key

pymongo/synchronous/auth.py:169–175  ·  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

167
168
169def _auth_key(nonce: str, username: str, password: str) -> str:
170 """Get an auth key to use for authentication."""
171 digest = _password_digest(username, password)
172 md5hash = hashlib.md5() # noqa: S324
173 data = f"{nonce}{username}{digest}"
174 md5hash.update(data.encode("utf-8"))
175 return md5hash.hexdigest()
176
177
178def _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