Align trusted-proxy handling with When and Directory #37

Merged
eleith merged 1 commits from fix/trusted-proxy into main 2026-11-04 17:31:13 +00:00

Summary

  • Follow When's standard adapter-node protocol/client-address headers and Directory's configured-origin checks. Remove the build-time origin pin, custom Host parsing and repeated loopback-IP restrictions.
  • Preserve authentication, exact unsafe-request Origin checks, no-store, bounded UTF-8 bodies and native financial/job behavior. Local Vite/mise development and listener bindings are unchanged.
  • Use When's owned HTTP-boundary pattern for compiled browser fixtures, retaining native adapter lifecycle. The small test-only Compose override changes the entrypoint, not configuration/journal/data isolation.
  • Include operator documentation and a web patch Changeset.

Trust contract

The proxy must exclusively control upstream access, preserve the public Host and overwrite the selected protocol/address headers. Framework request origins must match YAML url.app. This is compatibility work, not a production deployment/release redesign.

Validation

  • Code and readability reviews clear; documentation findings resolved.
  • Web typecheck, lint and build passed.
  • 69 focused auth/request/route tests across 16 files passed.
  • Three browser journeys passed: sign-in/logout with and without JavaScript, plus a native query/reload.
  • Private HTTP-upstream probe passed: non-loopback authenticated client, canonical Host/scheme, ignored forwarded-host spoof, exact mutation Origin, secure cookie, no-store and sign-out.
  • Personal configuration and journal hashes unchanged.

Not exercised: Docker/private-image pulls, hosted CI, an actual TLS frontend proxy or a live OIDC provider. Unchanged native/storage/worker qualification suites were not rerun.

## Summary - Follow When's standard adapter-node protocol/client-address headers and Directory's configured-origin checks. Remove the build-time origin pin, custom Host parsing and repeated loopback-IP restrictions. - Preserve authentication, exact unsafe-request Origin checks, no-store, bounded UTF-8 bodies and native financial/job behavior. Local Vite/mise development and listener bindings are unchanged. - Use When's owned HTTP-boundary pattern for compiled browser fixtures, retaining native adapter lifecycle. The small test-only Compose override changes the entrypoint, not configuration/journal/data isolation. - Include operator documentation and a web patch Changeset. ## Trust contract The proxy must exclusively control upstream access, preserve the public Host and overwrite the selected protocol/address headers. Framework request origins must match YAML `url.app`. This is compatibility work, not a production deployment/release redesign. ## Validation - Code and readability reviews clear; documentation findings resolved. - Web typecheck, lint and build passed. - 69 focused auth/request/route tests across 16 files passed. - Three browser journeys passed: sign-in/logout with and without JavaScript, plus a native query/reload. - Private HTTP-upstream probe passed: non-loopback authenticated client, canonical Host/scheme, ignored forwarded-host spoof, exact mutation Origin, secure cookie, no-store and sign-out. - Personal configuration and journal hashes unchanged. Not exercised: Docker/private-image pulls, hosted CI, an actual TLS frontend proxy or a live OIDC provider. Unchanged native/storage/worker qualification suites were not rerun.
eleith-gitea-agent Bot added 1 commit 2026-11-04 17:28:33 +00:00
fix(web): align trusted-proxy request handling
ci/woodpecker/pr/config Pipeline was successful
ci/woodpecker/pr/web Pipeline was successful
ci/woodpecker/pr/worker Pipeline was successful
ci/woodpecker/push/config Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
ci/woodpecker/push/worker Pipeline was successful
eeaa386853
eleith merged commit eeaa386853 into main 2026-11-04 17:31:13 +00:00
eleith deleted branch fix/trusted-proxy 2026-11-04 17:31:13 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/hledger-web-reports#37