Coverage for docs_src/bigger_applications/app_an_py39/dependencies.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-01-13 13:38 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-01-13 13:38 +0000
1from typing import Annotated 1abcd
3from fastapi import Header, HTTPException 1abcd
6async def get_token_header(x_token: Annotated[str, Header()]): 1abcd
7 if x_token != "fake-super-secret-token": 1mnoepWqfXrstuvwgxYyhZzABCDEiF0Gj1HIJKLMkN2Ol3PQR
8 raise HTTPException(status_code=400, detail="X-Token header invalid") 1neftvghBDijJLklR
11async def get_query_token(token: str): 1abcd
12 if token != "jessica": 1moep4qf5rs6789Suwgx!yh#zA$%'(TCEiF)Gj*HI+,-.UKMkN/Ol:PQ;=?@V
13 raise HTTPException(status_code=400, detail="No Jessica token provided") 1STUV