Home / Function/ read_current_user() — fastapi Function Reference

read_current_user() — fastapi Function Reference

Architecture documentation for the read_current_user() function in test_security_http_bearer_optional.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  546b6a7a_40eb_fc0a_48a1_a5db67c2b649["read_current_user()"]
  7a87688e_4c54_4f47_4f3f_b5a1411a8ab1["test_security_http_bearer_optional.py"]
  546b6a7a_40eb_fc0a_48a1_a5db67c2b649 -->|defined in| 7a87688e_4c54_4f47_4f3f_b5a1411a8ab1
  style 546b6a7a_40eb_fc0a_48a1_a5db67c2b649 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_security_http_bearer_optional.py lines 14–19

def read_current_user(
    credentials: Optional[HTTPAuthorizationCredentials] = Security(security),
):
    if credentials is None:
        return {"msg": "Create an account first"}
    return {"scheme": credentials.scheme, "credentials": credentials.credentials}

Domain

Subdomains

Frequently Asked Questions

What does read_current_user() do?
read_current_user() is a function in the fastapi codebase, defined in tests/test_security_http_bearer_optional.py.
Where is read_current_user() defined?
read_current_user() is defined in tests/test_security_http_bearer_optional.py at line 14.

Analyze Your Own Codebase

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

Try Supermodel Free