feat(stove-api): expose estimate and operator controls
This commit is contained in:
@@ -236,6 +236,12 @@ async def favicon():
|
||||
import admin_api
|
||||
app.include_router(admin_api.router)
|
||||
|
||||
import stove_api
|
||||
app.include_router(stove_api.secure)
|
||||
app.include_router(stove_api.public)
|
||||
import stove_api_admin
|
||||
app.include_router(stove_api_admin.router)
|
||||
|
||||
# v2 живёт без inline: старый /admin сохраняет текущую политику до вывода из эксплуатации.
|
||||
ADMIN_V2_CSP = ("default-src 'self'; script-src 'self'; style-src 'self'; "
|
||||
"img-src 'self' data:; font-src 'self' data:; connect-src 'self'; "
|
||||
@@ -572,7 +578,7 @@ _AUDIT_MAP = [
|
||||
# /api/telegram/status спрашивает страница регистрации раз в несколько секунд, пока человек
|
||||
# ждёт код: без пропуска журнал действий залило бы шумом.
|
||||
_SKIP_PREFIXES = ("/static/", "/favicon", "/api/tus", "/api/limits", "/api/my-stats",
|
||||
"/api/telegram/status") # tus chunks are logged on completion, not per-PATCH
|
||||
"/api/telegram/status", "/api/v1/") # tus chunks are logged on completion, not per-PATCH
|
||||
|
||||
|
||||
def _resolve_action(method: str, path: str) -> str | None:
|
||||
@@ -770,7 +776,8 @@ async def security_headers_middleware(request: Request, call_next):
|
||||
@app.middleware("http")
|
||||
async def request_id_middleware(request: Request, call_next):
|
||||
"""R-01: номер запроса на КАЖДОМ ответе, включая ошибки и поток."""
|
||||
rid = (contract_errors.sane_request_id(request.headers.get("X-Request-Id"))
|
||||
rid = (uuid.uuid4().hex[:16] if request.url.path.startswith("/api/v1/") else
|
||||
contract_errors.sane_request_id(request.headers.get("X-Request-Id"))
|
||||
or uuid.uuid4().hex[:16])
|
||||
request.state.request_id = rid
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user