Home / Function/ __call__() — fastapi Function Reference

__call__() — fastapi Function Reference

Architecture documentation for the __call__() function in oauth2.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  b560ad81_87a3_a7da_6bf8_f1bf0b4190a4["__call__()"]
  5023758b_9456_fafe_dbb4_30deaf7720ac["OAuth2"]
  b560ad81_87a3_a7da_6bf8_f1bf0b4190a4 -->|defined in| 5023758b_9456_fafe_dbb4_30deaf7720ac
  8eebc79f_2a8c_2a4d_ce43_d94dc5a2eaf2["make_not_authenticated_error()"]
  b560ad81_87a3_a7da_6bf8_f1bf0b4190a4 -->|calls| 8eebc79f_2a8c_2a4d_ce43_d94dc5a2eaf2
  style b560ad81_87a3_a7da_6bf8_f1bf0b4190a4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/security/oauth2.py lines 423–430

    async def __call__(self, request: Request) -> Optional[str]:
        authorization = request.headers.get("Authorization")
        if not authorization:
            if self.auto_error:
                raise self.make_not_authenticated_error()
            else:
                return None
        return authorization

Domain

Subdomains

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 423.
What does __call__() call?
__call__() calls 1 function(s): make_not_authenticated_error.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free