MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _authenticate_x509

Function _authenticate_x509

pymongo/asynchronous/auth.py:335–343  ·  view source on GitHub ↗

Authenticate using MONGODB-X509.

(credentials: MongoCredential, conn: AsyncConnection)

Source from the content-addressed store, hash-verified

333
334
335async def _authenticate_x509(credentials: MongoCredential, conn: AsyncConnection) -> None:
336 """Authenticate using MONGODB-X509."""
337 ctx = conn.auth_ctx
338 if ctx and ctx.speculate_succeeded():
339 # MONGODB-X509 is done after the speculative auth step.
340 return
341
342 cmd = _X509Context(credentials, conn.address).speculate_command()
343 await conn.command("$external", cmd)
344
345
346async def _authenticate_default(credentials: MongoCredential, conn: AsyncConnection) -> 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