MCPcopy Create free account
hub / github.com/fastapi/fastapi / __call__

Method __call__

fastapi/security/oauth2.py:642–650  ·  view source on GitHub ↗
(self, request: Request)

Source from the content-addressed store, hash-verified

640 )
641
642 async def __call__(self, request: Request) -> str | None:
643 authorization = request.headers.get("Authorization")
644 scheme, param = get_authorization_scheme_param(authorization)
645 if not authorization or scheme.lower() != "bearer":
646 if self.auto_error:
647 raise self.make_not_authenticated_error()
648 else:
649 return None # pragma: nocover
650 return param
651
652
653class SecurityScopes:

Callers

nothing calls this directly

Calls 3

getMethod · 0.45

Tested by

no test coverage detected