Support CONNECT in atenet router - #715
Conversation
05577ee to
ab56e6e
Compare
|
Bowei Du (@bowei) to route networking PR |
|
Can you put the vendor change in its own commit (make it obvious) |
Consolidates the vendor/, go.mod, and go.sum changes needed for arbitrary-port CONNECT ingress support into a single commit.
…T terminate listener implementation Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
Agentgateway's ext_proc client reads only Value and ignores RawValue, silently applying our RawValue-only mutations as empty-string headers. This broke agentgateway's dynamic routing headers (x-ate-original-dst, X-Ate-Original-Host, :authority, X-Ate-Target-Port) and any immediate error response's content-type header. Newer Envoy versions drop Value in favor of RawValue, so both must be set to work on either dataplane.
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
168bdd4 to
d6ce656
Compare
|
Bowei Du (@bowei) good call - done |
Lior Lieberman (LiorLieberman)
left a comment
There was a problem hiding this comment.
Why do we need that network ext_proc? Can we resolve instead on the CONNECT itself. connect_terminate listener is already an HCM with no ext_proc on it - we can add the http ExtProc there.
What are the concerns with that?
| // TODO(router): authority is always empty today (see SubstrateMetadataNamespace's | ||
| // doc comment) -- dynamic metadata doesn't survive the connect_terminate -> | ||
| // main_internal internal-listener hop, and NetworkExternalProcessor has no | ||
| // filter-state-reading mechanism (no request_attributes) to fall back on the | ||
| // way the HTTP leg's handleRequestHeaders does. Until Envoy adds one, every | ||
| // CONNECT scenario that reaches this raw TCP leg -- non-HTTP payloads, and any | ||
| // TLS-wrapped payload per buildMainInternalListener's transport-protocol | ||
| // match -- fails here. |
There was a problem hiding this comment.
not sure I understand that. Can you elaborate?
AFAIU the metadata fails to cross the hop likely because passthrough_metadata only forwards static Host/Cluster metadata and never carried the value in the first place. I dont think its a NetworkExternalProcessor gap. Unless I am missing something
There was a problem hiding this comment.
I call it a NetworkExternalProcessor gap because its HTTP equivalent has a way to pass filter state to the extproc proc server and we use that to get the original CONNECT authority over there. Because request level metadata isn't passed through the internal listener transport socket; we can't use metadata to propagate it; we have to use filter state. So the requirements for the Envoy team is to be either allow internal listeners to propagate request metadata OR to allow network extproc to pass filter state via connection attributes. The same limitation applies to network ext auth btw
|
Lior Lieberman (@LiorLieberman) at connect_terminate, we don't know whether the CONNECT is tunneling HTTP or not and we want different behavior depending on the inner protocol. If it's HTTP, we want to hit the ext proc on every request so that we Resume. If it's just TCP, we only want to hit the extproc once (on connection establishment). But we don't know which one we want until we get to main_internal and sniff the protocol of the CONNECT tunnel's contents. |
CI's hack/verify/gofmt.sh flagged this after the previous commit added fields without re-running gofmt.
Fixes #689, #265 and starts to address #484. Modifies the ate router to:
#484 is currently blocked because Envoy's implementation of NetworkExternalProcessor doesn't support passing filter state to the extproc server. Dynamic metadata doesn't work because only Host (i.e. endpoint) and cluster metadata can propagate across internal listeners (a necessary implementation detail of doing CONNECT in Envoy). This PR still adds the xDS for it; the extproc calls just fail because there's no metadata.
Open questions:
Tested 6 scenarios locally:
Once #652 merges, I can add the agentgateway implementationAdded and tested agentgateway implementation as well