http: adding per-route internal redirects (#5123)

Allows both upstream-driven and filter-controlled internal redirects, basically rerunning the whole filter chain for a new stream.

The current implementation is limited to requests-sans-bodies and complete-requests, and num-redirects = 1, but could be fairly easily extended (probably in a follow-up) to remove any of these restrictions.

I do need to add more unit tests here, but I want to make sure we're happy both the validation we're doing and where we do it. For example while this implementation forces N=1 for upstream internal redirects it allows filters to impose their own separate limits and allows them to screw up w.r.t. redirect loops. We could globally enforce by disallowing recreateStream if is_internally_created_ true but I could imagine wanting different limits for a filter redirect than an external redirect so am mildly inclined to allow filters to enforce on their own with internal checks as the router filter does.

TODO(alyssawilk) in a follow-up before killing off the initial stream, pass it the original StreamInfo and copy relevant fields (downstream timing info etc.)

Risk Level: Medium (some refactors of existing code, new high risk code paths well guarded)
Testing: E2E tests. E_INSUFFICIENT_UNIT_TESTS
Docs Changes: inline
Release Notes: yep.
Part of #3250

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>

Mirrored from https://github.com/envoyproxy/envoy @ bbf5674c2c9a901ec4e964e4dd1d845516e672b2
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent aaa4989f17
commit c8457da634
  1. 9
      envoy/api/v2/route/route.proto

@ -440,7 +440,7 @@ message CorsPolicy {
core.RuntimeFractionalPercent shadow_enabled = 10;
}
// [#comment:next free field: 26]
// [#comment:next free field: 27]
message RouteAction {
oneof cluster_specifier {
option (validate.required) = true;
@ -772,6 +772,13 @@ message RouteAction {
google.protobuf.BoolValue enabled = 2;
};
repeated UpgradeConfig upgrade_configs = 25;
// Configures :ref:`internal redirect <arch_overview_internal_redirects>` behavior.
enum InternalRedirectAction {
PASS_THROUGH_INTERNAL_REDIRECT = 0;
HANDLE_INTERNAL_REDIRECT = 1;
}
InternalRedirectAction internal_redirect_action = 26;
}
// HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`.

Loading…
Cancel
Save