route-adapter: write a body limit as the predecessor's buffering middleware #94

Merged
jschoubben merged 1 commits from feat/a-route-may-limit-the-body-it-carries into main 2026-09-26 14:02:04 +00:00
Owner

The catalogue half of the same setting; pairs with mesh-controller #68, and either lands alone.

The adapter's rule is that what its one file shape cannot say, it skips aloud — a backend over its own TLS, a path-scoped rule, a policy. A body limit is the exception, because the shape can say it: the predecessor has a buffering middleware and served its own registry name with exactly that. So the contribution's max-request-body is written out as that middleware, named after the router so the two halves cannot drift.

  • Silence stays silence: no middleware, the predecessor's default stands.
  • A limit that is not a whole positive number of bytes takes the route with it, named in skipped. Written without the limit, the predecessor would carry what the module said not to carry and this module would report success.
  • The reader returns three answers rather than two — a number, undefined for silence, null for unusable — so "said nothing" and "said something wrong" cannot become the same route.

Two new tests (11 total, all passing under npm test): the middleware is written for the route that asked and absent from the one that did not, and six shapes of bad limit are each skipped and named. README gained a section.

Taken from feat/registry-public-route rather than merging it: that branch also carries the distribution-gate module, which is not being built — hq issue 108 records why, and hq issue 123 the naming question underneath it. Only the adapter change was worth keeping, and main had since taught the adapter to say no to policies, which this builds on rather than reverting.

The catalogue half of the same setting; pairs with **mesh-controller #68**, and either lands alone. The adapter's rule is that what its one file shape cannot say, it skips aloud — a backend over its own TLS, a path-scoped rule, a policy. **A body limit is the exception, because the shape can say it:** the predecessor has a `buffering` middleware and served its own registry name with exactly that. So the contribution's `max-request-body` is written out as that middleware, named after the router so the two halves cannot drift. - Silence stays silence: no middleware, the predecessor's default stands. - A limit that is not a whole positive number of bytes takes the route with it, named in `skipped`. Written without the limit, the predecessor would carry what the module said not to carry and this module would report success. - The reader returns three answers rather than two — a number, `undefined` for silence, `null` for unusable — so "said nothing" and "said something wrong" cannot become the same route. Two new tests (11 total, all passing under `npm test`): the middleware is written for the route that asked and absent from the one that did not, and six shapes of bad limit are each skipped and named. README gained a section. Taken from `feat/registry-public-route` rather than merging it: that branch also carries the `distribution-gate` module, which is not being built — hq issue 108 records why, and hq issue 123 the naming question underneath it. Only the adapter change was worth keeping, and `main` had since taught the adapter to say no to policies, which this builds on rather than reverting.
jschoubben added 1 commit 2026-09-26 14:01:50 +00:00
The adapter skips what its one file shape cannot say. A body limit is the exception: the predecessor
has a buffering middleware and served its own registry name with exactly it, so this is written
rather than skipped, named after the router so the two halves cannot drift.

A limit that is not a whole positive number of bytes takes the route with it. Written without the
limit, the predecessor would carry what the module said not to carry and this module would report
success. Silence stays silence — no middleware, the predecessor's default.
jschoubben merged commit 36c5f87130 into main 2026-09-26 14:02:04 +00:00
jschoubben deleted branch feat/a-route-may-limit-the-body-it-carries 2026-09-26 14:02:04 +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: novox/mesh-catalog#94