Skip to content

feat: production hardening (hop admission, reload, defaults) - #15

Merged
gitctrlx merged 3 commits into
mainfrom
feat/production-hardening
Aug 9, 2026
Merged

feat: production hardening (hop admission, reload, defaults)#15
gitctrlx merged 3 commits into
mainfrom
feat/production-hardening

Conversation

@gitctrlx

@gitctrlx gitctrlx commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

Production-hardening pass for open-internet CORS proxy safety and operability:

  • Per-hop admission: TargetPolicy + circuit on every redirect hop; CircuitHop RAII settles failure on cancel so half-open cannot stick forever
  • Hot reload: retain circuit / GCRA maps when those config sections are unchanged; reject more immutable limit knobs (header / inflight / max_response_body)
  • Config (breaking): limits.inflight_max (moved from rate_limit.global), limits.max_response_body_bytes, rate_limit.enabled default true, rate_limit.max_keys, circuit_breaker.max_hosts
  • CORS / resilience: CORS outside timeout/body so 504/413 get ACAO; CatchPanic; load-shed RAII; client-safe error messages; Location rewrite for redirect_policy = rewrite

Breaking

  • Remove rate_limit.global.inflight_max → use limits.inflight_max
  • rate_limit.enabled defaults to true
  • Redirect follow respects target allowlist/denylist on every hop
  • Public error JSON message is kind-stable (no internal DNS/connect detail)
  • CircuitDecision removed; CircuitBreaker::checkResult<(), ProxyError>

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • Integration: redirect allowlist reject/admit, Location rewrite, client-safe errors
  • Unit: circuit hop guard drop-failure, max_keys, hot-reload retains open circuit

Enforce target policy and circuit accounting on every redirect hop with
CircuitHop RAII so cancelled probes cannot stick half-open. Retain
circuit/rate state across SIGHUP when those sections are unchanged.
Move inflight to limits, enable GCRA by default, cap response body and
keyed map cardinality, and stamp CORS outside timeout/body layers.
Copilot AI lite review requested due to automatic review settings August 9, 2026 06:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitctrlx
gitctrlx merged commit 834a996 into main Aug 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants