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

Method request_token

test/test_auth_oidc.py:136–154  ·  view source on GitHub ↗
(context: OIDCCallbackContext)

Source from the content-addressed store, hash-verified

134
135 def create_request_cb(self, username="test_user1", sleep=0):
136 def request_token(context: OIDCCallbackContext):
137 # Validate the info.
138 self.assertIsInstance(context.idp_info.issuer, str)
139 if context.idp_info.clientId is not None:
140 self.assertIsInstance(context.idp_info.clientId, str)
141
142 # Validate the timeout.
143 timeout_seconds = context.timeout_seconds
144 self.assertEqual(timeout_seconds, 60 * 5)
145
146 if context.refresh_token:
147 self.refresh_present += 1
148
149 token = self.get_token(username)
150 resp = OIDCCallbackResult(access_token=token, refresh_token=token)
151
152 time.sleep(sleep)
153 self.request_called += 1
154 return resp
155
156 class Inner(OIDCCallback):
157 def fetch(self, context):

Callers

nothing calls this directly

Calls 2

OIDCCallbackResultClass · 0.90
get_tokenMethod · 0.45

Tested by

no test coverage detected