Skip to content

fix(backend): harden request-id/sandbox middleware and limit user response fields - #1133

Open
zoffunjunior381-jpg wants to merge 1 commit into
LabsCrypt:mainfrom
zoffunjunior381-jpg:fix/issues-1016-1017-1018-1019
Open

fix(backend): harden request-id/sandbox middleware and limit user response fields#1133
zoffunjunior381-jpg wants to merge 1 commit into
LabsCrypt:mainfrom
zoffunjunior381-jpg:fix/issues-1016-1017-1018-1019

Conversation

@zoffunjunior381-jpg

Copy link
Copy Markdown

Test plan

  • npx vitest run tests/sandbox.middleware.test.ts tests/requestId.test.ts tests/user.controller.test.ts — all pass
  • npx tsc --noEmit — no new errors introduced by this change (pre-existing unrelated errors in soroban-indexer.service.ts, soroban-event-worker.ts, and a few test files are out of scope)
  • Full npm test — 4 pre-existing integration test files fail due to requiring a live Postgres database in this environment; unrelated to this change and out of scope

Closes #1016
Closes #1017
Closes #1018
Closes #1019

…ponse fields

- Validate X-Request-ID against a safe alphanumeric+hyphen charset before
  echoing/logging it, falling back to randomUUID() to prevent log injection
- Add regression test confirming sandbox mode cannot be flipped via header
  when globally disabled
- Add explicit Prisma select clause to GET /v1/users/:publicKey limiting the
  response to the public user shape
- Document the database seed script and its fixtures in the backend README

Closes LabsCrypt#1016
Closes LabsCrypt#1017
Closes LabsCrypt#1018
Closes LabsCrypt#1019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment