vibe-link-server / app /core /security.py
Lcmind
refactor: S-grade architecture with layered structure and strict CORS
5915d13
"""Security configurations including CORS."""
from fastapi.middleware.cors import CORSMiddleware
from fastapi import FastAPI
from app.core.config import settings
def configure_cors(app: FastAPI) -> None:
"""
Configure CORS middleware with strict origin control.
Only allows requests from specified frontend domains.
"""
app.add_middleware(
CORSMiddleware,
allow_origins=settings.allowed_origins, # ํ”„๋ก ํŠธ์—”๋“œ ๋„๋ฉ”์ธ๋งŒ ํ—ˆ์šฉ
allow_credentials=True,
allow_methods=["GET", "POST", "OPTIONS"],
allow_headers=["Content-Type", "Authorization"],
)