Home / Function/ check_api_key() — fastapi Function Reference

check_api_key() — fastapi Function Reference

Architecture documentation for the check_api_key() function in api_key.py from the fastapi codebase.

Function python Security Schemes calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  0a1afb2c_f4ce_fb90_4faf_3674ab253100["check_api_key()"]
  f01173ae_dbd6_605b_f92e_0035a743c419["APIKeyBase"]
  0a1afb2c_f4ce_fb90_4faf_3674ab253100 -->|defined in| f01173ae_dbd6_605b_f92e_0035a743c419
  ec60d565_1480_f71a_0040_d5437d343db3["__call__()"]
  ec60d565_1480_f71a_0040_d5437d343db3 -->|calls| 0a1afb2c_f4ce_fb90_4faf_3674ab253100
  a4452985_9360_8685_8df8_22f6ddbc1b50["__call__()"]
  a4452985_9360_8685_8df8_22f6ddbc1b50 -->|calls| 0a1afb2c_f4ce_fb90_4faf_3674ab253100
  83e91930_3a1c_6c0c_1c63_147bbf77b910["__call__()"]
  83e91930_3a1c_6c0c_1c63_147bbf77b910 -->|calls| 0a1afb2c_f4ce_fb90_4faf_3674ab253100
  8b39fe4e_79da_b187_f689_d2d00b0a2dd6["make_not_authenticated_error()"]
  0a1afb2c_f4ce_fb90_4faf_3674ab253100 -->|calls| 8b39fe4e_79da_b187_f689_d2d00b0a2dd6
  style 0a1afb2c_f4ce_fb90_4faf_3674ab253100 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/security/api_key.py lines 45–50

    def check_api_key(self, api_key: Optional[str]) -> Optional[str]:
        if not api_key:
            if self.auto_error:
                raise self.make_not_authenticated_error()
            return None
        return api_key

Domain

Subdomains

Frequently Asked Questions

What does check_api_key() do?
check_api_key() is a function in the fastapi codebase, defined in fastapi/security/api_key.py.
Where is check_api_key() defined?
check_api_key() is defined in fastapi/security/api_key.py at line 45.
What does check_api_key() call?
check_api_key() calls 1 function(s): make_not_authenticated_error.
What calls check_api_key()?
check_api_key() is called by 3 function(s): __call__, __call__, __call__.

Analyze Your Own Codebase

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

Try Supermodel Free