MCPcopy
hub / github.com/fastapi/fastapi / __call__

Method __call__

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

Source from the content-addressed store, hash-verified

402 self.auto_error = auto_error
403
404 async def __call__(self, request: Request) -> HTTPAuthorizationCredentials | None:
405 authorization = request.headers.get("Authorization")
406 scheme, credentials = get_authorization_scheme_param(authorization)
407 if not (authorization and scheme and credentials):
408 if self.auto_error:
409 raise self.make_not_authenticated_error()
410 else:
411 return None
412 if scheme.lower() != "digest":
413 if self.auto_error:
414 raise self.make_not_authenticated_error()
415 else:
416 return None
417 return HTTPAuthorizationCredentials(scheme=scheme, credentials=credentials)

Callers

nothing calls this directly

Calls 4

getMethod · 0.45

Tested by

no test coverage detected