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

Function _authenticate_x509

pymongo/synchronous/auth.py:332–340  ·  view source on GitHub ↗

Authenticate using MONGODB-X509.

(credentials: MongoCredential, conn: Connection)

Source from the content-addressed store, hash-verified

330
331
332def _authenticate_x509(credentials: MongoCredential, conn: Connection) -> None:
333 """Authenticate using MONGODB-X509."""
334 ctx = conn.auth_ctx
335 if ctx and ctx.speculate_succeeded():
336 # MONGODB-X509 is done after the speculative auth step.
337 return
338
339 cmd = _X509Context(credentials, conn.address).speculate_command()
340 conn.command("$external", cmd)
341
342
343def _authenticate_default(credentials: MongoCredential, conn: Connection) -> None:

Callers

nothing calls this directly

Calls 4

_X509ContextClass · 0.70
speculate_succeededMethod · 0.45
speculate_commandMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected