Conversation
|
Heads up — This PR edits files in those directories, so it will need updating before it can Apologies for the churn, and thanks for the contribution. Happy to help work out |
Ports the request-hardening changes onto the unified proxy process (services/nvpair-proxy), one facade per engine: - 32 MiB cap on proxied request bodies (413 before routing) - Fail-closed peer transport when no certificate pin exists - Loopback-only local backend is now enforced at store time by setLocalBackend, which the unification made strictly stronger than the original read-time gate No versions.json change: release automation owns version bumps. Signed-off-by: Mallikh Kaula <mallikh@users.noreply.github.com>
The oversized-body test now unmarshals the 413 response and asserts the exact error payload instead of substring-matching, so the response can never silently stop being valid JSON. docs/proxy-request-hardening.mdx uses engine where the prose means the engine address rather than the set-local-backend wire name, and the sequence diagram shows the 413 payload as the JSON it is. Signed-off-by: Mallikh Kaula <mallikh@users.noreply.github.com>
c3244d8 to
7d1b4ad
Compare
|
Rebased onto the unified layout and pushed. The three hardening fixes are ported across to
Details in |
Changelog title
Proxy request hardening: 32 MiB body cap, loopback-only engine addresses, fail-closed peer TLS
Changelog body
Bumps
Summary
Rebased onto the unified
services/nvpair-proxy(the per-engineservices/ollama-proxy/services/lmstudio-proxydirectories are gone).The three hardening fixes are ported across:
bufferBodyAndModelreads throughio.LimitReader; over-cap bodies get a 413 JSON error before candidateselection or any engine work.
non-loopback hosts in
setLocalBackend()at store time; this addsregression coverage and documents the invariant.
transport whose dials always fail with
errPeerUnpinnedinstead of anunpinned transport.
Details in
docs/proxy-request-hardening.mdx.Test plan
go build ./...,go vet ./...— cleangofmt -l— cleango test -race -count=1 .— fullnvpair-proxysuite greenproxy_hardening_test.go:TestBufferBodyAndModelRejectsOversizedBody,TestHandleHTTPRejectsOversizedBody(asserts the exact 413 JSON payload),TestHandleHTTPAcceptsNormalBody,TestSetLocalBackendRejectsNonLoopback,TestPeerHTTPTransportFailsClosedWithoutPin