Coverage for docs_src/bigger_applications/app_an/dependencies.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from fastapi import Header, HTTPException 1abcde
2from typing_extensions import Annotated 1abcde
5async def get_token_header(x_token: Annotated[str, Header()]): 1abcde
6 if x_token != "fake-super-secret-token": 1abcde
7 raise HTTPException(status_code=400, detail="X-Token header invalid") 1abcde
10async def get_query_token(token: str): 1abcde
11 if token != "jessica": 1abcde
12 raise HTTPException(status_code=400, detail="No Jessica token provided") 1abcde