Coverage for docs_src / security / tutorial001_py310.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from fastapi import Depends, FastAPI 1abc

2from fastapi.security import OAuth2PasswordBearer 1abc

3 

4app = FastAPI() 1abc

5 

6oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") 1abc

7 

8 

9@app.get("/items/") 1abc

10async def read_items(token: str = Depends(oauth2_scheme)): 1abc

11 return {"token": token} 1def