fix(tradein/security): admin.py — generic detail + error-id вместо сырого текста исключений (#2234) #2261
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#2261
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/tradein-admin-exception-leak"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
_safe_http_error(status_code, public_detail, log_context): короткий error-id (uuid4().hex[:8]), полный traceback — только вlogger.exception(→ GlitchTip), в HTTP — generic detail вида"fetch failed (error-id: abc12345)".detail=f"...: {e}"(бывшие строки 551/557/580/586/629/669/672/679) — psycopg/httpx-исключения с DSN-фрагментами/внутренними хостами больше не утекают в ответы. Статус-коды сохранены 1:1 (502/500/404), контекст логирования (house_url/item_url/run_id/address) сохранён.IMVAddressNotFoundError(404, ожидаемое клиентское условие) логируетсяlogger.warningбез traceback — не создаёт exception-шум в GlitchTip.postgres://user:SECRETPASS@...) → 502, в теле ответа нет секрета, есть error-id.Как проверено
uv run pytest(deselect толькоtest_search_cache_hit): 3021 passed, 6 skipped; после minor-правкиtests/test_scraper_admin_apis.py— 22 passed.raise ... from e, статус-коды сверены построчно).Closes #2234