fix: api key header

This commit is contained in:
Christopher Gondek 2025-10-17 10:30:56 +02:00
parent b3193ee56d
commit 1fe6a06a5f

View file

@ -1,5 +1,6 @@
"""Dependencies for FastAPI routers.""" """Dependencies for FastAPI routers."""
from fastapi import Depends
from fastapi import HTTPException from fastapi import HTTPException
from fastapi import status from fastapi import status
from fastapi.security import APIKeyHeader from fastapi.security import APIKeyHeader
@ -15,7 +16,7 @@ api_key_header: SecurityBase = APIKeyHeader(
) )
def require_pp_api_key(*, api_key: str = api_key_header) -> None: def require_pp_api_key(api_key: str = Depends(api_key_header)) -> None:
"""Validate the preprocessor API key. """Validate the preprocessor API key.
Args: Args:
@ -39,7 +40,7 @@ db_api_key_header: SecurityBase = APIKeyHeader(
) )
def require_db_api_key(*, api_key: str = db_api_key_header) -> None: def require_db_api_key(api_key: str = Depends(db_api_key_header)) -> None:
"""Validate the database API key. """Validate the database API key.
Args: Args: