shoc-backend/Api.SeaHavenIndustries
Alexandre Brandizzi 32de36f78c fix(backend): sanitize exception disclosure in changed API endpoints
Replace raw exception-message disclosure (ex.Message) returned to API
callers with a stable sanitized public message plus correlated structured
internal logging, across the endpoints changed in this PR.

- Add SanitizedErrors helper: logs the original exception at Error with a
  generated correlation id and returns a stable public message referencing
  it so support can trace without exposing internals.
- Inject ILogger<T> into the 14 changed controllers and route every
  ex.Message/dbex.Message disclosure through the helper, preserving status
  codes, response shapes, and business data (e.g. OpenWorkOrders).
- Leave FluentValidation (vex.Errors) and existing fixed-message catches
  untouched; out-of-scope controllers (Account/Contact/Employee/Asset/
  PMSchedule) are unchanged.
- Add focused tests proving internal exception text is not returned and
  that Error logging carrying the original exception is invoked.
2026-07-24 14:14:39 -03:00
..
.config Initial commit 2024-09-28 14:58:36 -04:00
Controllers fix(backend): sanitize exception disclosure in changed API endpoints 2026-07-24 14:14:39 -03:00
DTOs refactor(api): enforce service and data-service boundaries 2026-07-24 10:27:35 -03:00
Filters feat(phase-0): finalize foundation — authorize, concurrency filter, isolated build 2026-07-02 09:19:28 -03:00
Helper fix(backend): sanitize exception disclosure in changed API endpoints 2026-07-24 14:14:39 -03:00
Infrastructure refactor(workorders): enforce service and data boundaries 2026-07-24 11:30:22 -03:00
Models initial commit for api changes 2025-02-18 13:13:33 -06:00
Properties Initial commit 2024-09-28 14:58:36 -04:00
wwwroot Add zip-to-zip distance calculation for vendor dispatch 2026-04-17 11:56:06 -04:00
Api.SeaHavenIndustries.csproj fix(backend): sanitize exception disclosure in changed API endpoints 2026-07-24 14:14:39 -03:00
Api.SeaHavenIndustries.http Initial commit 2024-09-28 14:58:36 -04:00
appsettings.Development.json fix(security): remove hardcoded secrets from source 2026-06-05 11:56:54 -04:00
appsettings.json fix(security): remove hardcoded secrets from source 2026-06-05 11:56:54 -04:00
appsettings.Production.json fix(security): remove hardcoded secrets from source 2026-06-05 11:56:54 -04:00
aws-beanstalk-tools-defaults.json fixes for Dev changes 2026-04-24 12:12:16 -05:00
db.txt fixes for Dev changes 2026-04-24 12:12:16 -05:00
Program.cs refactor(backend): enforce architecture and optimize dispatch 2026-07-24 12:07:48 -03:00