networknt / networknt/light-fabric

Upgrade Pingora after #816 release and remove local proxy patch

Open
#355 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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.rs
    • apps/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-fabric ordering: header policy/rate limiting first, bounded application body capture and HMAC/replay processing in request_filter(), then Session::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_body consumers 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 delete patches/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, and git 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-proxy crate 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.sh passes against the released upstream Pingora dependency.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.