Home / Function/ get_current_user() — fastapi Function Reference

get_current_user() — fastapi Function Reference

Architecture documentation for the get_current_user() function in test_security_api_key_query_optional.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  c393d70c_278d_d913_880a_1a4ce841c0b7["get_current_user()"]
  e36f2f2a_947b_0d59_a1df_3024ab3fce1b["test_security_api_key_query_optional.py"]
  c393d70c_278d_d913_880a_1a4ce841c0b7 -->|defined in| e36f2f2a_947b_0d59_a1df_3024ab3fce1b
  style c393d70c_278d_d913_880a_1a4ce841c0b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_security_api_key_query_optional.py lines 18–22

def get_current_user(oauth_header: Optional[str] = Security(api_key)):
    if oauth_header is None:
        return None
    user = User(username=oauth_header)
    return user

Domain

Subdomains

Frequently Asked Questions

What does get_current_user() do?
get_current_user() is a function in the fastapi codebase, defined in tests/test_security_api_key_query_optional.py.
Where is get_current_user() defined?
get_current_user() is defined in tests/test_security_api_key_query_optional.py at line 18.

Analyze Your Own Codebase

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

Try Supermodel Free