get_current_user() — fastapi Function Reference
Architecture documentation for the get_current_user() function in test_security_api_key_cookie_optional.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD bd2ad349_0e58_fd9c_d5fa_c14f24920625["get_current_user()"] 853abe77_28c7_dfc7_b021_1d20798ab56f["test_security_api_key_cookie_optional.py"] bd2ad349_0e58_fd9c_d5fa_c14f24920625 -->|defined in| 853abe77_28c7_dfc7_b021_1d20798ab56f style bd2ad349_0e58_fd9c_d5fa_c14f24920625 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_security_api_key_cookie_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
Source
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_cookie_optional.py.
Where is get_current_user() defined?
get_current_user() is defined in tests/test_security_api_key_cookie_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