Repository navigation
Conversation
- New hook ForwardedHeaderRefusal (ProxyServer::with_forwarded_header_refusal, TranscodeOptions::with_forwarded_header_refusal): for a transcoded request refused because a forwarded header carries a value gRPC metadata cannot carry, it gets the request view and the header's name and returns a RouteResponse, or None for the default INVALID_ARGUMENT body - The request is refused whatever the hook answers; the upstream is never called and the hook has no way to forward the value - Without the hook the behaviour and body are unchanged - The forwarded metadata is now built in `start`, where the request line is known, so the hook sees the method, path and query as received Why: a route whose protocol has its own error format (an RFC 9449 token endpoint answering `invalid_dpop_proof`) could not give that answer, since the request never reached its handler and no hook was consulted. Closes #177
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
## 🤖 New release
* `structured-proxy`: 8.2.0 -> 9.0.0 (⚠ API breaking changes)
### ⚠ `structured-proxy` breaking changes
```text
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type TranscodeOptions is no longer UnwindSafe, in /tmp/.tmplUABYd/structured-proxy/src/transcode/mod.rs:207
type TranscodeOptions is no longer RefUnwindSafe, in /tmp/.tmplUABYd/structured-proxy/src/transcode/mod.rs:207
```
<details><summary><i><b>Changelog</b></i></summary><p>
<blockquote>
##
[9.0.0](v8.2.0...v9.0.0)
- 2026-12-01
### Added
- *(hooks)* let the embedder answer a refused forwarded header
([#178](#178))
### Other
- *(deps)* bump taiki-e/install-action from 2.90.3 to 2.90.8
([#175](#175))
</blockquote>
</p></details>
---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
Co-authored-by: sw-release-bot[bot] <255865126+sw-release-bot[bot]@users.noreply.github.com>
Summary
ForwardedHeaderRefusal(ProxyServer::with_forwarded_header_refusal,TranscodeOptions::with_forwarded_header_refusal). When a transcoded request is refused because a header inforwarded_headerscarries a value gRPC metadata cannot carry (empty, outside visible ASCII, bad base64 under a-binname), the hook receives the request view (RequestParts: method, path and query as received, headers, resolved client address) and the refused header's name, and returns aRouteResponse(status, headers, body) orNonefor the default body.INVALID_ARGUMENT(400) body are unchanged.Why: a route whose protocol has its own error format could not give that format's answer, because the request never reached its handler and no hook was consulted. An OAuth token endpoint behind the transcoder must answer an empty
DPoPheader with 400 and{"error":"invalid_dpop_proof"}(RFC 9449 section 5, RFC 6749 section 5.2).Testing
cargo nextest run --all-features: intests/forwarded_headers.rs, each case against a remote and an in-process upstream:Content-Typeand body; the hook saw the method, path, query and header name;None) leaves the generic body;The upstream's call count is 0 in every refused case.
cargo test --doc(hook example),cargo clippy --all-targets -D warningswith all features and with no default features,cargo fmt --check,cargo doc -D warnings.Closes #177