FastAPI + Pydantic v2;HTTP 认证使用 fastapi.security.HTTPBearer;SSE ticket 基于 secrets.token_urlsafe 与 time.monotonic 的内存表;CORS/CSP/Permissions-Policy 通过自定义中间件注入;.env 写入采用 tempfile.mkstemp + os.replace 原子替换。