Coverage for docs_src/bigger_applications/app/dependencies.py: 100%
7 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
4async def get_token_header(x_token: str = Header()): 1abcde
5 if x_token != "fake-super-secret-token": 1abcde
6 raise HTTPException(status_code=400, detail="X-Token header invalid") 1abcde
9async def get_query_token(token: str): 1abcde
10 if token != "jessica": 1abcde
11 raise HTTPException(status_code=400, detail="No Jessica token provided") 1abcde