From c8457da634a07e68df0951bfbedf47a93c766d08 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Tue, 15 Jan 2019 18:05:09 +0000 Subject: [PATCH] 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 Mirrored from https://github.com/envoyproxy/envoy @ bbf5674c2c9a901ec4e964e4dd1d845516e672b2 --- envoy/api/v2/route/route.proto | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/envoy/api/v2/route/route.proto b/envoy/api/v2/route/route.proto index 9a8ec23c..884bdfc6 100644 --- a/envoy/api/v2/route/route.proto +++ b/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 ` behavior. + enum InternalRedirectAction { + PASS_THROUGH_INTERNAL_REDIRECT = 0; + HANDLE_INTERNAL_REDIRECT = 1; + } + InternalRedirectAction internal_redirect_action = 26; } // HTTP retry :ref:`architecture overview `.