dynamic proxy: add support for header based routing (#8869)

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>

Mirrored from https://github.com/envoyproxy/envoy @ 274f17cabe7f49f105c82919937ab710b9428261
master-ci-test
data-plane-api(CircleCI) 6 years ago
parent 32dfaebd2d
commit 1636f1abc3
  1. 4
      envoy/api/v2/route/route.proto
  2. 4
      envoy/api/v3alpha/route/route.proto
  3. 31
      envoy/config/filter/http/dynamic_forward_proxy/v2alpha/dynamic_forward_proxy.proto
  4. 32
      envoy/config/filter/http/dynamic_forward_proxy/v3alpha/dynamic_forward_proxy.proto

@ -727,6 +727,8 @@ message RouteAction {
oneof host_rewrite_specifier {
// Indicates that during forwarding, the host header will be swapped with
// this value.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 6;
// Indicates that during forwarding, the host header will be swapped with
@ -744,6 +746,8 @@ message RouteAction {
//
// Pay attention to the potential security implications of using this option. Provided header
// must come from trusted source.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 29;
}

@ -667,6 +667,8 @@ message RouteAction {
oneof host_rewrite_specifier {
// Indicates that during forwarding, the host header will be swapped with
// this value.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 6;
// Indicates that during forwarding, the host header will be swapped with
@ -684,6 +686,8 @@ message RouteAction {
//
// Pay attention to the potential security implications of using this option. Provided header
// must come from trusted source.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 29;
}

@ -24,8 +24,31 @@ message FilterConfig {
// Per route Configuration for the dynamic forward proxy HTTP filter.
message PerRouteConfig {
// Indicates that before DNS lookup, the host header will be swapped with
// this value. If not set or empty, the original host header value
// will be used and no rewrite will happen.
string host_rewrite = 1;
oneof host_rewrite_specifier {
// Indicates that before DNS lookup, the host header will be swapped with
// this value. If not set or empty, the original host header value
// will be used and no rewrite will happen.
//
// Note: this rewrite affects both DNS lookup and host header forwarding. However, this
// option shouldn't be used with
// :ref:`HCM host rewrite <envoy_api_field_route.RouteAction.host_rewrite>` given that the
// value set here would be used for DNS lookups whereas the value set in the HCM would be used
// for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 1;
// Indicates that before DNS lookup, the host header will be swapped with
// the value of this header. If not set or empty, the original host header
// value will be used and no rewrite will happen.
//
// Note: this rewrite affects both DNS lookup and host header forwarding. However, this
// option shouldn't be used with
// :ref:`HCM host rewrite header <envoy_api_field_route.RouteAction.auto_host_rewrite_header>`
// given that the value set here would be used for DNS lookups whereas the value set in the HCM
// would be used for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 2;
}
}

@ -24,8 +24,32 @@ message FilterConfig {
// Per route Configuration for the dynamic forward proxy HTTP filter.
message PerRouteConfig {
// Indicates that before DNS lookup, the host header will be swapped with
// this value. If not set or empty, the original host header value
// will be used and no rewrite will happen.
string host_rewrite = 1;
oneof host_rewrite_specifier {
// Indicates that before DNS lookup, the host header will be swapped with
// this value. If not set or empty, the original host header value
// will be used and no rewrite will happen.
//
// Note: this rewrite affects both DNS lookup and host header forwarding. However, this
// option shouldn't be used with
// :ref:`HCM host rewrite <envoy_api_field_api.v3alpha.route.RouteAction.host_rewrite>` given
// that the value set here would be used for DNS lookups whereas the value set in the HCM would
// be used for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 1;
// Indicates that before DNS lookup, the host header will be swapped with
// the value of this header. If not set or empty, the original host header
// value will be used and no rewrite will happen.
//
// Note: this rewrite affects both DNS lookup and host header forwarding. However, this
// option shouldn't be used with
// :ref:`HCM host rewrite header
// <envoy_api_field_api.v3alpha.route.RouteAction.auto_host_rewrite_header>` given that the
// value set here would be used for DNS lookups whereas the value set in the HCM would be used
// for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 2;
}
}

Loading…
Cancel
Save