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

Method fetch

pymongo/auth_oidc_shared.py:80–87  ·  view source on GitHub ↗
(self, context: OIDCCallbackContext)

Source from the content-addressed store, hash-verified

78
79class _OIDCTestCallback(OIDCCallback):
80 def fetch(self, context: OIDCCallbackContext) -> OIDCCallbackResult:
81 token_file = os.environ.get("OIDC_TOKEN_FILE")
82 if not token_file:
83 raise RuntimeError(
84 'MONGODB-OIDC with an "test" provider requires "OIDC_TOKEN_FILE" to be set'
85 )
86 with open(token_file) as fid:
87 return OIDCCallbackResult(access_token=fid.read().strip())
88
89
90class _OIDCAWSCallback(OIDCCallback):

Callers

nothing calls this directly

Calls 3

OIDCCallbackResultClass · 0.85
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected