Unify parsing workers, analytics API with PostgreSQL, map UI, and PI distribution into centers/ with Docker Compose. Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
380 B
Python
12 lines
380 B
Python
import os
|
|
|
|
from fastapi import Header, HTTPException
|
|
|
|
|
|
def verify_internal_token(
|
|
x_internal_token: str | None = Header(default=None, alias="X-Internal-Token"),
|
|
) -> None:
|
|
expected = os.getenv("INTERNAL_TOKEN", "dev-internal-token")
|
|
if not x_internal_token or x_internal_token != expected:
|
|
raise HTTPException(status_code=401, detail="Invalid internal token")
|