tutorial012_py39.py — fastapi Source File
Architecture documentation for tutorial012_py39.py, a python file in the fastapi codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d0510246_9487_bfdf_ad13_0b06519c45c6["tutorial012_py39.py"] 534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"] d0510246_9487_bfdf_ad13_0b06519c45c6 --> 534f6e44_61b8_3c38_8b89_6934a6df9802 style d0510246_9487_bfdf_ad13_0b06519c45c6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from fastapi import Depends, FastAPI, Header, HTTPException
async def verify_token(x_token: str = Header()):
if x_token != "fake-super-secret-token":
raise HTTPException(status_code=400, detail="X-Token header invalid")
async def verify_key(x_key: str = Header()):
if x_key != "fake-super-secret-key":
raise HTTPException(status_code=400, detail="X-Key header invalid")
return x_key
app = FastAPI(dependencies=[Depends(verify_token), Depends(verify_key)])
@app.get("/items/")
async def read_items():
return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
@app.get("/users/")
async def read_users():
return [{"username": "Rick"}, {"username": "Morty"}]
Domain
Subdomains
Dependencies
Source
Frequently Asked Questions
What does tutorial012_py39.py do?
tutorial012_py39.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Responses subdomain.
What functions are defined in tutorial012_py39.py?
tutorial012_py39.py defines 4 function(s): read_items, read_users, verify_key, verify_token.
What does tutorial012_py39.py depend on?
tutorial012_py39.py imports 1 module(s): __init__.py.
Where is tutorial012_py39.py in the architecture?
tutorial012_py39.py is located at docs_src/dependencies/tutorial012_py39.py (domain: FastAPI, subdomain: Responses, directory: docs_src/dependencies).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free