networknt / networknt/light-fabric
Upgrade Pingora after #816 release and remove local proxy patch
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1
- Forks
- 1
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 2
Description
Purpose
light-fabric currently patches/vendored pingora-proxy 0.8.1 so a fully consumed, verified request body can be supplied after header-phase authentication and then forwarded through Pingora's normal HTTP/1.1, HTTP/2, body-filter, and retry paths.
Upstream Cloudflare Pingora PR #816 is expected to provide the equivalent supported lifecycle. The light-fabric integration requirement and intended migration path are recorded in this PR #816 comment.
Application-managed buffering regression coverage was contributed in CodyPubNub/pingora PR #1. That test leaves automatic early buffering disabled, consumes the body in request_filter(), calls Session::set_buffered_body(), verifies normal request_body_filter() execution and exact upstream bytes, and forces a retry to prove replay works.
Current local patch
- Workspace override:
Cargo.toml[patch.crates-io] pingora-proxy = { path = "patches/pingora-proxy" } - Vendored crate:
patches/pingora-proxy/ - Local callback:
ProxyHttp::prebuffered_request_body - Consumers:
apps/hmac-phase0-spikes/src/main.rsapps/light-gateway/src/main.rs
- Background:
patches/pingora-proxy/README.light-fabric.md
Do not remove this patch merely because #816 merges. Wait for an official Pingora release that contains the required behavior, and confirm the application-managed set_buffered_body() contract and regression remain present in that release.
Upgrade and removal checklist
- Confirm Cloudflare Pingora PR #816 is merged and identify the first official Pingora release containing it.
- Confirm the released implementation supports the
light-fabricordering: header policy/rate limiting first, bounded application body capture and HMAC/replay processing inrequest_filter(), thenSession::set_buffered_body(). - Confirm application-supplied bodies traverse normal
request_body_filter(), HTTP/1.1 and HTTP/2 forwarding, and retry replay. Use the contributed regression as the minimum contract. - Upgrade all Pingora dependencies together to the selected release and update
Cargo.lock. - Enable the upstream Cargo feature/API required for early or application-managed body buffering without opting into automatic pre-
request_filter()buffering. - Replace both
prebuffered_request_bodyconsumers with the released upstream API while preserving HMAC ordering, per-profile body timeout, exact-body verification, aggregate buffer accounting, and fail-closed behavior. - Remove the root
[patch.crates-io]override and deletepatches/pingora-proxy/only after the upstream implementation passes all gates. - Verify
rg 'prebuffered_request_body|patches/pingora-proxy'has no unintended runtime references. - Run the cumulative HMAC gate:
./scripts/run-hmac-phase4-gates.sh(this includes phases 0 through 3,light-pingora,light-gateway, clippy, docs, cross-runtime fixtures, live Redis, formatting, andgit diff --check). - Re-run any upstream Pingora regression supplied by the selected release, including the application-managed buffering/retry case.
- Update the HMAC design/operations documentation and close this issue with the Pingora version, upstream commit/release, removed patch paths, and gate evidence.
Acceptance criteria
- No local
pingora-proxycrate override or vendored patch remains. - Standalone and Unified Security HMAC flows retain their current ordering and exact-body behavior.
- Application-managed buffered bodies work for HTTP/1.1, HTTP/2, normal body filters, and upstream retries.
./scripts/run-hmac-phase4-gates.shpasses against the released upstream Pingora dependency.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
First confirm the Pingora release containing Cloudflare PR #816 and compare its buffering and retry behavior with the regression described in CodyPubNub/pingora PR #1. Review Cargo.toml, patches/pingora-proxy/, apps/hmac-phase0-spikes/src/main.rs, and apps/light-gateway/src/main.rs, then update dependencies and remove the patch while preserving the documented HMAC ordering and buffering contract. Run ./scripts/run-hmac-phase4-gates.sh and verify no unintended references remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100