food-market/src/food-market.api/Controllers
nns 284ad095c1
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
Docker API / Build + push API (push) Waiting to run
Docker API / Deploy API on stage (push) Blocked by required conditions
fix(s23): adversarial bug-hunt — 4 bugs found, all fixed
Sprint 23 (adversarial): атаковали систему как недоброжелатель.
Найдено 4 бага, все починены.

Bug #001 (Medium): NULL-byte в Product.Name вызывал 500 без тела.
  Postgres TEXT не принимает \x00. Добавил NoControlChars() в
  ProductInputValidator + CounterpartyInputValidator.

Bug #002 (Low): ProductInputValidator MaximumLength(200) конфликтовал
  со StringLength(500) в DTO и schema HasMaxLength(500). Сделал 500
  везде. Counterparty: 200 → 255 (matches HasMaxLength).

Bug #003 (CRITICAL): параллельные posting'и под Serializable выбрасывали
  PostgresException 40001 → middleware → 500 empty body. Добавил
  SerializationConflictMiddleware который мапит 40001 → 409 Conflict
  с {error, retryable: true}. Также SerializableRetry helper для
  явного retry внутри endpoint'ов с exp backoff. Применил retry-wrap
  к RetailSalesController.Post (PostCoreAsync extracted).

Bug #004 (Low): цена 0.0000001 округлялась до 0 уже после прохождения
  required-price check (check был ДО RoundIfNeeded). FindMissing-
  RequiredPriceAsync теперь округляет перед сравнением — required
  цена реально > 0 после rounding.

Bug reports: tests/e2e/reports/bugs/bug-00[1-4]-*.md (github-issue format).

Multi-tenant attacks (cat 3): clean — все cross-org GET/PUT/DELETE
дают 404, bulk-update affected=0, lists не утекают.
Auth-edge (cat 2): clean — JWT tampering 401, garbage 401, CORS evil.com
не получает allow-origin, fake refresh 400 invalid_grant.
DOS (cat 7): clean — 50MB body 413, 200 headers 431, long URL 200.
Hangfire safety (cat 8): clean — regular Admin → /hangfire 403,
  seed-demo использует tenant context, body org-id игнорируется.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 01:35:50 +05:00
..
Admin feat(s22): data tooling — export/import + schema docs + anon dump (7 пунктов) 2026-06-07 23:00:54 +05:00
Auth feat(s20): Mapster + SSO scaffold + maintenance automation (7 пунктов) 2026-06-07 21:54:12 +05:00
Catalog fix(s23): adversarial bug-hunt — 4 bugs found, all fixed 2026-06-08 01:35:50 +05:00
Common feat(s19): bulk-операции + presets + power-user UX (7 пунктов) 2026-06-07 21:08:48 +05:00
Dashboard feat(s10): year-demo seeder + 4 dashboard виджета + week-stats 2026-06-06 01:03:36 +05:00
Inventory feat(s19): bulk-операции + presets + power-user UX (7 пунктов) 2026-06-07 21:08:48 +05:00
Loyalty feat(loyalty+promotions): P2-12 + P2-13 — лояльность и промокоды (Sprint 9 п.1-2) 2026-05-31 21:06:10 +05:00
Organizations feat(s22): data tooling — export/import + schema docs + anon dump (7 пунктов) 2026-06-07 23:00:54 +05:00
Pos feat(observability): Prometheus метрики /metrics + бизнес-счётчики (P1-17) 2026-05-28 12:20:01 +05:00
Promotions feat(loyalty+promotions): P2-12 + P2-13 — лояльность и промокоды (Sprint 9 п.1-2) 2026-05-31 21:06:10 +05:00
Purchases feat(s19): bulk-операции + presets + power-user UX (7 пунктов) 2026-06-07 21:08:48 +05:00
Reports perf(s14): индексы + N+1 fix + bundle -50% + WebP variants + pool + Hangfire timing 2026-06-07 13:21:39 +05:00
Sales fix(s23): adversarial bug-hunt — 4 bugs found, all fixed 2026-06-08 01:35:50 +05:00
Search feat(s10-3): глобальная Cmd+K палитра + GET /api/search/global 2026-06-06 01:20:05 +05:00
SuperAdmin fix(superadmin): change-owner требует reason ≥ 10 символов 2026-05-26 11:53:32 +05:00
Telegram feat(telegram): OwnerDailySummaryJob + bot binding (P2-14) 2026-05-31 19:50:33 +05:00
Uploads perf(s14): индексы + N+1 fix + bundle -50% + WebP variants + pool + Hangfire timing 2026-06-07 13:21:39 +05:00
AuthForgotPasswordController.cs feat(s13): security headers + rate-limits + sensitive-ops audit + session revoke + Grafana 2026-06-07 12:30:10 +05:00
AuthorizationController.cs feat(auth): TOTP 2FA для админов через AuthenticatorTokenProvider (P2-4) 2026-05-28 17:57:32 +05:00
AuthSignupController.cs fix(phone): серверная KZ-ФЛК на всех endpoint'ах принимающих phone 2026-05-08 01:05:48 +05:00
FeedbackController.cs feat(s17): onboarding wizard + help kb + feedback + diagnostic + whats-new 2026-06-07 17:04:26 +05:00
MeAccountController.cs feat(s13): security headers + rate-limits + sensitive-ops audit + session revoke + Grafana 2026-06-07 12:30:10 +05:00
MeSessionsController.cs feat(s13): security headers + rate-limits + sensitive-ops audit + session revoke + Grafana 2026-06-07 12:30:10 +05:00
TwoFactorController.cs feat(s13): security headers + rate-limits + sensitive-ops audit + session revoke + Grafana 2026-06-07 12:30:10 +05:00
WhatsNewController.cs feat(s17): onboarding wizard + help kb + feedback + diagnostic + whats-new 2026-06-07 17:04:26 +05:00