Coverage for docs_src/security/tutorial006_an_py39.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
1from typing import Annotated 1abcdef
3from fastapi import Depends, FastAPI 1abcdef
4from fastapi.security import HTTPBasic, HTTPBasicCredentials 1abcdef
6app = FastAPI() 1abcdef
8security = HTTPBasic() 1abcdef
11@app.get("/users/me") 1abcdef
12def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]): 1abcdef
13 return {"username": credentials.username, "password": credentials.password} 1ghijkl