Files
co-lite/openspec/changes/archive/2026-11-30-stop-gateway-body-logging/proposal.md
T
ngqileandClaude Opus 5.5 ebfcdbb808 docs(openspec): archive stop-gateway-body-logging
Adds the gateway-request-logging main spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 09:24:50 +08:00

2.1 KiB

Proposal

Why

The API gateway logs the body of every POST and PUT request, and the log is shipped to Elasticsearch. Only credentials are masked (passwords, tokens, keys). Every other field is logged as sent, so personal data reaches the log:

  • lead capture, lead update and lead search (names, mobiles, emails, notes);
  • member calls;
  • admin user create and edit;
  • forgot-password.

The project rules forbid logging customer PII. The add-lead-listing-export branch review found this, and it has to be fixed before go-live on 2027-01-15.

What Changes

  • The gateway request log keeps one line per request with the method, the path and the headers, and never the request body. Credential header values and JWT-shaped path segments stay masked, as today.
  • The gateway no longer reads the request body to log it, so the body passes to the downstream service untouched. No other gateway filter reads the body.
  • The body-masking code (JSON and form field masking, size limits) has no callers left and is removed, together with its unit tests. Header and path masking and their tests stay.
  • The filter tests that asserted a masked body now assert that no body content reaches the log at all, and that the downstream service still receives the original body. These tests get stricter, not weaker.
  • The skip list (/log/save, /log/saveMemberLog, /auth/authenticate, /auth/webMemberAuthenticate) and the /actuator skip stay as they are.

Not in this change: logging elsewhere (mobile-api and service logs), log retention, and access logs.

Capabilities

New Capabilities

  • gateway-request-logging: what the gateway writes to its request log, and what it must never write there.

Modified Capabilities

None.

Impact

  • solvway-api-gateway: RequestBodyLoggerFilter (logs without reading the body), LogRedactor (body masking removed), and their tests.
  • Debugging: request bodies are no longer in the gateway log. Content-Length is still logged with the headers, so the size of each body stays visible.
  • No API, database or dependency change. Downstream services see the same requests.