from fastapi import Header, HTTPException

from app.config import settings


async def require_internal_api_key(x_internal_api_key: str | None = Header(default=None)) -> None:
    if not x_internal_api_key or x_internal_api_key != settings.soc_integrator_internal_key:
        raise HTTPException(status_code=401, detail="Invalid or missing internal API key")
