chore(backend): save remaining API and deployment changes

Expose frozen factual review policy, update API descriptions and Swagger settings, and adjust local deployment and embedding connectivity.

Include the requested extraction candidates and review-policy regression coverage. Validation: 31 OCR policy tests passed; staged diff whitespace checks passed.
This commit is contained in:
amirhosein mazaheri
2026-10-10 17:43:17 +03:30
parent a769196bfa
commit 21a0ea076a
18 changed files with 268 additions and 49 deletions
+13 -2
View File
@@ -1,4 +1,5 @@
"""Deployment configuration, independent of runtime limits and embedding profiles."""
import ipaddress
from pathlib import Path
from typing import Literal
from urllib.parse import urlsplit
@@ -63,8 +64,18 @@ class VoiceSettings(BaseSettings):
@model_validator(mode='after')
def cookie_policy(self):
if not self.cookie_secure and any(urlsplit(o).hostname not in ('localhost', '127.0.0.1', '::1') for o in self.trusted_origins):
raise ValueError('Insecure cookies require loopback-only development origins')
for o in self.trusted_origins:
h = urlsplit(o).hostname
if not self.cookie_secure:
is_local = h in ('localhost', '127.0.0.1', '::1')
if not is_local and h:
try:
ip = ipaddress.ip_address(h)
is_local = ip.is_loopback or ip.is_private
except (ValueError, TypeError):
is_local = False
if not is_local:
raise ValueError('Insecure cookies require loopback-only development origins')
return self
@classmethod