MCPcopy Index your code
hub / github.com/fastapi/fastapi / __call__

Method __call__

fastapi/security/http.py:303–316  ·  view source on GitHub ↗
(self, request: Request)

Source from the content-addressed store, hash-verified

301 self.auto_error = auto_error
302
303 async def __call__(self, request: Request) -> HTTPAuthorizationCredentials | None:
304 authorization = request.headers.get("Authorization")
305 scheme, credentials = get_authorization_scheme_param(authorization)
306 if not (authorization and scheme and credentials):
307 if self.auto_error:
308 raise self.make_not_authenticated_error()
309 else:
310 return None
311 if scheme.lower() != "bearer":
312 if self.auto_error:
313 raise self.make_not_authenticated_error()
314 else:
315 return None
316 return HTTPAuthorizationCredentials(scheme=scheme, credentials=credentials)
317
318
319class HTTPDigest(HTTPBase):

Callers

nothing calls this directly

Calls 4

getMethod · 0.45

Tested by

no test coverage detected