MCPcopy Index your code
hub / github.com/fastapi/fastapi / get_current_user

Function get_current_user

tests/test_security_api_key_header_optional.py:16–20  ·  view source on GitHub ↗
(oauth_header: str | None = Security(api_key))

Source from the content-addressed store, hash-verified

14
15
16def get_current_user(oauth_header: str | None = Security(api_key)):
17 if oauth_header is None:
18 return None
19 user = User(username=oauth_header)
20 return user
21
22
23@app.get("/users/me")

Callers

nothing calls this directly

Calls 2

SecurityClass · 0.90
UserClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…