Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: remove getAll() header map API and switch all usages to get() #13363

Merged
merged 12 commits into from
Oct 12, 2020
4 changes: 4 additions & 0 deletions api/envoy/api/v2/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ message Cluster {
// This header isn't sanitized by default, so enabling this feature allows HTTP clients to
// route traffic to arbitrary hosts and/or ports, which may have serious security
// consequences.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
bool use_http_header = 1;
}

Expand Down
8 changes: 8 additions & 0 deletions api/envoy/api/v2/route/route_components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,10 @@ message RouteAction {
//
// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
// *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string cluster_header = 2
[(validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];

Expand Down Expand Up @@ -866,6 +870,10 @@ message RouteAction {
//
// Pay attention to the potential security implications of using this option. Provided header
// must come from trusted source.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string auto_host_rewrite_header = 29 [
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
(udpa.annotations.field_migrate).rename = "host_rewrite_header"
Expand Down
4 changes: 4 additions & 0 deletions api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ message Cluster {
// This header isn't sanitized by default, so enabling this feature allows HTTP clients to
// route traffic to arbitrary hosts and/or ports, which may have serious security
// consequences.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
bool use_http_header = 1;
}

Expand Down
4 changes: 4 additions & 0 deletions api/envoy/config/cluster/v4alpha/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ message PerRouteConfig {
// :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.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string auto_host_rewrite_header = 2
[(udpa.annotations.field_migrate).rename = "host_rewrite_header"];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ message ScopedRoutes {
}

// The name of the header field to extract the value from.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string name = 1 [(validate.rules).string = {min_bytes: 1}];

// The element separator (e.g., ';' separates 'a;b;c;d').
Expand Down
14 changes: 14 additions & 0 deletions api/envoy/config/route/v3/route_components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ message RouteAction {
//
// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
// *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string cluster_header = 2
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];

Expand Down Expand Up @@ -917,6 +921,10 @@ message RouteAction {
//
// Pay attention to the potential security implications of using this option. Provided header
// must come from trusted source.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string host_rewrite_header = 29
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];

Expand Down Expand Up @@ -1146,9 +1154,15 @@ message RetryPolicy {
}

message ResetHeader {
// The name of the reset header.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string name = 1
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];

// The format of the reset header.
ResetHeaderFormat format = 2 [(validate.rules).enum = {defined_only: true}];
}

Expand Down
14 changes: 14 additions & 0 deletions api/envoy/config/route/v4alpha/route_components.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ message PerRouteConfig {
// :ref:`HCM host rewrite header <envoy_api_field_config.route.v3.RouteAction.auto_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.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string host_rewrite_header = 2;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,10 @@ message ScopedRoutes {
}

// The name of the header field to extract the value from.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string name = 1 [(validate.rules).string = {min_len: 1}];

// The element separator (e.g., ';' separates 'a;b;c;d').
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ci/filter_example_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -e

# This is the hash on https://github.com/envoyproxy/envoy-filter-example.git we pin to.
ENVOY_FILTER_EXAMPLE_GITSHA="493e2e5bee10bbed1c3c097e09d83d7f672a9f2e"
ENVOY_FILTER_EXAMPLE_GITSHA="bebd0b2422ea7739905f1793565681d7266491e6"
ENVOY_FILTER_EXAMPLE_SRCDIR="${BUILD_DIR}/envoy-filter-example"

# shellcheck disable=SC2034
Expand Down
10 changes: 7 additions & 3 deletions docs/root/configuration/http/http_filters/fault_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fault configuration. The currently supported header controls are:

x-envoy-fault-abort-request
HTTP status code to abort a request with. The header value should be an integer that specifies
the HTTP status code to return in response to a request and must be in the range [200, 600).
the HTTP status code to return in response to a request and must be in the range [200, 600).
In order for the header to work, :ref:`header_abort
<envoy_v3_api_field_extensions.filters.http.fault.v3.FaultAbort.header_abort>` needs to be set.

Expand All @@ -47,8 +47,8 @@ x-envoy-fault-abort-grpc-request
the gRPC status code to return in response to a request. Its value range is [0, UInt32.Max] instead of [0, 16]
to allow testing even not well-defined gRPC status codes. When this header is set, the HTTP response status code
will be set to 200. In order for the header to work, :ref:`header_abort
<envoy_api_field_config.filter.http.fault.v2.FaultAbort.header_abort>` needs to be set. If both
*x-envoy-fault-abort-request* and *x-envoy-fault-abort-grpc-request* headers are set then
<envoy_api_field_config.filter.http.fault.v2.FaultAbort.header_abort>` needs to be set. If both
*x-envoy-fault-abort-request* and *x-envoy-fault-abort-grpc-request* headers are set then
*x-envoy-fault-abort-grpc-request* header will be **ignored** and fault response http status code will be
set to *x-envoy-fault-abort-request* header value.

Expand Down Expand Up @@ -105,6 +105,10 @@ x-envoy-fault-throughput-response-percentage
<envoy_v3_api_field_extensions.filters.http.fault.v3.HTTPFault.max_active_faults>` setting to limit the
maximum concurrent faults that can be active at any given time.

.. note::

If the headers appear multiple times only the first value is used.

The following is an example configuration that enables header control for both of the above
options:

Expand Down
4 changes: 4 additions & 0 deletions generated_api_shadow/envoy/api/v2/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions generated_api_shadow/envoy/config/cluster/v3/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions generated_api_shadow/envoy/config/route/v3/route_components.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading