HTTP hooks · NVIDIA/OpenShell#4359 1 / 6
Reviewer walkthrough · supervisor middleware

HTTP hooks: streaming request and response middleware

The PR replaces the legacy HTTP middleware hooks with two bidirectional streaming RPCs, so middleware can inspect and rewrite bodies of any size, set headers from what it read in the body, and process response streams without lockstep.

  • Streaming APIHttpHooks.EvaluateRequest and EvaluateResponse, one stream per HTTP message and stage. A preflight picks continue, deny, or inspect (WHOLE_BODY or DUPLEX).
  • Opt in by capabilitySame HTTP_REQUEST / HTTP_RESPONSE bindings. A service that requires openshell.supervisor-middleware.http-hooks gets the new RPCs. No new HTTP operations or versioned enums.
  • Always fail-closedon_error: fail_open is rejected for HTTP hook services.
  • Uninspectable traffic unchangedtls: skip, h2c, and raw TCP connections never reach middleware. As on main, a selected fail_closed entry refuses them.
  • No ports in selectorsSelector patterns that contain : are rejected, except IPv6 literals. A host:port pattern never matched anything.
  • Legacy hooks deprecatedEvaluateHttpRequest and HttpResponsePreReturn keep working and are removed in 0.2.0.
github.com/NVIDIA/OpenShell/pull/4359

In this deck

  1. Why a new API
  2. Before and after
  3. Shape of the new API
  4. How a service selects the hook version
  5. Migrating a legacy service
  6. Next iterations
  7. Preflight and body eligibility rules
  8. Chain ordering and when the head commits
  9. DUPLEX stalls and deadlines
  10. Failure semantics per phase
  11. Code map for the diff