Skip to content

feat(tonic-xds): add A39 HTTP filter registry and router filter - #2815

Open
mingley wants to merge 2 commits into
grpc:masterfrom
mingley:mingley/a39-http-filter-registry
Open

feat(tonic-xds): add A39 HTTP filter registry and router filter#2815
mingley wants to merge 2 commits into
grpc:masterfrom
mingley:mingley/a39-http-filter-registry

Conversation

@mingley

@mingley mingley commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This implements gRFC A39.

What A39 does. The control plane can attach extra per-request rules to a gRPC client: delay this call, abort that one, and so on. Each rule is a labeled blob (name + proto type + bytes). The client keeps a dictionary of types it understands. Unknown required types reject the config; unknown optional types are ignored. Every filter list must end with the router filter, which is just a marker meaning "stop, now route."

What this PR does. It adds that dictionary to tonic-xds and teaches it to read one blob.

  • The only registered type is envoy.extensions.filters.http.router.v3.Router. We accept it and ignore its fields.
  • Two wrappers appear on the wire. FilterConfig is a box around the real config and can say "optional." TypedStruct is a box that only names the inner type. We unwrap both before looking in the dictionary.
  • Empty names, missing config, ConfigDiscovery, and disabled=true are rejected. Router overrides are rejected (the router has no override message).

It does not walk a listener's filter list, merge route overrides, or run anything on the request path.

What comes next.

  1. Parse HttpConnectionManager.http_filters on the Listener (empty list = implicit router).
  2. Parse typed_per_filter_config on virtual hosts, routes, and weighted clusters.
  3. Merge those layers (weighted cluster > route > virtual host > listener).
  4. Attach the merged list to the routing decision so later filters (fault injection, RBAC) can run.

Part of #2444.

Testing Done

  • cargo fmt -p tonic-xds -- --check
  • cargo clippy -p tonic-xds --all-targets --all-features -- -D warnings
  • cargo test -p tonic-xds --lib http_filter — 23 passed (4dcd1cf3)

Parse one HCM HttpFilter or RDS typed_per_filter_config Any: unwrap a
single FilterConfig (overrides only) and TypedStruct, look up the type,
and accept the terminal router filter. Nested wrappers NACK. Disabled
override config is recorded, not rejected.
@mingley
mingley force-pushed the mingley/a39-http-filter-registry branch from 102cfdd to 4dcd1cf Compare August 18, 2026 16:21
macOS check failed in job setup while loading actions/checkout@v6
(corrupt action.yml). Other macOS jobs in the same run succeeded.
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.

1 participant