__call__() — fastapi Function Reference
Architecture documentation for the __call__() function in oauth2.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 792b0068_1314_2ef5_1e7b_e8b9a85e1c47["__call__()"] 79a687d7_9ba3_0c89_6872_bd0923acf64f["OAuth2AuthorizationCodeBearer"] 792b0068_1314_2ef5_1e7b_e8b9a85e1c47 -->|defined in| 79a687d7_9ba3_0c89_6872_bd0923acf64f 8eebc79f_2a8c_2a4d_ce43_d94dc5a2eaf2["make_not_authenticated_error()"] 792b0068_1314_2ef5_1e7b_e8b9a85e1c47 -->|calls| 8eebc79f_2a8c_2a4d_ce43_d94dc5a2eaf2 21dea0a2_f30d_d3da_ce48_734fa9836d52["get_authorization_scheme_param()"] 792b0068_1314_2ef5_1e7b_e8b9a85e1c47 -->|calls| 21dea0a2_f30d_d3da_ce48_734fa9836d52 style 792b0068_1314_2ef5_1e7b_e8b9a85e1c47 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
fastapi/security/oauth2.py lines 642–650
async def __call__(self, request: Request) -> Optional[str]:
authorization = request.headers.get("Authorization")
scheme, param = get_authorization_scheme_param(authorization)
if not authorization or scheme.lower() != "bearer":
if self.auto_error:
raise self.make_not_authenticated_error()
else:
return None # pragma: nocover
return param
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does __call__() do?
__call__() is a function in the fastapi codebase, defined in fastapi/security/oauth2.py.
Where is __call__() defined?
__call__() is defined in fastapi/security/oauth2.py at line 642.
What does __call__() call?
__call__() calls 2 function(s): get_authorization_scheme_param, make_not_authenticated_error.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free