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