"""CORS middleware."""

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware


def setup_cors(app: FastAPI) -> None:
    """Configure the CORS middleware."""

    app.add_middleware(
        CORSMiddleware,
        allow_origins=["*"],  # Production should scope this to explicit origins.
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    )
