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_header_optional.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  48906988_a40f_503e_ba8b_99e165295fbc["get_current_user()"]
  c4979cd9_80cd_7995_c6ff_bb63eb1455c8["test_security_api_key_header_optional.py"]
  48906988_a40f_503e_ba8b_99e165295fbc -->|defined in| c4979cd9_80cd_7995_c6ff_bb63eb1455c8
  style 48906988_a40f_503e_ba8b_99e165295fbc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_security_api_key_header_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_header_optional.py.
Where is get_current_user() defined?
get_current_user() is defined in tests/test_security_api_key_header_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