async-grpc-xds 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/fixtures/async/grpc/test_interface.rb +79 -0
- data/fixtures/async/grpc/test_message.rb +56 -0
- data/lib/async/grpc/xds/ads_stream.rb +70 -0
- data/lib/async/grpc/xds/client.rb +255 -0
- data/lib/async/grpc/xds/context.rb +201 -0
- data/lib/async/grpc/xds/control_plane.rb +143 -0
- data/lib/async/grpc/xds/discovery_client.rb +356 -0
- data/lib/async/grpc/xds/health_checker.rb +88 -0
- data/lib/async/grpc/xds/load_balancer.rb +196 -0
- data/lib/async/grpc/xds/resource_builder.rb +138 -0
- data/lib/async/grpc/xds/resource_cache.rb +55 -0
- data/lib/async/grpc/xds/resources.rb +270 -0
- data/lib/async/grpc/xds/server.rb +34 -0
- data/lib/async/grpc/xds/service.rb +117 -0
- data/lib/async/grpc/xds/version.rb +12 -0
- data/lib/async/grpc/xds.rb +42 -0
- data/lib/envoy/annotations/deprecation_pb.rb +19 -0
- data/lib/envoy/config/cluster/v3/circuit_breaker_pb.rb +31 -0
- data/lib/envoy/config/cluster/v3/cluster_pb.rb +80 -0
- data/lib/envoy/config/cluster/v3/filter_pb.rb +28 -0
- data/lib/envoy/config/cluster/v3/outlier_detection_pb.rb +29 -0
- data/lib/envoy/config/core/v3/address_pb.rb +38 -0
- data/lib/envoy/config/core/v3/backoff_pb.rb +27 -0
- data/lib/envoy/config/core/v3/base_pb.rb +68 -0
- data/lib/envoy/config/core/v3/cel_pb.rb +24 -0
- data/lib/envoy/config/core/v3/config_source_pb.rb +42 -0
- data/lib/envoy/config/core/v3/event_service_config_pb.rb +27 -0
- data/lib/envoy/config/core/v3/extension_pb.rb +26 -0
- data/lib/envoy/config/core/v3/grpc_method_list_pb.rb +27 -0
- data/lib/envoy/config/core/v3/grpc_service_pb.rb +45 -0
- data/lib/envoy/config/core/v3/health_check_pb.rb +47 -0
- data/lib/envoy/config/core/v3/http_service_pb.rb +27 -0
- data/lib/envoy/config/core/v3/http_uri_pb.rb +27 -0
- data/lib/envoy/config/core/v3/protocol_pb.rb +51 -0
- data/lib/envoy/config/core/v3/proxy_protocol_pb.rb +31 -0
- data/lib/envoy/config/core/v3/resolver_pb.rb +27 -0
- data/lib/envoy/config/core/v3/socket_cmsg_headers_pb.rb +25 -0
- data/lib/envoy/config/core/v3/socket_option_pb.rb +31 -0
- data/lib/envoy/config/core/v3/substitution_format_string_pb.rb +30 -0
- data/lib/envoy/config/core/v3/udp_socket_config_pb.rb +26 -0
- data/lib/envoy/config/endpoint/v3/endpoint_components_pb.rb +40 -0
- data/lib/envoy/config/endpoint/v3/endpoint_pb.rb +32 -0
- data/lib/envoy/config/endpoint/v3/load_report_pb.rb +36 -0
- data/lib/envoy/service/discovery/v3/ads_pb.rb +26 -0
- data/lib/envoy/service/discovery/v3/aggregated_discovery_service.rb +64 -0
- data/lib/envoy/service/discovery/v3/discovery_pb.rb +42 -0
- data/lib/envoy/type/matcher/v3/address_pb.rb +25 -0
- data/lib/envoy/type/matcher/v3/filter_state_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/http_inputs_pb.rb +29 -0
- data/lib/envoy/type/matcher/v3/metadata_pb.rb +28 -0
- data/lib/envoy/type/matcher/v3/node_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/number_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/path_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/regex_pb.rb +30 -0
- data/lib/envoy/type/matcher/v3/status_code_input_pb.rb +25 -0
- data/lib/envoy/type/matcher/v3/string_pb.rb +29 -0
- data/lib/envoy/type/matcher/v3/struct_pb.rb +28 -0
- data/lib/envoy/type/matcher/v3/value_pb.rb +31 -0
- data/lib/envoy/type/metadata/v3/metadata_pb.rb +32 -0
- data/lib/envoy/type/v3/hash_policy_pb.rb +26 -0
- data/lib/envoy/type/v3/http_pb.rb +22 -0
- data/lib/envoy/type/v3/http_status_pb.rb +25 -0
- data/lib/envoy/type/v3/percent_pb.rb +26 -0
- data/lib/envoy/type/v3/range_pb.rb +25 -0
- data/lib/envoy/type/v3/ratelimit_strategy_pb.rb +28 -0
- data/lib/envoy/type/v3/ratelimit_unit_pb.rb +22 -0
- data/lib/envoy/type/v3/semantic_version_pb.rb +23 -0
- data/lib/envoy/type/v3/token_bucket_pb.rb +26 -0
- data/lib/envoy.rb +83 -0
- data/lib/google/protobuf/any_pb.rb +18 -0
- data/lib/google/protobuf/duration_pb.rb +18 -0
- data/lib/google/protobuf/empty_pb.rb +18 -0
- data/lib/google/protobuf/struct_pb.rb +21 -0
- data/lib/google/protobuf/timestamp_pb.rb +18 -0
- data/lib/google/protobuf/wrappers_pb.rb +26 -0
- data/lib/google/rpc/status_pb.rb +20 -0
- data/lib/udpa/annotations/migrate_pb.rb +22 -0
- data/lib/udpa/annotations/security_pb.rb +23 -0
- data/lib/udpa/annotations/sensitive_pb.rb +19 -0
- data/lib/udpa/annotations/status_pb.rb +21 -0
- data/lib/udpa/annotations/versioning_pb.rb +20 -0
- data/lib/validate/validate_pb.rb +43 -0
- data/lib/xds/annotations/v3/status_pb.rb +26 -0
- data/lib/xds/core/v3/authority_pb.rb +23 -0
- data/lib/xds/core/v3/cidr_pb.rb +24 -0
- data/lib/xds/core/v3/collection_entry_pb.rb +26 -0
- data/lib/xds/core/v3/context_params_pb.rb +22 -0
- data/lib/xds/core/v3/extension_pb.rb +23 -0
- data/lib/xds/core/v3/resource_locator_pb.rb +26 -0
- data/lib/xds/core/v3/resource_name_pb.rb +24 -0
- data/lib/xds/core/v3/resource_pb.rb +24 -0
- data/lib/xds/type/matcher/v3/domain_pb.rb +27 -0
- data/lib/xds/type/matcher/v3/http_inputs_pb.rb +22 -0
- data/lib/xds/type/matcher/v3/ip_pb.rb +28 -0
- data/lib/xds/type/matcher/v3/matcher_pb.rb +34 -0
- data/lib/xds/type/matcher/v3/range_pb.rb +31 -0
- data/lib/xds/type/matcher/v3/regex_pb.rb +25 -0
- data/lib/xds/type/matcher/v3/string_pb.rb +27 -0
- data/license.md +21 -0
- data/plan.md +156 -0
- data/proto/envoy/annotations/deprecation.proto +34 -0
- data/proto/envoy/annotations/resource.proto +19 -0
- data/proto/envoy/config/README.md +3 -0
- data/proto/envoy/config/cluster/v3/BUILD +18 -0
- data/proto/envoy/config/cluster/v3/circuit_breaker.proto +121 -0
- data/proto/envoy/config/cluster/v3/cluster.proto +1407 -0
- data/proto/envoy/config/cluster/v3/filter.proto +40 -0
- data/proto/envoy/config/cluster/v3/outlier_detection.proto +180 -0
- data/proto/envoy/config/core/v3/BUILD +16 -0
- data/proto/envoy/config/core/v3/address.proto +214 -0
- data/proto/envoy/config/core/v3/backoff.proto +37 -0
- data/proto/envoy/config/core/v3/base.proto +662 -0
- data/proto/envoy/config/core/v3/cel.proto +63 -0
- data/proto/envoy/config/core/v3/config_source.proto +283 -0
- data/proto/envoy/config/core/v3/event_service_config.proto +29 -0
- data/proto/envoy/config/core/v3/extension.proto +32 -0
- data/proto/envoy/config/core/v3/grpc_method_list.proto +33 -0
- data/proto/envoy/config/core/v3/grpc_service.proto +355 -0
- data/proto/envoy/config/core/v3/health_check.proto +443 -0
- data/proto/envoy/config/core/v3/http_service.proto +35 -0
- data/proto/envoy/config/core/v3/http_uri.proto +58 -0
- data/proto/envoy/config/core/v3/protocol.proto +807 -0
- data/proto/envoy/config/core/v3/proxy_protocol.proto +114 -0
- data/proto/envoy/config/core/v3/resolver.proto +36 -0
- data/proto/envoy/config/core/v3/socket_cmsg_headers.proto +28 -0
- data/proto/envoy/config/core/v3/socket_option.proto +108 -0
- data/proto/envoy/config/core/v3/substitution_format_string.proto +136 -0
- data/proto/envoy/config/core/v3/udp_socket_config.proto +32 -0
- data/proto/envoy/config/endpoint/v3/BUILD +16 -0
- data/proto/envoy/config/endpoint/v3/endpoint.proto +137 -0
- data/proto/envoy/config/endpoint/v3/endpoint_components.proto +229 -0
- data/proto/envoy/config/endpoint/v3/load_report.proto +220 -0
- data/proto/envoy/config/listener/v3/BUILD +18 -0
- data/proto/envoy/config/listener/v3/api_listener.proto +34 -0
- data/proto/envoy/config/listener/v3/listener.proto +455 -0
- data/proto/envoy/config/listener/v3/listener_components.proto +353 -0
- data/proto/envoy/config/listener/v3/quic_config.proto +108 -0
- data/proto/envoy/config/listener/v3/udp_listener_config.proto +52 -0
- data/proto/envoy/config/route/v3/BUILD +19 -0
- data/proto/envoy/config/route/v3/route.proto +172 -0
- data/proto/envoy/config/route/v3/route_components.proto +2918 -0
- data/proto/envoy/config/route/v3/scoped_route.proto +133 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/BUILD +14 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/cert.proto +12 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/common.proto +597 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/secret.proto +61 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/tls.proto +366 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto +67 -0
- data/proto/envoy/service/README.md +3 -0
- data/proto/envoy/service/discovery/v3/BUILD +13 -0
- data/proto/envoy/service/discovery/v3/ads.proto +44 -0
- data/proto/envoy/service/discovery/v3/discovery.proto +443 -0
- data/proto/envoy/type/BUILD +9 -0
- data/proto/envoy/type/hash_policy.proto +28 -0
- data/proto/envoy/type/http.proto +24 -0
- data/proto/envoy/type/http_status.proto +140 -0
- data/proto/envoy/type/matcher/v3/address.proto +22 -0
- data/proto/envoy/type/matcher/v3/filter_state.proto +33 -0
- data/proto/envoy/type/matcher/v3/http_inputs.proto +71 -0
- data/proto/envoy/type/matcher/v3/metadata.proto +110 -0
- data/proto/envoy/type/matcher/v3/node.proto +29 -0
- data/proto/envoy/type/matcher/v3/number.proto +33 -0
- data/proto/envoy/type/matcher/v3/path.proto +31 -0
- data/proto/envoy/type/matcher/v3/regex.proto +97 -0
- data/proto/envoy/type/matcher/v3/status_code_input.proto +23 -0
- data/proto/envoy/type/matcher/v3/string.proto +94 -0
- data/proto/envoy/type/matcher/v3/struct.proto +91 -0
- data/proto/envoy/type/matcher/v3/value.proto +80 -0
- data/proto/envoy/type/metadata/v3/metadata.proto +117 -0
- data/proto/envoy/type/percent.proto +52 -0
- data/proto/envoy/type/range.proto +43 -0
- data/proto/envoy/type/semantic_version.proto +24 -0
- data/proto/envoy/type/token_bucket.proto +36 -0
- data/proto/envoy/type/v3/BUILD +12 -0
- data/proto/envoy/type/v3/hash_policy.proto +43 -0
- data/proto/envoy/type/v3/http.proto +24 -0
- data/proto/envoy/type/v3/http_status.proto +199 -0
- data/proto/envoy/type/v3/percent.proto +57 -0
- data/proto/envoy/type/v3/range.proto +50 -0
- data/proto/envoy/type/v3/ratelimit_strategy.proto +79 -0
- data/proto/envoy/type/v3/ratelimit_unit.proto +37 -0
- data/proto/envoy/type/v3/semantic_version.proto +27 -0
- data/proto/envoy/type/v3/token_bucket.proto +39 -0
- data/proto/google/protobuf/any.proto +162 -0
- data/proto/google/protobuf/duration.proto +115 -0
- data/proto/google/protobuf/empty.proto +51 -0
- data/proto/google/protobuf/struct.proto +95 -0
- data/proto/google/protobuf/timestamp.proto +145 -0
- data/proto/google/protobuf/wrappers.proto +157 -0
- data/proto/google/rpc/status.proto +47 -0
- data/proto/readme.md +70 -0
- data/proto/udpa/annotations/migrate.proto +49 -0
- data/proto/udpa/annotations/security.proto +31 -0
- data/proto/udpa/annotations/sensitive.proto +14 -0
- data/proto/udpa/annotations/status.proto +34 -0
- data/proto/udpa/annotations/versioning.proto +17 -0
- data/proto/validate/validate.proto +862 -0
- data/proto/xds/annotations/v3/migrate.proto +46 -0
- data/proto/xds/annotations/v3/security.proto +30 -0
- data/proto/xds/annotations/v3/sensitive.proto +16 -0
- data/proto/xds/annotations/v3/status.proto +59 -0
- data/proto/xds/annotations/v3/versioning.proto +20 -0
- data/proto/xds/core/v3/authority.proto +22 -0
- data/proto/xds/core/v3/cidr.proto +25 -0
- data/proto/xds/core/v3/collection_entry.proto +55 -0
- data/proto/xds/core/v3/context_params.proto +23 -0
- data/proto/xds/core/v3/extension.proto +26 -0
- data/proto/xds/core/v3/resource.proto +29 -0
- data/proto/xds/core/v3/resource_locator.proto +118 -0
- data/proto/xds/core/v3/resource_name.proto +42 -0
- data/proto/xds/type/matcher/v3/cel.proto +37 -0
- data/proto/xds/type/matcher/v3/domain.proto +46 -0
- data/proto/xds/type/matcher/v3/http_inputs.proto +23 -0
- data/proto/xds/type/matcher/v3/ip.proto +53 -0
- data/proto/xds/type/matcher/v3/matcher.proto +144 -0
- data/proto/xds/type/matcher/v3/range.proto +69 -0
- data/proto/xds/type/matcher/v3/regex.proto +46 -0
- data/proto/xds/type/matcher/v3/string.proto +71 -0
- data/proto/xds/type/v3/cel.proto +77 -0
- data/proto/xds/type/v3/range.proto +40 -0
- data/proto/xds/type/v3/typed_struct.proto +44 -0
- data/readme.md +37 -0
- data/releases.md +5 -0
- data/xds/Dockerfile.backend +24 -0
- data/xds/Dockerfile.control-plane +22 -0
- data/xds/backend_server.rb +68 -0
- data/xds/docker-compose.yaml +89 -0
- data/xds/go.mod +22 -0
- data/xds/go.sum +82 -0
- data/xds/readme.md +122 -0
- data/xds/test/async/grpc/xds/client.rb +294 -0
- data/xds/test/async/grpc/xds/control_plane.rb +94 -0
- data/xds/test_server.go +355 -0
- data/xds/update_protos.sh +123 -0
- data.tar.gz.sig +0 -0
- metadata +386 -0
- metadata.gz.sig +2 -0
|
@@ -0,0 +1,2918 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.config.route.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/config/common/mutation_rules/v3/mutation_rules.proto";
|
|
6
|
+
import "envoy/config/core/v3/base.proto";
|
|
7
|
+
import "envoy/config/core/v3/extension.proto";
|
|
8
|
+
import "envoy/config/core/v3/proxy_protocol.proto";
|
|
9
|
+
import "envoy/config/core/v3/substitution_format_string.proto";
|
|
10
|
+
import "envoy/type/matcher/v3/filter_state.proto";
|
|
11
|
+
import "envoy/type/matcher/v3/metadata.proto";
|
|
12
|
+
import "envoy/type/matcher/v3/regex.proto";
|
|
13
|
+
import "envoy/type/matcher/v3/string.proto";
|
|
14
|
+
import "envoy/type/metadata/v3/metadata.proto";
|
|
15
|
+
import "envoy/type/tracing/v3/custom_tag.proto";
|
|
16
|
+
import "envoy/type/v3/percent.proto";
|
|
17
|
+
import "envoy/type/v3/range.proto";
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/any.proto";
|
|
20
|
+
import "google/protobuf/duration.proto";
|
|
21
|
+
import "google/protobuf/wrappers.proto";
|
|
22
|
+
|
|
23
|
+
import "xds/type/matcher/v3/matcher.proto";
|
|
24
|
+
|
|
25
|
+
import "envoy/annotations/deprecation.proto";
|
|
26
|
+
import "udpa/annotations/migrate.proto";
|
|
27
|
+
import "udpa/annotations/status.proto";
|
|
28
|
+
import "udpa/annotations/versioning.proto";
|
|
29
|
+
import "validate/validate.proto";
|
|
30
|
+
|
|
31
|
+
option java_package = "io.envoyproxy.envoy.config.route.v3";
|
|
32
|
+
option java_outer_classname = "RouteComponentsProto";
|
|
33
|
+
option java_multiple_files = true;
|
|
34
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/route/v3;routev3";
|
|
35
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
36
|
+
|
|
37
|
+
// [#protodoc-title: HTTP route components]
|
|
38
|
+
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
|
|
39
|
+
// * HTTP :ref:`router filter <config_http_filters_router>`
|
|
40
|
+
|
|
41
|
+
// The top level element in the routing configuration is a virtual host. Each virtual host has
|
|
42
|
+
// a logical name as well as a set of domains that get routed to it based on the incoming request's
|
|
43
|
+
// host header. This allows a single listener to service multiple top level domain path trees. Once
|
|
44
|
+
// a virtual host is selected based on the domain, the routes are processed in order to see which
|
|
45
|
+
// upstream cluster to route to or whether to perform a redirect.
|
|
46
|
+
// [#next-free-field: 26]
|
|
47
|
+
message VirtualHost {
|
|
48
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.VirtualHost";
|
|
49
|
+
|
|
50
|
+
enum TlsRequirementType {
|
|
51
|
+
// No TLS requirement for the virtual host.
|
|
52
|
+
NONE = 0;
|
|
53
|
+
|
|
54
|
+
// External requests must use TLS. If a request is external and it is not
|
|
55
|
+
// using TLS, a 301 redirect will be sent telling the client to use HTTPS.
|
|
56
|
+
EXTERNAL_ONLY = 1;
|
|
57
|
+
|
|
58
|
+
// All requests must use TLS. If a request is not using TLS, a 301 redirect
|
|
59
|
+
// will be sent telling the client to use HTTPS.
|
|
60
|
+
ALL = 2;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
reserved 9, 12;
|
|
64
|
+
|
|
65
|
+
reserved "per_filter_config";
|
|
66
|
+
|
|
67
|
+
// The logical name of the virtual host. This is used when emitting certain
|
|
68
|
+
// statistics but is not relevant for routing.
|
|
69
|
+
string name = 1 [(validate.rules).string = {min_len: 1}];
|
|
70
|
+
|
|
71
|
+
// A list of domains (host/authority header) that will be matched to this
|
|
72
|
+
// virtual host. Wildcard hosts are supported in the suffix or prefix form.
|
|
73
|
+
//
|
|
74
|
+
// Domain search order:
|
|
75
|
+
// 1. Exact domain names: ``www.foo.com``.
|
|
76
|
+
// 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``.
|
|
77
|
+
// 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``.
|
|
78
|
+
// 4. Special wildcard ``*`` matching any domain.
|
|
79
|
+
//
|
|
80
|
+
// .. note::
|
|
81
|
+
//
|
|
82
|
+
// The wildcard will not match the empty string.
|
|
83
|
+
// For example, ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``.
|
|
84
|
+
// The longest wildcards match first.
|
|
85
|
+
// Only a single virtual host in the entire route configuration can match on ``*``. A domain
|
|
86
|
+
// must be unique across all virtual hosts or the config will fail to load.
|
|
87
|
+
//
|
|
88
|
+
// Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE.
|
|
89
|
+
repeated string domains = 2 [(validate.rules).repeated = {
|
|
90
|
+
min_items: 1
|
|
91
|
+
items {string {well_known_regex: HTTP_HEADER_VALUE strict: false}}
|
|
92
|
+
}];
|
|
93
|
+
|
|
94
|
+
// The list of routes that will be matched, in order, for incoming requests.
|
|
95
|
+
// The first route that matches will be used.
|
|
96
|
+
// Only one of this and ``matcher`` can be specified.
|
|
97
|
+
repeated Route routes = 3 [(udpa.annotations.field_migrate).oneof_promotion = "route_selection"];
|
|
98
|
+
|
|
99
|
+
// The match tree to use when resolving route actions for incoming requests. Only one of this and ``routes``
|
|
100
|
+
// can be specified.
|
|
101
|
+
xds.type.matcher.v3.Matcher matcher = 21
|
|
102
|
+
[(udpa.annotations.field_migrate).oneof_promotion = "route_selection"];
|
|
103
|
+
|
|
104
|
+
// Specifies the type of TLS enforcement the virtual host expects. If this option is not
|
|
105
|
+
// specified, there is no TLS requirement for the virtual host.
|
|
106
|
+
TlsRequirementType require_tls = 4 [(validate.rules).enum = {defined_only: true}];
|
|
107
|
+
|
|
108
|
+
// A list of virtual clusters defined for this virtual host. Virtual clusters
|
|
109
|
+
// are used for additional statistics gathering.
|
|
110
|
+
repeated VirtualCluster virtual_clusters = 5;
|
|
111
|
+
|
|
112
|
+
// Specifies a set of rate limit configurations that will be applied to the
|
|
113
|
+
// virtual host.
|
|
114
|
+
repeated RateLimit rate_limits = 6;
|
|
115
|
+
|
|
116
|
+
// Specifies a list of HTTP headers that should be added to each request
|
|
117
|
+
// handled by this virtual host. Headers specified at this level are applied
|
|
118
|
+
// after headers from enclosed :ref:`envoy_v3_api_msg_config.route.v3.Route` and before headers from the
|
|
119
|
+
// enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
|
|
120
|
+
// details on header value syntax, see the documentation on :ref:`custom request headers
|
|
121
|
+
// <config_http_conn_man_headers_custom_request_headers>`.
|
|
122
|
+
repeated core.v3.HeaderValueOption request_headers_to_add = 7
|
|
123
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
124
|
+
|
|
125
|
+
// Specifies a list of HTTP headers that should be removed from each request
|
|
126
|
+
// handled by this virtual host.
|
|
127
|
+
repeated string request_headers_to_remove = 13 [(validate.rules).repeated = {
|
|
128
|
+
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
129
|
+
}];
|
|
130
|
+
|
|
131
|
+
// Specifies a list of HTTP headers that should be added to each response
|
|
132
|
+
// handled by this virtual host. Headers specified at this level are applied
|
|
133
|
+
// after headers from enclosed :ref:`envoy_v3_api_msg_config.route.v3.Route` and before headers from the
|
|
134
|
+
// enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
|
|
135
|
+
// details on header value syntax, see the documentation on :ref:`custom request headers
|
|
136
|
+
// <config_http_conn_man_headers_custom_request_headers>`.
|
|
137
|
+
repeated core.v3.HeaderValueOption response_headers_to_add = 10
|
|
138
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
139
|
+
|
|
140
|
+
// Specifies a list of HTTP headers that should be removed from each response
|
|
141
|
+
// handled by this virtual host.
|
|
142
|
+
repeated string response_headers_to_remove = 11 [(validate.rules).repeated = {
|
|
143
|
+
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
144
|
+
}];
|
|
145
|
+
|
|
146
|
+
// Indicates that the virtual host has a CORS policy. This field is ignored if related cors policy is
|
|
147
|
+
// found in the
|
|
148
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`.
|
|
149
|
+
//
|
|
150
|
+
// .. attention::
|
|
151
|
+
//
|
|
152
|
+
// This option has been deprecated. Please use
|
|
153
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`
|
|
154
|
+
// to configure the CORS HTTP filter.
|
|
155
|
+
CorsPolicy cors = 8 [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
156
|
+
|
|
157
|
+
// This field can be used to provide virtual host level per filter config. The key should match the
|
|
158
|
+
// :ref:`filter config name
|
|
159
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
|
|
160
|
+
// See :ref:`HTTP filter route-specific config <arch_overview_http_filters_per_filter_config>`
|
|
161
|
+
// for details.
|
|
162
|
+
// [#comment: An entry's value may be wrapped in a
|
|
163
|
+
// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
|
|
164
|
+
// message to specify additional options.]
|
|
165
|
+
map<string, google.protobuf.Any> typed_per_filter_config = 15;
|
|
166
|
+
|
|
167
|
+
// Decides whether the :ref:`x-envoy-attempt-count
|
|
168
|
+
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
|
|
169
|
+
// in the upstream request. Setting this option will cause it to override any existing header
|
|
170
|
+
// value, so in the case of two Envoys on the request path with this option enabled, the upstream
|
|
171
|
+
// will see the attempt count as perceived by the second Envoy.
|
|
172
|
+
//
|
|
173
|
+
// Defaults to ``false``.
|
|
174
|
+
//
|
|
175
|
+
// This header is unaffected by the
|
|
176
|
+
// :ref:`suppress_envoy_headers
|
|
177
|
+
// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
|
|
178
|
+
//
|
|
179
|
+
// [#next-major-version: rename to include_attempt_count_in_request.]
|
|
180
|
+
bool include_request_attempt_count = 14;
|
|
181
|
+
|
|
182
|
+
// Decides whether the :ref:`x-envoy-attempt-count
|
|
183
|
+
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
|
|
184
|
+
// in the downstream response. Setting this option will cause the router to override any existing header
|
|
185
|
+
// value, so in the case of two Envoys on the request path with this option enabled, the downstream
|
|
186
|
+
// will see the attempt count as perceived by the Envoy closest upstream from itself.
|
|
187
|
+
//
|
|
188
|
+
// Defaults to ``false``.
|
|
189
|
+
//
|
|
190
|
+
// This header is unaffected by the
|
|
191
|
+
// :ref:`suppress_envoy_headers
|
|
192
|
+
// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
|
|
193
|
+
bool include_attempt_count_in_response = 19;
|
|
194
|
+
|
|
195
|
+
// Indicates the retry policy for all routes in this virtual host. Note that setting a
|
|
196
|
+
// route level entry will take precedence over this config and it'll be treated
|
|
197
|
+
// independently (e.g., values are not inherited).
|
|
198
|
+
RetryPolicy retry_policy = 16;
|
|
199
|
+
|
|
200
|
+
// [#not-implemented-hide:]
|
|
201
|
+
// Specifies the configuration for retry policy extension. Note that setting a route level entry
|
|
202
|
+
// will take precedence over this config and it'll be treated independently (e.g., values are not
|
|
203
|
+
// inherited). :ref:`Retry policy <envoy_v3_api_field_config.route.v3.VirtualHost.retry_policy>` should not be
|
|
204
|
+
// set if this field is used.
|
|
205
|
+
google.protobuf.Any retry_policy_typed_config = 20;
|
|
206
|
+
|
|
207
|
+
// Indicates the hedge policy for all routes in this virtual host. Note that setting a
|
|
208
|
+
// route level entry will take precedence over this config and it'll be treated
|
|
209
|
+
// independently (e.g., values are not inherited).
|
|
210
|
+
HedgePolicy hedge_policy = 17;
|
|
211
|
+
|
|
212
|
+
// Decides whether to include the :ref:`x-envoy-is-timeout-retry <config_http_filters_router_x-envoy-is-timeout-retry>`
|
|
213
|
+
// request header in retries initiated by per-try timeouts.
|
|
214
|
+
bool include_is_timeout_retry_header = 23;
|
|
215
|
+
|
|
216
|
+
// The maximum bytes which will be buffered for retries and shadowing. If set, the bytes actually buffered will be
|
|
217
|
+
// the minimum value of this and the listener ``per_connection_buffer_limit_bytes``.
|
|
218
|
+
//
|
|
219
|
+
// .. attention::
|
|
220
|
+
//
|
|
221
|
+
// This field has been deprecated. Please use :ref:`request_body_buffer_limit
|
|
222
|
+
// <envoy_v3_api_field_config.route.v3.VirtualHost.request_body_buffer_limit>` instead.
|
|
223
|
+
// Only one of ``per_request_buffer_limit_bytes`` and ``request_body_buffer_limit`` could be set.
|
|
224
|
+
google.protobuf.UInt32Value per_request_buffer_limit_bytes = 18
|
|
225
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
226
|
+
|
|
227
|
+
// The maximum bytes which will be buffered for request bodies to support large request body
|
|
228
|
+
// buffering beyond the ``per_connection_buffer_limit_bytes``.
|
|
229
|
+
//
|
|
230
|
+
// This limit is specifically for the request body buffering and allows buffering larger payloads while maintaining
|
|
231
|
+
// flow control.
|
|
232
|
+
//
|
|
233
|
+
// Buffer limit precedence (from highest to lowest priority):
|
|
234
|
+
//
|
|
235
|
+
// 1. If ``request_body_buffer_limit`` is set, then ``request_body_buffer_limit`` will be used.
|
|
236
|
+
// 2. If :ref:`per_request_buffer_limit_bytes <envoy_v3_api_field_config.route.v3.VirtualHost.per_request_buffer_limit_bytes>`
|
|
237
|
+
// is set but ``request_body_buffer_limit`` is not, then ``min(per_request_buffer_limit_bytes, per_connection_buffer_limit_bytes)``
|
|
238
|
+
// will be used.
|
|
239
|
+
// 3. If neither is set, then ``per_connection_buffer_limit_bytes`` will be used.
|
|
240
|
+
//
|
|
241
|
+
// For flow control chunk sizes, ``min(per_connection_buffer_limit_bytes, 16KB)`` will be used.
|
|
242
|
+
//
|
|
243
|
+
// Only one of :ref:`per_request_buffer_limit_bytes <envoy_v3_api_field_config.route.v3.VirtualHost.per_request_buffer_limit_bytes>`
|
|
244
|
+
// and ``request_body_buffer_limit`` could be set.
|
|
245
|
+
google.protobuf.UInt64Value request_body_buffer_limit = 25
|
|
246
|
+
[(validate.rules).message = {required: false}];
|
|
247
|
+
|
|
248
|
+
// Specify a set of default request mirroring policies for every route under this virtual host.
|
|
249
|
+
// It takes precedence over the route config mirror policy entirely.
|
|
250
|
+
// That is, policies are not merged, the most specific non-empty one becomes the mirror policies.
|
|
251
|
+
repeated RouteAction.RequestMirrorPolicy request_mirror_policies = 22;
|
|
252
|
+
|
|
253
|
+
// The metadata field can be used to provide additional information
|
|
254
|
+
// about the virtual host. It can be used for configuration, stats, and logging.
|
|
255
|
+
// The metadata should go under the filter namespace that will need it.
|
|
256
|
+
// For instance, if the metadata is intended for the Router filter,
|
|
257
|
+
// the filter name should be specified as ``envoy.filters.http.router``.
|
|
258
|
+
core.v3.Metadata metadata = 24;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// A filter-defined action type.
|
|
262
|
+
message FilterAction {
|
|
263
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.FilterAction";
|
|
264
|
+
|
|
265
|
+
google.protobuf.Any action = 1;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// This can be used in route matcher :ref:`VirtualHost.matcher <envoy_v3_api_field_config.route.v3.VirtualHost.matcher>`.
|
|
269
|
+
// When the matcher matches, routes will be matched and run.
|
|
270
|
+
message RouteList {
|
|
271
|
+
// The list of routes that will be matched and run, in order. The first route that matches will be used.
|
|
272
|
+
repeated Route routes = 1;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// A route is both a specification of how to match a request as well as an indication of what to do
|
|
276
|
+
// next (e.g., redirect, forward, rewrite, etc.).
|
|
277
|
+
//
|
|
278
|
+
// .. attention::
|
|
279
|
+
//
|
|
280
|
+
// Envoy supports routing on HTTP method via :ref:`header matching
|
|
281
|
+
// <envoy_v3_api_msg_config.route.v3.HeaderMatcher>`.
|
|
282
|
+
// [#next-free-field: 21]
|
|
283
|
+
message Route {
|
|
284
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.Route";
|
|
285
|
+
|
|
286
|
+
reserved 6, 8;
|
|
287
|
+
|
|
288
|
+
reserved "per_filter_config";
|
|
289
|
+
|
|
290
|
+
// Name for the route.
|
|
291
|
+
string name = 14;
|
|
292
|
+
|
|
293
|
+
// Route matching parameters.
|
|
294
|
+
RouteMatch match = 1 [(validate.rules).message = {required: true}];
|
|
295
|
+
|
|
296
|
+
oneof action {
|
|
297
|
+
option (validate.required) = true;
|
|
298
|
+
|
|
299
|
+
// Route request to some upstream cluster.
|
|
300
|
+
RouteAction route = 2;
|
|
301
|
+
|
|
302
|
+
// Return a redirect.
|
|
303
|
+
RedirectAction redirect = 3;
|
|
304
|
+
|
|
305
|
+
// Return an arbitrary HTTP response directly, without proxying.
|
|
306
|
+
DirectResponseAction direct_response = 7;
|
|
307
|
+
|
|
308
|
+
// [#not-implemented-hide:]
|
|
309
|
+
// A filter-defined action (e.g., it could dynamically generate the RouteAction).
|
|
310
|
+
// [#comment: TODO(samflattery): Remove cleanup in route_fuzz_test.cc when
|
|
311
|
+
// implemented]
|
|
312
|
+
FilterAction filter_action = 17;
|
|
313
|
+
|
|
314
|
+
// [#not-implemented-hide:]
|
|
315
|
+
// An action used when the route will generate a response directly,
|
|
316
|
+
// without forwarding to an upstream host. This will be used in non-proxy
|
|
317
|
+
// xDS clients like the gRPC server. It could also be used in the future
|
|
318
|
+
// in Envoy for a filter that directly generates responses for requests.
|
|
319
|
+
NonForwardingAction non_forwarding_action = 18;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// The Metadata field can be used to provide additional information
|
|
323
|
+
// about the route. It can be used for configuration, stats, and logging.
|
|
324
|
+
// The metadata should go under the filter namespace that will need it.
|
|
325
|
+
// For instance, if the metadata is intended for the Router filter,
|
|
326
|
+
// the filter name should be specified as ``envoy.filters.http.router``.
|
|
327
|
+
core.v3.Metadata metadata = 4;
|
|
328
|
+
|
|
329
|
+
// Decorator for the matched route.
|
|
330
|
+
Decorator decorator = 5;
|
|
331
|
+
|
|
332
|
+
// This field can be used to provide route specific per filter config. The key should match the
|
|
333
|
+
// :ref:`filter config name
|
|
334
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
|
|
335
|
+
// See :ref:`HTTP filter route-specific config <arch_overview_http_filters_per_filter_config>`
|
|
336
|
+
// for details.
|
|
337
|
+
// [#comment: An entry's value may be wrapped in a
|
|
338
|
+
// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
|
|
339
|
+
// message to specify additional options.]
|
|
340
|
+
map<string, google.protobuf.Any> typed_per_filter_config = 13;
|
|
341
|
+
|
|
342
|
+
// Specifies a set of headers that will be added to requests matching this
|
|
343
|
+
// route. Headers specified at this level are applied before headers from the
|
|
344
|
+
// enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
|
|
345
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
|
|
346
|
+
// header value syntax, see the documentation on :ref:`custom request headers
|
|
347
|
+
// <config_http_conn_man_headers_custom_request_headers>`.
|
|
348
|
+
repeated core.v3.HeaderValueOption request_headers_to_add = 9
|
|
349
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
350
|
+
|
|
351
|
+
// Specifies a list of HTTP headers that should be removed from each request
|
|
352
|
+
// matching this route.
|
|
353
|
+
repeated string request_headers_to_remove = 12 [(validate.rules).repeated = {
|
|
354
|
+
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
355
|
+
}];
|
|
356
|
+
|
|
357
|
+
// Specifies a set of headers that will be added to responses to requests
|
|
358
|
+
// matching this route. Headers specified at this level are applied before
|
|
359
|
+
// headers from the enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
|
|
360
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
|
|
361
|
+
// details on header value syntax, see the documentation on
|
|
362
|
+
// :ref:`custom request headers <config_http_conn_man_headers_custom_request_headers>`.
|
|
363
|
+
repeated core.v3.HeaderValueOption response_headers_to_add = 10
|
|
364
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
365
|
+
|
|
366
|
+
// Specifies a list of HTTP headers that should be removed from each response
|
|
367
|
+
// to requests matching this route.
|
|
368
|
+
repeated string response_headers_to_remove = 11 [(validate.rules).repeated = {
|
|
369
|
+
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
370
|
+
}];
|
|
371
|
+
|
|
372
|
+
// Presence of the object defines whether the connection manager's tracing configuration
|
|
373
|
+
// is overridden by this route specific instance.
|
|
374
|
+
Tracing tracing = 15;
|
|
375
|
+
|
|
376
|
+
// The maximum bytes which will be buffered for retries and shadowing.
|
|
377
|
+
// If set, the bytes actually buffered will be the minimum value of this and the
|
|
378
|
+
// listener per_connection_buffer_limit_bytes.
|
|
379
|
+
//
|
|
380
|
+
// .. attention::
|
|
381
|
+
//
|
|
382
|
+
// This field has been deprecated. Please use :ref:`request_body_buffer_limit
|
|
383
|
+
// <envoy_v3_api_field_config.route.v3.Route.request_body_buffer_limit>` instead.
|
|
384
|
+
// Only one of ``per_request_buffer_limit_bytes`` and ``request_body_buffer_limit`` may be set.
|
|
385
|
+
google.protobuf.UInt32Value per_request_buffer_limit_bytes = 16
|
|
386
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
387
|
+
|
|
388
|
+
// The human readable prefix to use when emitting statistics for this endpoint.
|
|
389
|
+
// The statistics are rooted at vhost.<virtual host name>.route.<stat_prefix>.
|
|
390
|
+
// This should be set for highly critical
|
|
391
|
+
// endpoints that one wishes to get “per-route” statistics on.
|
|
392
|
+
// If not set, endpoint statistics are not generated.
|
|
393
|
+
//
|
|
394
|
+
// The emitted statistics are the same as those documented for :ref:`virtual clusters <config_http_filters_router_vcluster_stats>`.
|
|
395
|
+
//
|
|
396
|
+
// .. warning::
|
|
397
|
+
//
|
|
398
|
+
// We do not recommend setting up a stat prefix for
|
|
399
|
+
// every application endpoint. This is both not easily maintainable and
|
|
400
|
+
// statistics use a non-trivial amount of memory (approximately 1KiB per route).
|
|
401
|
+
string stat_prefix = 19;
|
|
402
|
+
|
|
403
|
+
// The maximum bytes which will be buffered for request bodies to support large request body
|
|
404
|
+
// buffering beyond the ``per_connection_buffer_limit_bytes``.
|
|
405
|
+
//
|
|
406
|
+
// This limit is specifically for the request body buffering and allows buffering larger payloads while maintaining
|
|
407
|
+
// flow control.
|
|
408
|
+
//
|
|
409
|
+
// Buffer limit precedence (from highest to lowest priority):
|
|
410
|
+
//
|
|
411
|
+
// 1. If ``request_body_buffer_limit`` is set: use ``request_body_buffer_limit``
|
|
412
|
+
// 2. If :ref:`per_request_buffer_limit_bytes <envoy_v3_api_field_config.route.v3.Route.per_request_buffer_limit_bytes>`
|
|
413
|
+
// is set but ``request_body_buffer_limit`` is not: use ``min(per_request_buffer_limit_bytes, per_connection_buffer_limit_bytes)``
|
|
414
|
+
// 3. If neither is set: use ``per_connection_buffer_limit_bytes``
|
|
415
|
+
//
|
|
416
|
+
// For flow control chunk sizes, use ``min(per_connection_buffer_limit_bytes, 16KB)``.
|
|
417
|
+
//
|
|
418
|
+
// Only one of :ref:`per_request_buffer_limit_bytes <envoy_v3_api_field_config.route.v3.Route.per_request_buffer_limit_bytes>`
|
|
419
|
+
// and ``request_body_buffer_limit`` may be set.
|
|
420
|
+
google.protobuf.UInt64Value request_body_buffer_limit = 20;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Compared to the :ref:`cluster <envoy_v3_api_field_config.route.v3.RouteAction.cluster>` field that specifies a
|
|
424
|
+
// single upstream cluster as the target of a request, the :ref:`weighted_clusters
|
|
425
|
+
// <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>` option allows for specification of
|
|
426
|
+
// multiple upstream clusters along with weights that indicate the percentage of
|
|
427
|
+
// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
|
|
428
|
+
// weights.
|
|
429
|
+
// [#next-free-field: 6]
|
|
430
|
+
message WeightedCluster {
|
|
431
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.WeightedCluster";
|
|
432
|
+
|
|
433
|
+
// [#next-free-field: 13]
|
|
434
|
+
message ClusterWeight {
|
|
435
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
436
|
+
"envoy.api.v2.route.WeightedCluster.ClusterWeight";
|
|
437
|
+
|
|
438
|
+
reserved 7, 8;
|
|
439
|
+
|
|
440
|
+
reserved "per_filter_config";
|
|
441
|
+
|
|
442
|
+
// Only one of ``name`` and ``cluster_header`` may be specified.
|
|
443
|
+
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}]
|
|
444
|
+
// Name of the upstream cluster. The cluster must exist in the
|
|
445
|
+
// :ref:`cluster manager configuration <config_cluster_manager>`.
|
|
446
|
+
string name = 1 [(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"];
|
|
447
|
+
|
|
448
|
+
// Only one of ``name`` and ``cluster_header`` may be specified.
|
|
449
|
+
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1 }]
|
|
450
|
+
// Envoy will determine the cluster to route to by reading the value of the
|
|
451
|
+
// HTTP header named by cluster_header from the request headers. If the
|
|
452
|
+
// header is not found or the referenced cluster does not exist, Envoy will
|
|
453
|
+
// return a 404 response.
|
|
454
|
+
//
|
|
455
|
+
// .. attention::
|
|
456
|
+
//
|
|
457
|
+
// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
|
|
458
|
+
// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
|
|
459
|
+
//
|
|
460
|
+
// .. note::
|
|
461
|
+
//
|
|
462
|
+
// If the header appears multiple times only the first value is used.
|
|
463
|
+
string cluster_header = 12 [
|
|
464
|
+
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
|
|
465
|
+
(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"
|
|
466
|
+
];
|
|
467
|
+
|
|
468
|
+
// The weight of the cluster. This value is relative to the other clusters'
|
|
469
|
+
// weights. When a request matches the route, the choice of an upstream cluster
|
|
470
|
+
// is determined by its weight. The sum of weights across all
|
|
471
|
+
// entries in the clusters array must be greater than 0, and must not exceed
|
|
472
|
+
// uint32_t maximal value (4294967295).
|
|
473
|
+
google.protobuf.UInt32Value weight = 2;
|
|
474
|
+
|
|
475
|
+
// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in
|
|
476
|
+
// the upstream cluster with metadata matching what is set in this field will be considered for
|
|
477
|
+
// load balancing. Note that this will be merged with what's provided in
|
|
478
|
+
// :ref:`RouteAction.metadata_match <envoy_v3_api_field_config.route.v3.RouteAction.metadata_match>`, with
|
|
479
|
+
// values here taking precedence. The filter name should be specified as ``envoy.lb``.
|
|
480
|
+
core.v3.Metadata metadata_match = 3;
|
|
481
|
+
|
|
482
|
+
// Specifies a list of headers to be added to requests when this cluster is selected
|
|
483
|
+
// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
|
|
484
|
+
// Headers specified at this level are applied before headers from the enclosing
|
|
485
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`, and
|
|
486
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
|
|
487
|
+
// header value syntax, see the documentation on :ref:`custom request headers
|
|
488
|
+
// <config_http_conn_man_headers_custom_request_headers>`.
|
|
489
|
+
repeated core.v3.HeaderValueOption request_headers_to_add = 4
|
|
490
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
491
|
+
|
|
492
|
+
// Specifies a list of HTTP headers that should be removed from each request when
|
|
493
|
+
// this cluster is selected through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
|
|
494
|
+
repeated string request_headers_to_remove = 9 [(validate.rules).repeated = {
|
|
495
|
+
items {string {well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
496
|
+
}];
|
|
497
|
+
|
|
498
|
+
// Specifies a list of headers to be added to responses when this cluster is selected
|
|
499
|
+
// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
|
|
500
|
+
// Headers specified at this level are applied before headers from the enclosing
|
|
501
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`, and
|
|
502
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
|
|
503
|
+
// header value syntax, see the documentation on :ref:`custom request headers
|
|
504
|
+
// <config_http_conn_man_headers_custom_request_headers>`.
|
|
505
|
+
repeated core.v3.HeaderValueOption response_headers_to_add = 5
|
|
506
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
507
|
+
|
|
508
|
+
// Specifies a list of headers to be removed from responses when this cluster is selected
|
|
509
|
+
// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
|
|
510
|
+
repeated string response_headers_to_remove = 6 [(validate.rules).repeated = {
|
|
511
|
+
items {string {well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
512
|
+
}];
|
|
513
|
+
|
|
514
|
+
// This field can be used to provide weighted cluster specific per filter config. The key should match the
|
|
515
|
+
// :ref:`filter config name
|
|
516
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
|
|
517
|
+
// See :ref:`HTTP filter route-specific config <arch_overview_http_filters_per_filter_config>`
|
|
518
|
+
// for details.
|
|
519
|
+
// [#comment: An entry's value may be wrapped in a
|
|
520
|
+
// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
|
|
521
|
+
// message to specify additional options.]
|
|
522
|
+
map<string, google.protobuf.Any> typed_per_filter_config = 10;
|
|
523
|
+
|
|
524
|
+
oneof host_rewrite_specifier {
|
|
525
|
+
// Indicates that during forwarding, the host header will be swapped with
|
|
526
|
+
// this value.
|
|
527
|
+
string host_rewrite_literal = 11
|
|
528
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Specifies one or more upstream clusters associated with the route.
|
|
533
|
+
repeated ClusterWeight clusters = 1 [(validate.rules).repeated = {min_items: 1}];
|
|
534
|
+
|
|
535
|
+
// Specifies the total weight across all clusters. The sum of all cluster weights must equal this
|
|
536
|
+
// value, if this is greater than 0.
|
|
537
|
+
// This field is now deprecated, and the client will use the sum of all
|
|
538
|
+
// cluster weights. It is up to the management server to supply the correct weights.
|
|
539
|
+
google.protobuf.UInt32Value total_weight = 3
|
|
540
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
541
|
+
|
|
542
|
+
// Specifies the runtime key prefix that should be used to construct the
|
|
543
|
+
// runtime keys associated with each cluster. When the ``runtime_key_prefix`` is
|
|
544
|
+
// specified, the router will look for weights associated with each upstream
|
|
545
|
+
// cluster under the key ``runtime_key_prefix`` + ``.`` + ``cluster[i].name`` where
|
|
546
|
+
// ``cluster[i]`` denotes an entry in the clusters array field. If the runtime
|
|
547
|
+
// key for the cluster does not exist, the value specified in the
|
|
548
|
+
// configuration file will be used as the default weight. See the :ref:`runtime documentation
|
|
549
|
+
// <operations_runtime>` for how key names map to the underlying implementation.
|
|
550
|
+
string runtime_key_prefix = 2;
|
|
551
|
+
|
|
552
|
+
oneof random_value_specifier {
|
|
553
|
+
// Specifies the header name that is used to look up the random value passed in the request header.
|
|
554
|
+
// This is used to ensure consistent cluster picking across multiple proxy levels for weighted traffic.
|
|
555
|
+
// If header is not present or invalid, Envoy will fall back to use the internally generated random value.
|
|
556
|
+
// This header is expected to be single-valued header as we only want to have one selected value throughout
|
|
557
|
+
// the process for the consistency. And the value is a unsigned number between 0 and UINT64_MAX.
|
|
558
|
+
string header_name = 4
|
|
559
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
560
|
+
|
|
561
|
+
// When set to true, the hash policies will be used to generate the random value for weighted cluster selection.
|
|
562
|
+
// This could ensure consistent cluster picking across multiple proxy levels for weighted traffic.
|
|
563
|
+
google.protobuf.BoolValue use_hash_policy = 5;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// Configuration for a cluster specifier plugin.
|
|
568
|
+
message ClusterSpecifierPlugin {
|
|
569
|
+
// The name of the plugin and its opaque configuration.
|
|
570
|
+
//
|
|
571
|
+
// [#extension-category: envoy.router.cluster_specifier_plugin]
|
|
572
|
+
core.v3.TypedExtensionConfig extension = 1 [(validate.rules).message = {required: true}];
|
|
573
|
+
|
|
574
|
+
// If is_optional is not set or is set to false and the plugin defined by this message is not a
|
|
575
|
+
// supported type, the containing resource is NACKed. If is_optional is set to true, the resource
|
|
576
|
+
// would not be NACKed for this reason. In this case, routes referencing this plugin's name would
|
|
577
|
+
// not be treated as an illegal configuration, but would result in a failure if the route is
|
|
578
|
+
// selected.
|
|
579
|
+
bool is_optional = 2;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// [#next-free-field: 18]
|
|
583
|
+
message RouteMatch {
|
|
584
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteMatch";
|
|
585
|
+
|
|
586
|
+
message GrpcRouteMatchOptions {
|
|
587
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
588
|
+
"envoy.api.v2.route.RouteMatch.GrpcRouteMatchOptions";
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
message TlsContextMatchOptions {
|
|
592
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
593
|
+
"envoy.api.v2.route.RouteMatch.TlsContextMatchOptions";
|
|
594
|
+
|
|
595
|
+
// If specified, the route will match against whether or not a certificate is presented.
|
|
596
|
+
// If not specified, certificate presentation status (true or false) will not be considered when route matching.
|
|
597
|
+
google.protobuf.BoolValue presented = 1;
|
|
598
|
+
|
|
599
|
+
// If specified, the route will match against whether or not a certificate is validated.
|
|
600
|
+
// If not specified, certificate validation status (true or false) will not be considered when route matching.
|
|
601
|
+
//
|
|
602
|
+
// .. warning::
|
|
603
|
+
//
|
|
604
|
+
// Client certificate validation is not currently performed upon TLS session resumption. For
|
|
605
|
+
// a resumed TLS session the route will match only when ``validated`` is false, regardless of
|
|
606
|
+
// whether the client TLS certificate is valid.
|
|
607
|
+
//
|
|
608
|
+
// The only known workaround for this issue is to disable TLS session resumption entirely, by
|
|
609
|
+
// setting both :ref:`disable_stateless_session_resumption <envoy_v3_api_field_extensions.transport_sockets.tls.v3.DownstreamTlsContext.disable_stateless_session_resumption>`
|
|
610
|
+
// and :ref:`disable_stateful_session_resumption <envoy_v3_api_field_extensions.transport_sockets.tls.v3.DownstreamTlsContext.disable_stateful_session_resumption>` on the DownstreamTlsContext.
|
|
611
|
+
google.protobuf.BoolValue validated = 2;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// An extensible message for matching CONNECT or CONNECT-UDP requests.
|
|
615
|
+
message ConnectMatcher {
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
reserved 5, 3;
|
|
619
|
+
|
|
620
|
+
reserved "regex";
|
|
621
|
+
|
|
622
|
+
oneof path_specifier {
|
|
623
|
+
option (validate.required) = true;
|
|
624
|
+
|
|
625
|
+
// If specified, the route is a prefix rule meaning that the prefix must
|
|
626
|
+
// match the beginning of the ``:path`` header.
|
|
627
|
+
string prefix = 1;
|
|
628
|
+
|
|
629
|
+
// If specified, the route is an exact path rule meaning that the path must
|
|
630
|
+
// exactly match the ``:path`` header once the query string is removed.
|
|
631
|
+
string path = 2;
|
|
632
|
+
|
|
633
|
+
// If specified, the route is a regular expression rule meaning that the
|
|
634
|
+
// regex must match the ``:path`` header once the query string is removed. The entire path
|
|
635
|
+
// (without the query string) must match the regex. The rule will not match if only a
|
|
636
|
+
// subsequence of the ``:path`` header matches the regex.
|
|
637
|
+
//
|
|
638
|
+
// [#next-major-version: In the v3 API we should redo how path specification works such
|
|
639
|
+
// that we utilize StringMatcher, and additionally have consistent options around whether we
|
|
640
|
+
// strip query strings, do a case-sensitive match, etc. In the interim it will be too disruptive
|
|
641
|
+
// to deprecate the existing options. We should even consider whether we want to do away with
|
|
642
|
+
// path_specifier entirely and just rely on a set of header matchers which can already match
|
|
643
|
+
// on :path, etc. The issue with that is it is unclear how to generically deal with query string
|
|
644
|
+
// stripping. This needs more thought.]
|
|
645
|
+
type.matcher.v3.RegexMatcher safe_regex = 10 [(validate.rules).message = {required: true}];
|
|
646
|
+
|
|
647
|
+
// If this is used as the matcher, the matcher will only match CONNECT or CONNECT-UDP requests.
|
|
648
|
+
// Note that this will not match other Extended CONNECT requests (WebSocket and the like) as
|
|
649
|
+
// they are normalized in Envoy as HTTP/1.1 style upgrades.
|
|
650
|
+
// This is the only way to match CONNECT requests for HTTP/1.1. For HTTP/2 and HTTP/3,
|
|
651
|
+
// where Extended CONNECT requests may have a path, the path matchers will work if
|
|
652
|
+
// there is a path present.
|
|
653
|
+
// Note that CONNECT support is currently considered alpha in Envoy.
|
|
654
|
+
// [#comment: TODO(htuch): Replace the above comment with an alpha tag.]
|
|
655
|
+
ConnectMatcher connect_matcher = 12;
|
|
656
|
+
|
|
657
|
+
// If specified, the route is a path-separated prefix rule meaning that the
|
|
658
|
+
// ``:path`` header (without the query string) must either exactly match the
|
|
659
|
+
// ``path_separated_prefix`` or have it as a prefix, followed by ``/``
|
|
660
|
+
//
|
|
661
|
+
// For example, ``/api/dev`` would match
|
|
662
|
+
// ``/api/dev``, ``/api/dev/``, ``/api/dev/v1``, and ``/api/dev?param=true``
|
|
663
|
+
// but would not match ``/api/developer``
|
|
664
|
+
//
|
|
665
|
+
// Expect the value to not contain ``?`` or ``#`` and not to end in ``/``
|
|
666
|
+
string path_separated_prefix = 14 [(validate.rules).string = {pattern: "^[^?#]+[^?#/]$"}];
|
|
667
|
+
|
|
668
|
+
// [#extension-category: envoy.path.match]
|
|
669
|
+
core.v3.TypedExtensionConfig path_match_policy = 15;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// Indicates that prefix/path matching should be case-sensitive. The default
|
|
673
|
+
// is true. Ignored for safe_regex matching.
|
|
674
|
+
google.protobuf.BoolValue case_sensitive = 4;
|
|
675
|
+
|
|
676
|
+
// Indicates that the route should additionally match on a runtime key. Every time the route
|
|
677
|
+
// is considered for a match, it must also fall under the percentage of matches indicated by
|
|
678
|
+
// this field. For some fraction N/D, a random number in the range [0,D) is selected. If the
|
|
679
|
+
// number is <= the value of the numerator N, or if the key is not present, the default
|
|
680
|
+
// value, the router continues to evaluate the remaining match criteria. A runtime_fraction
|
|
681
|
+
// route configuration can be used to roll out route changes in a gradual manner without full
|
|
682
|
+
// code/config deploys. Refer to the :ref:`traffic shifting
|
|
683
|
+
// <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation.
|
|
684
|
+
//
|
|
685
|
+
// .. note::
|
|
686
|
+
//
|
|
687
|
+
// Parsing this field is implemented such that the runtime key's data may be represented
|
|
688
|
+
// as a FractionalPercent proto represented as JSON/YAML and may also be represented as an
|
|
689
|
+
// integer with the assumption that the value is an integral percentage out of 100. For
|
|
690
|
+
// instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent
|
|
691
|
+
// whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics.
|
|
692
|
+
core.v3.RuntimeFractionalPercent runtime_fraction = 9;
|
|
693
|
+
|
|
694
|
+
// Specifies a set of headers that the route should match on. The router will
|
|
695
|
+
// check the request’s headers against all the specified headers in the route
|
|
696
|
+
// config. A match will happen if all the headers in the route are present in
|
|
697
|
+
// the request with the same values (or based on presence if the value field
|
|
698
|
+
// is not in the config).
|
|
699
|
+
repeated HeaderMatcher headers = 6;
|
|
700
|
+
|
|
701
|
+
// Specifies a set of URL query parameters on which the route should
|
|
702
|
+
// match. The router will check the query string from the ``path`` header
|
|
703
|
+
// against all the specified query parameters. If the number of specified
|
|
704
|
+
// query parameters is nonzero, they all must match the ``path`` header's
|
|
705
|
+
// query string for a match to occur. In the event query parameters are
|
|
706
|
+
// repeated, only the first value for each key will be considered.
|
|
707
|
+
//
|
|
708
|
+
// .. note::
|
|
709
|
+
//
|
|
710
|
+
// If query parameters are used to pass request message fields when
|
|
711
|
+
// `grpc_json_transcoder <https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter>`_
|
|
712
|
+
// is used, the transcoded message fields may be different. The query parameters are
|
|
713
|
+
// URL-encoded, but the message fields are not. For example, if a query
|
|
714
|
+
// parameter is "foo%20bar", the message field will be "foo bar".
|
|
715
|
+
repeated QueryParameterMatcher query_parameters = 7;
|
|
716
|
+
|
|
717
|
+
// Specifies a set of cookies on which the route should match. The router parses the ``Cookie``
|
|
718
|
+
// header and evaluates the named cookie against each matcher. If the number of specified cookie
|
|
719
|
+
// matchers is nonzero, they all must match for the route to be selected.
|
|
720
|
+
repeated CookieMatcher cookies = 17;
|
|
721
|
+
|
|
722
|
+
// If specified, only gRPC requests will be matched. The router will check
|
|
723
|
+
// that the ``Content-Type`` header has ``application/grpc`` or one of the various
|
|
724
|
+
// ``application/grpc+`` values.
|
|
725
|
+
GrpcRouteMatchOptions grpc = 8;
|
|
726
|
+
|
|
727
|
+
// If specified, the client tls context will be matched against the defined
|
|
728
|
+
// match options.
|
|
729
|
+
//
|
|
730
|
+
// [#next-major-version: unify with RBAC]
|
|
731
|
+
TlsContextMatchOptions tls_context = 11;
|
|
732
|
+
|
|
733
|
+
// Specifies a set of dynamic metadata matchers on which the route should match.
|
|
734
|
+
// The router will check the dynamic metadata against all the specified dynamic metadata matchers.
|
|
735
|
+
// If the number of specified dynamic metadata matchers is nonzero, they all must match the
|
|
736
|
+
// dynamic metadata for a match to occur.
|
|
737
|
+
repeated type.matcher.v3.MetadataMatcher dynamic_metadata = 13;
|
|
738
|
+
|
|
739
|
+
// Specifies a set of filter state matchers on which the route should match.
|
|
740
|
+
// The router will check the filter state against all the specified filter state matchers.
|
|
741
|
+
// If the number of specified filter state matchers is nonzero, they all must match the
|
|
742
|
+
// filter state for a match to occur.
|
|
743
|
+
repeated type.matcher.v3.FilterStateMatcher filter_state = 16;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Cors policy configuration.
|
|
747
|
+
//
|
|
748
|
+
// .. attention::
|
|
749
|
+
//
|
|
750
|
+
// This message has been deprecated. Please use
|
|
751
|
+
// :ref:`CorsPolicy in filter extension <envoy_v3_api_msg_extensions.filters.http.cors.v3.CorsPolicy>`
|
|
752
|
+
// as as alternative.
|
|
753
|
+
//
|
|
754
|
+
// [#next-free-field: 14]
|
|
755
|
+
message CorsPolicy {
|
|
756
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.CorsPolicy";
|
|
757
|
+
|
|
758
|
+
reserved 1, 8, 7;
|
|
759
|
+
|
|
760
|
+
reserved "allow_origin", "allow_origin_regex", "enabled";
|
|
761
|
+
|
|
762
|
+
// Specifies string patterns that match allowed origins. An origin is allowed if any of the
|
|
763
|
+
// string matchers match.
|
|
764
|
+
repeated type.matcher.v3.StringMatcher allow_origin_string_match = 11;
|
|
765
|
+
|
|
766
|
+
// Specifies the content for the ``access-control-allow-methods`` header.
|
|
767
|
+
string allow_methods = 2;
|
|
768
|
+
|
|
769
|
+
// Specifies the content for the ``access-control-allow-headers`` header.
|
|
770
|
+
string allow_headers = 3;
|
|
771
|
+
|
|
772
|
+
// Specifies the content for the ``access-control-expose-headers`` header.
|
|
773
|
+
string expose_headers = 4;
|
|
774
|
+
|
|
775
|
+
// Specifies the content for the ``access-control-max-age`` header.
|
|
776
|
+
string max_age = 5;
|
|
777
|
+
|
|
778
|
+
// Specifies whether the resource allows credentials.
|
|
779
|
+
google.protobuf.BoolValue allow_credentials = 6;
|
|
780
|
+
|
|
781
|
+
oneof enabled_specifier {
|
|
782
|
+
// Specifies the % of requests for which the CORS filter is enabled.
|
|
783
|
+
//
|
|
784
|
+
// If neither ``enabled``, ``filter_enabled``, nor ``shadow_enabled`` are specified, the CORS
|
|
785
|
+
// filter will be enabled for 100% of the requests.
|
|
786
|
+
//
|
|
787
|
+
// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is
|
|
788
|
+
// specified, Envoy will lookup the runtime key to get the percentage of requests to filter.
|
|
789
|
+
core.v3.RuntimeFractionalPercent filter_enabled = 9;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// Specifies the % of requests for which the CORS policies will be evaluated and tracked, but not
|
|
793
|
+
// enforced.
|
|
794
|
+
//
|
|
795
|
+
// This field is intended to be used when ``filter_enabled`` and ``enabled`` are off. One of those
|
|
796
|
+
// fields have to explicitly disable the filter in order for this setting to take effect.
|
|
797
|
+
//
|
|
798
|
+
// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is specified,
|
|
799
|
+
// Envoy will lookup the runtime key to get the percentage of requests for which it will evaluate
|
|
800
|
+
// and track the request's ``Origin`` to determine if it's valid but will not enforce any policies.
|
|
801
|
+
core.v3.RuntimeFractionalPercent shadow_enabled = 10;
|
|
802
|
+
|
|
803
|
+
// Specify whether allow requests whose target server's IP address is more private than that from
|
|
804
|
+
// which the request initiator was fetched.
|
|
805
|
+
//
|
|
806
|
+
// More details refer to https://developer.chrome.com/blog/private-network-access-preflight.
|
|
807
|
+
google.protobuf.BoolValue allow_private_network_access = 12;
|
|
808
|
+
|
|
809
|
+
// Specifies if preflight requests not matching the configured allowed origin should be forwarded
|
|
810
|
+
// to the upstream. Default is ``true``.
|
|
811
|
+
google.protobuf.BoolValue forward_not_matching_preflights = 13;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// [#next-free-field: 46]
|
|
815
|
+
message RouteAction {
|
|
816
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteAction";
|
|
817
|
+
|
|
818
|
+
enum ClusterNotFoundResponseCode {
|
|
819
|
+
// HTTP status code - 503 Service Unavailable.
|
|
820
|
+
SERVICE_UNAVAILABLE = 0;
|
|
821
|
+
|
|
822
|
+
// HTTP status code - 404 Not Found.
|
|
823
|
+
NOT_FOUND = 1;
|
|
824
|
+
|
|
825
|
+
// HTTP status code - 500 Internal Server Error.
|
|
826
|
+
INTERNAL_SERVER_ERROR = 2;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// Configures :ref:`internal redirect <arch_overview_internal_redirects>` behavior.
|
|
830
|
+
// [#next-major-version: remove this definition - it's defined in the InternalRedirectPolicy message.]
|
|
831
|
+
enum InternalRedirectAction {
|
|
832
|
+
option deprecated = true;
|
|
833
|
+
|
|
834
|
+
PASS_THROUGH_INTERNAL_REDIRECT = 0;
|
|
835
|
+
HANDLE_INTERNAL_REDIRECT = 1;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// The router is capable of shadowing traffic from one cluster to another. The current
|
|
839
|
+
// implementation is "fire and forget," meaning Envoy will not wait for the shadow cluster to
|
|
840
|
+
// respond before returning the response from the primary cluster. All normal statistics are
|
|
841
|
+
// collected for the shadow cluster making this feature useful for testing.
|
|
842
|
+
//
|
|
843
|
+
// During shadowing, the host/authority header is altered such that ``-shadow`` is appended. This is
|
|
844
|
+
// useful for logging. For example, ``cluster1`` becomes ``cluster1-shadow``. This behavior can be
|
|
845
|
+
// disabled by setting ``disable_shadow_host_suffix_append`` to ``true``.
|
|
846
|
+
//
|
|
847
|
+
// .. note::
|
|
848
|
+
//
|
|
849
|
+
// Shadowing will not be triggered if the primary cluster does not exist.
|
|
850
|
+
//
|
|
851
|
+
// .. note::
|
|
852
|
+
//
|
|
853
|
+
// Shadowing doesn't support HTTP CONNECT and upgrades.
|
|
854
|
+
// [#next-free-field: 9]
|
|
855
|
+
message RequestMirrorPolicy {
|
|
856
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
857
|
+
"envoy.api.v2.route.RouteAction.RequestMirrorPolicy";
|
|
858
|
+
|
|
859
|
+
reserved 2;
|
|
860
|
+
|
|
861
|
+
reserved "runtime_key";
|
|
862
|
+
|
|
863
|
+
// Only one of ``cluster`` and ``cluster_header`` can be specified.
|
|
864
|
+
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}]
|
|
865
|
+
// Specifies the cluster that requests will be mirrored to. The cluster must
|
|
866
|
+
// exist in the cluster manager configuration.
|
|
867
|
+
string cluster = 1 [(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"];
|
|
868
|
+
|
|
869
|
+
// Only one of ``cluster`` and ``cluster_header`` can be specified.
|
|
870
|
+
// Envoy will determine the cluster to route to by reading the value of the
|
|
871
|
+
// HTTP header named by cluster_header from the request headers. Only the first value in header is used,
|
|
872
|
+
// and no shadow request will happen if the value is not found in headers. Envoy will not wait for
|
|
873
|
+
// the shadow cluster to respond before returning the response from the primary cluster.
|
|
874
|
+
//
|
|
875
|
+
// .. attention::
|
|
876
|
+
//
|
|
877
|
+
// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
|
|
878
|
+
// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
|
|
879
|
+
//
|
|
880
|
+
// .. note::
|
|
881
|
+
//
|
|
882
|
+
// If the header appears multiple times only the first value is used.
|
|
883
|
+
string cluster_header = 5 [
|
|
884
|
+
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
|
|
885
|
+
(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"
|
|
886
|
+
];
|
|
887
|
+
|
|
888
|
+
// If not specified, all requests to the target cluster will be mirrored.
|
|
889
|
+
//
|
|
890
|
+
// If specified, this field takes precedence over the ``runtime_key`` field and requests must also
|
|
891
|
+
// fall under the percentage of matches indicated by this field.
|
|
892
|
+
//
|
|
893
|
+
// For some fraction N/D, a random number in the range [0,D) is selected. If the
|
|
894
|
+
// number is <= the value of the numerator N, or if the key is not present, the default
|
|
895
|
+
// value, the request will be mirrored.
|
|
896
|
+
core.v3.RuntimeFractionalPercent runtime_fraction = 3;
|
|
897
|
+
|
|
898
|
+
// Specifies whether the trace span for the shadow request should be sampled. If this field is not explicitly set,
|
|
899
|
+
// the shadow request will inherit the sampling decision of its parent span. This ensures consistency with the trace
|
|
900
|
+
// sampling policy of the original request and prevents oversampling, especially in scenarios where runtime sampling
|
|
901
|
+
// is disabled.
|
|
902
|
+
google.protobuf.BoolValue trace_sampled = 4;
|
|
903
|
+
|
|
904
|
+
// Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header.
|
|
905
|
+
//
|
|
906
|
+
// Defaults to ``false``.
|
|
907
|
+
bool disable_shadow_host_suffix_append = 6;
|
|
908
|
+
|
|
909
|
+
// Specifies a list of header mutations that should be applied to each mirrored request.
|
|
910
|
+
// Header mutations are applied in the order they are specified. For more information, including
|
|
911
|
+
// details on header value syntax, see the documentation on :ref:`custom request headers
|
|
912
|
+
// <config_http_conn_man_headers_custom_request_headers>`.
|
|
913
|
+
repeated common.mutation_rules.v3.HeaderMutation request_headers_mutations = 7
|
|
914
|
+
[(validate.rules).repeated = {max_items: 1000}];
|
|
915
|
+
|
|
916
|
+
// Indicates that during mirroring, the host header will be swapped with this value.
|
|
917
|
+
// :ref:`disable_shadow_host_suffix_append
|
|
918
|
+
// <envoy_v3_api_field_config.route.v3.RouteAction.RequestMirrorPolicy.disable_shadow_host_suffix_append>`
|
|
919
|
+
// is implicitly enabled if this field is set.
|
|
920
|
+
string host_rewrite_literal = 8
|
|
921
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
|
|
925
|
+
// <arch_overview_load_balancing_types>`.
|
|
926
|
+
// [#next-free-field: 7]
|
|
927
|
+
message HashPolicy {
|
|
928
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
929
|
+
"envoy.api.v2.route.RouteAction.HashPolicy";
|
|
930
|
+
|
|
931
|
+
message Header {
|
|
932
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
933
|
+
"envoy.api.v2.route.RouteAction.HashPolicy.Header";
|
|
934
|
+
|
|
935
|
+
// The name of the request header that will be used to obtain the hash
|
|
936
|
+
// key. If the request header is not present, no hash will be produced.
|
|
937
|
+
string header_name = 1
|
|
938
|
+
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
939
|
+
|
|
940
|
+
// If specified, the request header value will be rewritten and used
|
|
941
|
+
// to produce the hash key.
|
|
942
|
+
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// CookieAttribute defines an API for adding additional attributes for a HTTP cookie.
|
|
946
|
+
message CookieAttribute {
|
|
947
|
+
// The name of the cookie attribute.
|
|
948
|
+
string name = 1
|
|
949
|
+
[(validate.rules).string =
|
|
950
|
+
{min_len: 1 max_bytes: 16384 well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
951
|
+
|
|
952
|
+
// The optional value of the cookie attribute.
|
|
953
|
+
string value = 2 [(validate.rules).string =
|
|
954
|
+
{max_bytes: 16384 well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// Envoy supports two types of cookie affinity:
|
|
958
|
+
//
|
|
959
|
+
// 1. Passive. Envoy takes a cookie that's present in the cookies header and
|
|
960
|
+
// hashes on its value.
|
|
961
|
+
//
|
|
962
|
+
// 2. Generated. Envoy generates and sets a cookie with an expiration (TTL)
|
|
963
|
+
// on the first request from the client in its response to the client,
|
|
964
|
+
// based on the endpoint the request gets sent to. The client then
|
|
965
|
+
// presents this on the next and all subsequent requests. The hash of
|
|
966
|
+
// this is sufficient to ensure these requests get sent to the same
|
|
967
|
+
// endpoint. The cookie is generated by hashing the source and
|
|
968
|
+
// destination ports and addresses so that multiple independent HTTP2
|
|
969
|
+
// streams on the same connection will independently receive the same
|
|
970
|
+
// cookie, even if they arrive at the Envoy simultaneously.
|
|
971
|
+
message Cookie {
|
|
972
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
973
|
+
"envoy.api.v2.route.RouteAction.HashPolicy.Cookie";
|
|
974
|
+
|
|
975
|
+
// The name of the cookie that will be used to obtain the hash key. If the
|
|
976
|
+
// cookie is not present and ttl below is not set, no hash will be
|
|
977
|
+
// produced.
|
|
978
|
+
string name = 1 [(validate.rules).string = {min_len: 1}];
|
|
979
|
+
|
|
980
|
+
// If specified, a cookie with the TTL will be generated if the cookie is
|
|
981
|
+
// not present. If the TTL is present and zero, the generated cookie will
|
|
982
|
+
// be a session cookie.
|
|
983
|
+
google.protobuf.Duration ttl = 2;
|
|
984
|
+
|
|
985
|
+
// The name of the path for the cookie. If no path is specified here, no path
|
|
986
|
+
// will be set for the cookie.
|
|
987
|
+
string path = 3;
|
|
988
|
+
|
|
989
|
+
// Additional attributes for the cookie. They will be used when generating a new cookie.
|
|
990
|
+
repeated CookieAttribute attributes = 4;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
message ConnectionProperties {
|
|
994
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
995
|
+
"envoy.api.v2.route.RouteAction.HashPolicy.ConnectionProperties";
|
|
996
|
+
|
|
997
|
+
// Hash on source IP address.
|
|
998
|
+
bool source_ip = 1;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
message QueryParameter {
|
|
1002
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1003
|
+
"envoy.api.v2.route.RouteAction.HashPolicy.QueryParameter";
|
|
1004
|
+
|
|
1005
|
+
// The name of the URL query parameter that will be used to obtain the hash
|
|
1006
|
+
// key. If the parameter is not present, no hash will be produced. Query
|
|
1007
|
+
// parameter names are case-sensitive. If query parameters are repeated, only
|
|
1008
|
+
// the first value will be considered.
|
|
1009
|
+
string name = 1 [(validate.rules).string = {min_len: 1}];
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
message FilterState {
|
|
1013
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1014
|
+
"envoy.api.v2.route.RouteAction.HashPolicy.FilterState";
|
|
1015
|
+
|
|
1016
|
+
// The name of the Object in the per-request filterState, which is an
|
|
1017
|
+
// Envoy::Hashable object. If there is no data associated with the key,
|
|
1018
|
+
// or the stored object is not Envoy::Hashable, no hash will be produced.
|
|
1019
|
+
string key = 1 [(validate.rules).string = {min_len: 1}];
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
oneof policy_specifier {
|
|
1023
|
+
option (validate.required) = true;
|
|
1024
|
+
|
|
1025
|
+
// Header hash policy.
|
|
1026
|
+
Header header = 1;
|
|
1027
|
+
|
|
1028
|
+
// Cookie hash policy.
|
|
1029
|
+
Cookie cookie = 2;
|
|
1030
|
+
|
|
1031
|
+
// Connection properties hash policy.
|
|
1032
|
+
ConnectionProperties connection_properties = 3;
|
|
1033
|
+
|
|
1034
|
+
// Query parameter hash policy.
|
|
1035
|
+
QueryParameter query_parameter = 5;
|
|
1036
|
+
|
|
1037
|
+
// Filter state hash policy.
|
|
1038
|
+
FilterState filter_state = 6;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// The flag that short-circuits the hash computing. This field provides a
|
|
1042
|
+
// 'fallback' style of configuration: "if a terminal policy doesn't work,
|
|
1043
|
+
// fallback to rest of the policy list", it saves time when the terminal
|
|
1044
|
+
// policy works.
|
|
1045
|
+
//
|
|
1046
|
+
// If true, and there is already a hash computed, ignore rest of the
|
|
1047
|
+
// list of hash polices.
|
|
1048
|
+
// For example, if the following hash methods are configured:
|
|
1049
|
+
//
|
|
1050
|
+
// ========= ========
|
|
1051
|
+
// specifier terminal
|
|
1052
|
+
// ========= ========
|
|
1053
|
+
// Header A true
|
|
1054
|
+
// Header B false
|
|
1055
|
+
// Header C false
|
|
1056
|
+
// ========= ========
|
|
1057
|
+
//
|
|
1058
|
+
// The generateHash process ends if policy "header A" generates a hash, as
|
|
1059
|
+
// it's a terminal policy.
|
|
1060
|
+
bool terminal = 4;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// Allows enabling and disabling upgrades on a per-route basis.
|
|
1064
|
+
// This overrides any enabled/disabled upgrade filter chain specified in the
|
|
1065
|
+
// HttpConnectionManager
|
|
1066
|
+
// :ref:`upgrade_configs
|
|
1067
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.upgrade_configs>`
|
|
1068
|
+
// but does not affect any custom filter chain specified there.
|
|
1069
|
+
message UpgradeConfig {
|
|
1070
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1071
|
+
"envoy.api.v2.route.RouteAction.UpgradeConfig";
|
|
1072
|
+
|
|
1073
|
+
// Configuration for sending data upstream as a raw data payload. This is used for
|
|
1074
|
+
// CONNECT or POST requests, when forwarding request payload as raw TCP.
|
|
1075
|
+
message ConnectConfig {
|
|
1076
|
+
// If present, the proxy protocol header will be prepended to the CONNECT payload sent upstream.
|
|
1077
|
+
core.v3.ProxyProtocolConfig proxy_protocol_config = 1;
|
|
1078
|
+
|
|
1079
|
+
// If set, the route will also allow forwarding POST payload as raw TCP.
|
|
1080
|
+
bool allow_post = 2;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// The case-insensitive name of this upgrade, for example, "websocket".
|
|
1084
|
+
// For each upgrade type present in upgrade_configs, requests with
|
|
1085
|
+
// Upgrade: [upgrade_type] will be proxied upstream.
|
|
1086
|
+
string upgrade_type = 1
|
|
1087
|
+
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
1088
|
+
|
|
1089
|
+
// Determines if upgrades are available on this route.
|
|
1090
|
+
//
|
|
1091
|
+
// Defaults to ``true``.
|
|
1092
|
+
google.protobuf.BoolValue enabled = 2;
|
|
1093
|
+
|
|
1094
|
+
// Configuration for sending data upstream as a raw data payload. This is used for
|
|
1095
|
+
// CONNECT requests, when forwarding CONNECT payload as raw TCP.
|
|
1096
|
+
// Note that CONNECT support is currently considered alpha in Envoy.
|
|
1097
|
+
// [#comment: TODO(htuch): Replace the above comment with an alpha tag.]
|
|
1098
|
+
ConnectConfig connect_config = 3;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
message MaxStreamDuration {
|
|
1102
|
+
// Specifies the maximum duration allowed for streams on the route. If not specified, the value
|
|
1103
|
+
// from the :ref:`max_stream_duration
|
|
1104
|
+
// <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.max_stream_duration>` field in
|
|
1105
|
+
// :ref:`HttpConnectionManager.common_http_protocol_options
|
|
1106
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.common_http_protocol_options>`
|
|
1107
|
+
// is used. If this field is set explicitly to zero, any
|
|
1108
|
+
// HttpConnectionManager max_stream_duration timeout will be disabled for
|
|
1109
|
+
// this route.
|
|
1110
|
+
google.protobuf.Duration max_stream_duration = 1;
|
|
1111
|
+
|
|
1112
|
+
// If present, and the request contains a `grpc-timeout header
|
|
1113
|
+
// <https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_, use that value as the
|
|
1114
|
+
// ``max_stream_duration``, but limit the applied timeout to the maximum value specified here.
|
|
1115
|
+
// If set to 0, the ``grpc-timeout`` header is used without modification.
|
|
1116
|
+
google.protobuf.Duration grpc_timeout_header_max = 2;
|
|
1117
|
+
|
|
1118
|
+
// If present, Envoy will adjust the timeout provided by the ``grpc-timeout`` header by
|
|
1119
|
+
// subtracting the provided duration from the header. This is useful for allowing Envoy to set
|
|
1120
|
+
// its global timeout to be less than that of the deadline imposed by the calling client, which
|
|
1121
|
+
// makes it more likely that Envoy will handle the timeout instead of having the call canceled
|
|
1122
|
+
// by the client. If, after applying the offset, the resulting timeout is zero or negative,
|
|
1123
|
+
// the stream will timeout immediately.
|
|
1124
|
+
google.protobuf.Duration grpc_timeout_header_offset = 3;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
reserved 12, 18, 19, 16, 22, 21, 10;
|
|
1128
|
+
|
|
1129
|
+
reserved "request_mirror_policy";
|
|
1130
|
+
|
|
1131
|
+
oneof cluster_specifier {
|
|
1132
|
+
option (validate.required) = true;
|
|
1133
|
+
|
|
1134
|
+
// Indicates the upstream cluster to which the request should be routed
|
|
1135
|
+
// to.
|
|
1136
|
+
string cluster = 1 [(validate.rules).string = {min_len: 1}];
|
|
1137
|
+
|
|
1138
|
+
// Envoy will determine the cluster to route to by reading the value of the
|
|
1139
|
+
// HTTP header named by cluster_header from the request headers. If the
|
|
1140
|
+
// header is not found or the referenced cluster does not exist, Envoy will
|
|
1141
|
+
// return a 404 response.
|
|
1142
|
+
//
|
|
1143
|
+
// .. attention::
|
|
1144
|
+
//
|
|
1145
|
+
// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
|
|
1146
|
+
// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
|
|
1147
|
+
//
|
|
1148
|
+
// .. note::
|
|
1149
|
+
//
|
|
1150
|
+
// If the header appears multiple times only the first value is used.
|
|
1151
|
+
string cluster_header = 2
|
|
1152
|
+
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
1153
|
+
|
|
1154
|
+
// Multiple upstream clusters can be specified for a given route. The
|
|
1155
|
+
// request is routed to one of the upstream clusters based on weights
|
|
1156
|
+
// assigned to each cluster. See
|
|
1157
|
+
// :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
|
|
1158
|
+
// for additional documentation.
|
|
1159
|
+
WeightedCluster weighted_clusters = 3;
|
|
1160
|
+
|
|
1161
|
+
// Name of the cluster specifier plugin to use to determine the cluster for requests on this route.
|
|
1162
|
+
// The cluster specifier plugin name must be defined in the associated
|
|
1163
|
+
// :ref:`cluster specifier plugins <envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins>`
|
|
1164
|
+
// in the :ref:`name <envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name>` field.
|
|
1165
|
+
string cluster_specifier_plugin = 37;
|
|
1166
|
+
|
|
1167
|
+
// Custom cluster specifier plugin configuration to use to determine the cluster for requests
|
|
1168
|
+
// on this route.
|
|
1169
|
+
ClusterSpecifierPlugin inline_cluster_specifier_plugin = 39;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// The HTTP status code to use when configured cluster is not found.
|
|
1173
|
+
// The default response code is 503 Service Unavailable.
|
|
1174
|
+
ClusterNotFoundResponseCode cluster_not_found_response_code = 20
|
|
1175
|
+
[(validate.rules).enum = {defined_only: true}];
|
|
1176
|
+
|
|
1177
|
+
// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints
|
|
1178
|
+
// in the upstream cluster with metadata matching what's set in this field will be considered
|
|
1179
|
+
// for load balancing. If using :ref:`weighted_clusters
|
|
1180
|
+
// <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>`, metadata will be merged, with values
|
|
1181
|
+
// provided there taking precedence. The filter name should be specified as ``envoy.lb``.
|
|
1182
|
+
core.v3.Metadata metadata_match = 4;
|
|
1183
|
+
|
|
1184
|
+
// Indicates that during forwarding, the matched prefix (or path) should be
|
|
1185
|
+
// swapped with this value. This option allows application URLs to be rooted
|
|
1186
|
+
// at a different path from those exposed at the reverse proxy layer. The router filter will
|
|
1187
|
+
// place the original path before rewrite into the :ref:`x-envoy-original-path
|
|
1188
|
+
// <config_http_filters_router_x-envoy-original-path>` header.
|
|
1189
|
+
//
|
|
1190
|
+
// Only one of :ref:`regex_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.regex_rewrite>`,
|
|
1191
|
+
// :ref:`path_rewrite_policy <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite_policy>`,
|
|
1192
|
+
// :ref:`path_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite>`,
|
|
1193
|
+
// or :ref:`prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>`
|
|
1194
|
+
// may be specified.
|
|
1195
|
+
//
|
|
1196
|
+
// .. attention::
|
|
1197
|
+
//
|
|
1198
|
+
// Pay careful attention to the use of trailing slashes in the
|
|
1199
|
+
// :ref:`route's match <envoy_v3_api_field_config.route.v3.Route.match>` prefix value.
|
|
1200
|
+
// Stripping a prefix from a path requires multiple Routes to handle all cases. For example,
|
|
1201
|
+
// rewriting ``/prefix`` to ``/`` and ``/prefix/etc`` to ``/etc`` cannot be done in a single
|
|
1202
|
+
// :ref:`Route <envoy_v3_api_msg_config.route.v3.Route>`, as shown by the below config entries:
|
|
1203
|
+
//
|
|
1204
|
+
// .. code-block:: yaml
|
|
1205
|
+
//
|
|
1206
|
+
// - match:
|
|
1207
|
+
// prefix: "/prefix/"
|
|
1208
|
+
// route:
|
|
1209
|
+
// prefix_rewrite: "/"
|
|
1210
|
+
// - match:
|
|
1211
|
+
// prefix: "/prefix"
|
|
1212
|
+
// route:
|
|
1213
|
+
// prefix_rewrite: "/"
|
|
1214
|
+
//
|
|
1215
|
+
// Having above entries in the config, requests to ``/prefix`` will be stripped to ``/``, while
|
|
1216
|
+
// requests to ``/prefix/etc`` will be stripped to ``/etc``.
|
|
1217
|
+
string prefix_rewrite = 5
|
|
1218
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
1219
|
+
|
|
1220
|
+
// Indicates that during forwarding, portions of the path that match the
|
|
1221
|
+
// pattern should be rewritten, even allowing the substitution of capture
|
|
1222
|
+
// groups from the pattern into the new path as specified by the rewrite
|
|
1223
|
+
// substitution string. This is useful to allow application paths to be
|
|
1224
|
+
// rewritten in a way that is aware of segments with variable content like
|
|
1225
|
+
// identifiers. The router filter will place the original path as it was
|
|
1226
|
+
// before the rewrite into the :ref:`x-envoy-original-path
|
|
1227
|
+
// <config_http_filters_router_x-envoy-original-path>` header.
|
|
1228
|
+
//
|
|
1229
|
+
// Only one of :ref:`regex_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.regex_rewrite>`,
|
|
1230
|
+
// :ref:`path_rewrite_policy <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite_policy>`,
|
|
1231
|
+
// :ref:`path_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite>`,
|
|
1232
|
+
// or :ref:`prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>`
|
|
1233
|
+
// may be specified.
|
|
1234
|
+
//
|
|
1235
|
+
// Examples using Google's `RE2 <https://github.com/google/re2>`_ engine:
|
|
1236
|
+
//
|
|
1237
|
+
// * The path pattern ``^/service/([^/]+)(/.*)$`` paired with a substitution
|
|
1238
|
+
// string of ``\2/instance/\1`` would transform ``/service/foo/v1/api``
|
|
1239
|
+
// into ``/v1/api/instance/foo``.
|
|
1240
|
+
//
|
|
1241
|
+
// * The pattern ``one`` paired with a substitution string of ``two`` would
|
|
1242
|
+
// transform ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/two/zzz``.
|
|
1243
|
+
//
|
|
1244
|
+
// * The pattern ``^(.*?)one(.*)$`` paired with a substitution string of
|
|
1245
|
+
// ``\1two\2`` would replace only the first occurrence of ``one``,
|
|
1246
|
+
// transforming path ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/one/zzz``.
|
|
1247
|
+
//
|
|
1248
|
+
// * The pattern ``(?i)/xxx/`` paired with a substitution string of ``/yyy/``
|
|
1249
|
+
// would do a case-insensitive match and transform path ``/aaa/XxX/bbb`` to
|
|
1250
|
+
// ``/aaa/yyy/bbb``.
|
|
1251
|
+
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 32;
|
|
1252
|
+
|
|
1253
|
+
// [#extension-category: envoy.path.rewrite]
|
|
1254
|
+
core.v3.TypedExtensionConfig path_rewrite_policy = 41;
|
|
1255
|
+
|
|
1256
|
+
// Rewrites the whole path (without query parameters) with the given path value.
|
|
1257
|
+
// The router filter will
|
|
1258
|
+
// place the original path before rewrite into the :ref:`x-envoy-original-path
|
|
1259
|
+
// <config_http_filters_router_x-envoy-original-path>` header.
|
|
1260
|
+
//
|
|
1261
|
+
// Only one of :ref:`regex_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.regex_rewrite>`,
|
|
1262
|
+
// :ref:`path_rewrite_policy <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite_policy>`,
|
|
1263
|
+
// :ref:`path_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite>`,
|
|
1264
|
+
// or :ref:`prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>`
|
|
1265
|
+
// may be specified.
|
|
1266
|
+
//
|
|
1267
|
+
// The :ref:`substitution format specifier <config_access_log_format>` could be applied here.
|
|
1268
|
+
// For example, with the following config:
|
|
1269
|
+
//
|
|
1270
|
+
// .. code-block:: yaml
|
|
1271
|
+
//
|
|
1272
|
+
// path_rewrite: "/new_path_prefix%REQ(custom-path-header-name)%"
|
|
1273
|
+
//
|
|
1274
|
+
// Would rewrite the path to ``/new_path_prefix/some_value`` given the header
|
|
1275
|
+
// ``custom-path-header-name: some_value``. If the header is not present, the path will be
|
|
1276
|
+
// rewritten to ``/new_path_prefix``.
|
|
1277
|
+
//
|
|
1278
|
+
//
|
|
1279
|
+
// If the final output of the path rewrite is empty, then the update will be ignored and the
|
|
1280
|
+
// original path will be preserved.
|
|
1281
|
+
string path_rewrite = 45;
|
|
1282
|
+
|
|
1283
|
+
// If one of the host rewrite specifiers is set and the
|
|
1284
|
+
// :ref:`suppress_envoy_headers
|
|
1285
|
+
// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag is not
|
|
1286
|
+
// set to true, the router filter will place the original host header value before
|
|
1287
|
+
// rewriting into the :ref:`x-envoy-original-host
|
|
1288
|
+
// <config_http_filters_router_x-envoy-original-host>` header.
|
|
1289
|
+
//
|
|
1290
|
+
// And if the
|
|
1291
|
+
// :ref:`append_x_forwarded_host <envoy_v3_api_field_config.route.v3.RouteAction.append_x_forwarded_host>`
|
|
1292
|
+
// is set to true, the original host value will also be appended to the
|
|
1293
|
+
// :ref:`config_http_conn_man_headers_x-forwarded-host` header.
|
|
1294
|
+
//
|
|
1295
|
+
oneof host_rewrite_specifier {
|
|
1296
|
+
// Indicates that during forwarding, the host header will be swapped with
|
|
1297
|
+
// this value.
|
|
1298
|
+
string host_rewrite_literal = 6
|
|
1299
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
1300
|
+
|
|
1301
|
+
// Indicates that during forwarding, the host header will be swapped with
|
|
1302
|
+
// the hostname of the upstream host chosen by the cluster manager. This
|
|
1303
|
+
// option is applicable only when the destination cluster for a route is of
|
|
1304
|
+
// type ``strict_dns`` or ``logical_dns``,
|
|
1305
|
+
// or when :ref:`hostname <envoy_v3_api_field_config.endpoint.v3.Endpoint.hostname>`
|
|
1306
|
+
// field is not empty. Setting this to true with other cluster types
|
|
1307
|
+
// has no effect.
|
|
1308
|
+
google.protobuf.BoolValue auto_host_rewrite = 7;
|
|
1309
|
+
|
|
1310
|
+
// Indicates that during forwarding, the host header will be swapped with the content of given
|
|
1311
|
+
// downstream or :ref:`custom <config_http_conn_man_headers_custom_request_headers>` header.
|
|
1312
|
+
// If header value is empty, host header is left intact.
|
|
1313
|
+
//
|
|
1314
|
+
// .. attention::
|
|
1315
|
+
//
|
|
1316
|
+
// Pay attention to the potential security implications of using this option. Provided header
|
|
1317
|
+
// must come from trusted source.
|
|
1318
|
+
//
|
|
1319
|
+
// .. note::
|
|
1320
|
+
//
|
|
1321
|
+
// If the header appears multiple times only the first value is used.
|
|
1322
|
+
string host_rewrite_header = 29
|
|
1323
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
1324
|
+
|
|
1325
|
+
// Indicates that during forwarding, the host header will be swapped with
|
|
1326
|
+
// the result of the regex substitution executed on path value with query and fragment removed.
|
|
1327
|
+
// This is useful for transitioning variable content between path segment and subdomain.
|
|
1328
|
+
//
|
|
1329
|
+
// For example with the following config:
|
|
1330
|
+
//
|
|
1331
|
+
// .. code-block:: yaml
|
|
1332
|
+
//
|
|
1333
|
+
// host_rewrite_path_regex:
|
|
1334
|
+
// pattern:
|
|
1335
|
+
// google_re2: {}
|
|
1336
|
+
// regex: "^/(.+)/.+$"
|
|
1337
|
+
// substitution: \1
|
|
1338
|
+
//
|
|
1339
|
+
// Would rewrite the host header to ``envoyproxy.io`` given the path ``/envoyproxy.io/some/path``.
|
|
1340
|
+
type.matcher.v3.RegexMatchAndSubstitute host_rewrite_path_regex = 35;
|
|
1341
|
+
|
|
1342
|
+
// Rewrites the host header with the value of this field. The router filter will
|
|
1343
|
+
// place the original host header value before rewriting into the :ref:`x-envoy-original-host
|
|
1344
|
+
// <config_http_filters_router_x-envoy-original-host>` header.
|
|
1345
|
+
//
|
|
1346
|
+
// The :ref:`substitution format specifier <config_access_log_format>` could be applied here.
|
|
1347
|
+
// For example, with the following config:
|
|
1348
|
+
//
|
|
1349
|
+
// .. code-block:: yaml
|
|
1350
|
+
//
|
|
1351
|
+
// host_rewrite: "prefix-%REQ(custom-host-header-name)%"
|
|
1352
|
+
//
|
|
1353
|
+
// Would rewrite the host header to ``prefix-some_value`` given the header
|
|
1354
|
+
// ``custom-host-header-name: some_value``. If the header is not present, the host header will
|
|
1355
|
+
// be rewritten to an value of ``prefix-``.
|
|
1356
|
+
//
|
|
1357
|
+
// If the final output of the host rewrite is empty, then the update will be ignored and the
|
|
1358
|
+
// original host header will be preserved.
|
|
1359
|
+
string host_rewrite = 44;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
// If set, then a host rewrite action (one of
|
|
1363
|
+
// :ref:`host_rewrite_literal <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_literal>`,
|
|
1364
|
+
// :ref:`auto_host_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.auto_host_rewrite>`,
|
|
1365
|
+
// :ref:`host_rewrite_header <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_header>`, or
|
|
1366
|
+
// :ref:`host_rewrite_path_regex <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_path_regex>`)
|
|
1367
|
+
// causes the original value of the host header, if any, to be appended to the
|
|
1368
|
+
// :ref:`config_http_conn_man_headers_x-forwarded-host` HTTP header if it is different to the last value appended.
|
|
1369
|
+
bool append_x_forwarded_host = 38;
|
|
1370
|
+
|
|
1371
|
+
// Specifies the upstream timeout for the route. If not specified, the default is 15s. This
|
|
1372
|
+
// spans between the point at which the entire downstream request (i.e. end-of-stream) has been
|
|
1373
|
+
// processed and when the upstream response has been completely processed. A value of 0 will
|
|
1374
|
+
// disable the route's timeout.
|
|
1375
|
+
//
|
|
1376
|
+
// .. note::
|
|
1377
|
+
//
|
|
1378
|
+
// This timeout includes all retries. See also
|
|
1379
|
+
// :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`,
|
|
1380
|
+
// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the
|
|
1381
|
+
// :ref:`retry overview <arch_overview_http_routing_retry>`.
|
|
1382
|
+
google.protobuf.Duration timeout = 8;
|
|
1383
|
+
|
|
1384
|
+
// Specifies the idle timeout for the route. If not specified, there is no per-route idle timeout,
|
|
1385
|
+
// although the connection manager wide :ref:`stream_idle_timeout
|
|
1386
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
|
|
1387
|
+
// will still apply. A value of 0 will completely disable the route's idle timeout, even if a
|
|
1388
|
+
// connection manager stream idle timeout is configured.
|
|
1389
|
+
//
|
|
1390
|
+
// The idle timeout is distinct to :ref:`timeout
|
|
1391
|
+
// <envoy_v3_api_field_config.route.v3.RouteAction.timeout>`, which provides an upper bound
|
|
1392
|
+
// on the upstream response time; :ref:`idle_timeout
|
|
1393
|
+
// <envoy_v3_api_field_config.route.v3.RouteAction.idle_timeout>` instead bounds the amount
|
|
1394
|
+
// of time the request's stream may be idle.
|
|
1395
|
+
//
|
|
1396
|
+
// After header decoding, the idle timeout will apply on downstream and
|
|
1397
|
+
// upstream request events. Each time an encode/decode event for headers or
|
|
1398
|
+
// data is processed for the stream, the timer will be reset. If the timeout
|
|
1399
|
+
// fires, the stream is terminated with a 408 Request Timeout error code if no
|
|
1400
|
+
// upstream response header has been received, otherwise a stream reset
|
|
1401
|
+
// occurs.
|
|
1402
|
+
//
|
|
1403
|
+
// If the :ref:`overload action <config_overload_manager_overload_actions>` "envoy.overload_actions.reduce_timeouts"
|
|
1404
|
+
// is configured, this timeout is scaled according to the value for
|
|
1405
|
+
// :ref:`HTTP_DOWNSTREAM_STREAM_IDLE <envoy_v3_api_enum_value_config.overload.v3.ScaleTimersOverloadActionConfig.TimerType.HTTP_DOWNSTREAM_STREAM_IDLE>`.
|
|
1406
|
+
//
|
|
1407
|
+
// This timeout may also be used in place of ``flush_timeout`` in very specific cases. See the
|
|
1408
|
+
// documentation for ``flush_timeout`` for more details.
|
|
1409
|
+
google.protobuf.Duration idle_timeout = 24;
|
|
1410
|
+
|
|
1411
|
+
// Specifies the codec stream flush timeout for the route.
|
|
1412
|
+
//
|
|
1413
|
+
// If not specified, the first preference is the global :ref:`stream_flush_timeout
|
|
1414
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_flush_timeout>`,
|
|
1415
|
+
// but only if explicitly configured.
|
|
1416
|
+
//
|
|
1417
|
+
// If neither the explicit HCM-wide flush timeout nor this route-specific flush timeout is configured,
|
|
1418
|
+
// the route's stream idle timeout is reused for this timeout. This is for
|
|
1419
|
+
// backwards compatibility since both behaviors were historically controlled by the one timeout.
|
|
1420
|
+
//
|
|
1421
|
+
// If the route also does not have an idle timeout configured, the global :ref:`stream_idle_timeout
|
|
1422
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`. used, again
|
|
1423
|
+
// for backwards compatibility. That timeout defaults to 5 minutes.
|
|
1424
|
+
//
|
|
1425
|
+
// A value of 0 via any of the above paths will completely disable the timeout for a given route.
|
|
1426
|
+
google.protobuf.Duration flush_timeout = 42;
|
|
1427
|
+
|
|
1428
|
+
// Specifies how to send request over TLS early data.
|
|
1429
|
+
// If absent, allows `safe HTTP requests <https://www.rfc-editor.org/rfc/rfc7231#section-4.2.1>`_ to be sent on early data.
|
|
1430
|
+
// [#extension-category: envoy.route.early_data_policy]
|
|
1431
|
+
core.v3.TypedExtensionConfig early_data_policy = 40;
|
|
1432
|
+
|
|
1433
|
+
// Indicates that the route has a retry policy. Note that if this is set,
|
|
1434
|
+
// it'll take precedence over the virtual host level retry policy entirely
|
|
1435
|
+
// (e.g., policies are not merged, the most internal one becomes the enforced policy).
|
|
1436
|
+
RetryPolicy retry_policy = 9;
|
|
1437
|
+
|
|
1438
|
+
// [#not-implemented-hide:]
|
|
1439
|
+
// Specifies the configuration for retry policy extension. Note that if this is set, it'll take
|
|
1440
|
+
// precedence over the virtual host level retry policy entirely (e.g., policies are not merged,
|
|
1441
|
+
// the most internal one becomes the enforced policy). :ref:`Retry policy <envoy_v3_api_field_config.route.v3.VirtualHost.retry_policy>`
|
|
1442
|
+
// should not be set if this field is used.
|
|
1443
|
+
google.protobuf.Any retry_policy_typed_config = 33;
|
|
1444
|
+
|
|
1445
|
+
// Specify a set of route request mirroring policies.
|
|
1446
|
+
// It takes precedence over the virtual host and route config mirror policy entirely.
|
|
1447
|
+
// That is, policies are not merged, the most specific non-empty one becomes the mirror policies.
|
|
1448
|
+
repeated RequestMirrorPolicy request_mirror_policies = 30;
|
|
1449
|
+
|
|
1450
|
+
// Optionally specifies the :ref:`routing priority <arch_overview_http_routing_priority>`.
|
|
1451
|
+
core.v3.RoutingPriority priority = 11 [(validate.rules).enum = {defined_only: true}];
|
|
1452
|
+
|
|
1453
|
+
// Specifies a set of rate limit configurations that could be applied to the
|
|
1454
|
+
// route.
|
|
1455
|
+
repeated RateLimit rate_limits = 13;
|
|
1456
|
+
|
|
1457
|
+
// Specifies if the rate limit filter should include the virtual host rate
|
|
1458
|
+
// limits. By default, if the route configured rate limits, the virtual host
|
|
1459
|
+
// :ref:`rate_limits <envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` are not applied to the
|
|
1460
|
+
// request.
|
|
1461
|
+
//
|
|
1462
|
+
// .. attention::
|
|
1463
|
+
//
|
|
1464
|
+
// This field is deprecated. Please use :ref:`vh_rate_limits <envoy_v3_api_field_extensions.filters.http.ratelimit.v3.RateLimitPerRoute.vh_rate_limits>`
|
|
1465
|
+
google.protobuf.BoolValue include_vh_rate_limits = 14
|
|
1466
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
1467
|
+
|
|
1468
|
+
// Specifies a list of hash policies to use for ring hash load balancing. Each
|
|
1469
|
+
// hash policy is evaluated individually and the combined result is used to
|
|
1470
|
+
// route the request. The method of combination is deterministic such that
|
|
1471
|
+
// identical lists of hash policies will produce the same hash. Since a hash
|
|
1472
|
+
// policy examines specific parts of a request, it can fail to produce a hash
|
|
1473
|
+
// (i.e. if the hashed header is not present). If (and only if) all configured
|
|
1474
|
+
// hash policies fail to generate a hash, no hash will be produced for
|
|
1475
|
+
// the route. In this case, the behavior is the same as if no hash policies
|
|
1476
|
+
// were specified (i.e. the ring hash load balancer will choose a random
|
|
1477
|
+
// backend). If a hash policy has the "terminal" attribute set to true, and
|
|
1478
|
+
// there is already a hash generated, the hash is returned immediately,
|
|
1479
|
+
// ignoring the rest of the hash policy list.
|
|
1480
|
+
repeated HashPolicy hash_policy = 15;
|
|
1481
|
+
|
|
1482
|
+
// Indicates that the route has a CORS policy. This field is ignored if related cors policy is
|
|
1483
|
+
// found in the :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>` or
|
|
1484
|
+
// :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_v3_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`.
|
|
1485
|
+
//
|
|
1486
|
+
// .. attention::
|
|
1487
|
+
//
|
|
1488
|
+
// This option has been deprecated. Please use
|
|
1489
|
+
// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>` or
|
|
1490
|
+
// :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_v3_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`
|
|
1491
|
+
// to configure the CORS HTTP filter.
|
|
1492
|
+
CorsPolicy cors = 17 [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
1493
|
+
|
|
1494
|
+
// Deprecated by :ref:`grpc_timeout_header_max <envoy_v3_api_field_config.route.v3.RouteAction.MaxStreamDuration.grpc_timeout_header_max>`
|
|
1495
|
+
// If present, and the request is a gRPC request, use the
|
|
1496
|
+
// `grpc-timeout header <https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_,
|
|
1497
|
+
// or its default value (infinity) instead of
|
|
1498
|
+
// :ref:`timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>`, but limit the applied timeout
|
|
1499
|
+
// to the maximum value specified here. If configured as 0, the maximum allowed timeout for
|
|
1500
|
+
// gRPC requests is infinity. If not configured at all, the ``grpc-timeout`` header is not used
|
|
1501
|
+
// and gRPC requests time out like any other requests using
|
|
1502
|
+
// :ref:`timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` or its default.
|
|
1503
|
+
// This can be used to prevent unexpected upstream request timeouts due to potentially long
|
|
1504
|
+
// time gaps between gRPC request and response in gRPC streaming mode.
|
|
1505
|
+
//
|
|
1506
|
+
// .. note::
|
|
1507
|
+
//
|
|
1508
|
+
// If a timeout is specified using :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`, it takes
|
|
1509
|
+
// precedence over `grpc-timeout header <https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_, when
|
|
1510
|
+
// both are present. See also
|
|
1511
|
+
// :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`,
|
|
1512
|
+
// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the
|
|
1513
|
+
// :ref:`retry overview <arch_overview_http_routing_retry>`.
|
|
1514
|
+
google.protobuf.Duration max_grpc_timeout = 23
|
|
1515
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
1516
|
+
|
|
1517
|
+
// Deprecated by :ref:`grpc_timeout_header_offset <envoy_v3_api_field_config.route.v3.RouteAction.MaxStreamDuration.grpc_timeout_header_offset>`.
|
|
1518
|
+
// If present, Envoy will adjust the timeout provided by the ``grpc-timeout`` header by subtracting
|
|
1519
|
+
// the provided duration from the header. This is useful in allowing Envoy to set its global
|
|
1520
|
+
// timeout to be less than that of the deadline imposed by the calling client, which makes it more
|
|
1521
|
+
// likely that Envoy will handle the timeout instead of having the call canceled by the client.
|
|
1522
|
+
// The offset will only be applied if the provided grpc_timeout is greater than the offset. This
|
|
1523
|
+
// ensures that the offset will only ever decrease the timeout and never set it to 0 (meaning
|
|
1524
|
+
// infinity).
|
|
1525
|
+
google.protobuf.Duration grpc_timeout_offset = 28
|
|
1526
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
1527
|
+
|
|
1528
|
+
repeated UpgradeConfig upgrade_configs = 25;
|
|
1529
|
+
|
|
1530
|
+
// If present, Envoy will try to follow an upstream redirect response instead of proxying the
|
|
1531
|
+
// response back to the downstream. An upstream redirect response is defined
|
|
1532
|
+
// by :ref:`redirect_response_codes
|
|
1533
|
+
// <envoy_v3_api_field_config.route.v3.InternalRedirectPolicy.redirect_response_codes>`.
|
|
1534
|
+
InternalRedirectPolicy internal_redirect_policy = 34;
|
|
1535
|
+
|
|
1536
|
+
InternalRedirectAction internal_redirect_action = 26
|
|
1537
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
1538
|
+
|
|
1539
|
+
// An internal redirect is handled, iff the number of previous internal redirects that a
|
|
1540
|
+
// downstream request has encountered is lower than this value, and
|
|
1541
|
+
// :ref:`internal_redirect_action <envoy_v3_api_field_config.route.v3.RouteAction.internal_redirect_action>`
|
|
1542
|
+
// is set to :ref:`HANDLE_INTERNAL_REDIRECT
|
|
1543
|
+
// <envoy_v3_api_enum_value_config.route.v3.RouteAction.InternalRedirectAction.HANDLE_INTERNAL_REDIRECT>`
|
|
1544
|
+
// In the case where a downstream request is bounced among multiple routes by internal redirect,
|
|
1545
|
+
// the first route that hits this threshold, or has
|
|
1546
|
+
// :ref:`internal_redirect_action <envoy_v3_api_field_config.route.v3.RouteAction.internal_redirect_action>`
|
|
1547
|
+
// set to
|
|
1548
|
+
// :ref:`PASS_THROUGH_INTERNAL_REDIRECT
|
|
1549
|
+
// <envoy_v3_api_enum_value_config.route.v3.RouteAction.InternalRedirectAction.PASS_THROUGH_INTERNAL_REDIRECT>`
|
|
1550
|
+
// will pass the redirect back to downstream.
|
|
1551
|
+
//
|
|
1552
|
+
// If not specified, at most one redirect will be followed.
|
|
1553
|
+
google.protobuf.UInt32Value max_internal_redirects = 31
|
|
1554
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
1555
|
+
|
|
1556
|
+
// Indicates that the route has a hedge policy. Note that if this is set,
|
|
1557
|
+
// it'll take precedence over the virtual host level hedge policy entirely
|
|
1558
|
+
// (e.g., policies are not merged, the most internal one becomes the enforced policy).
|
|
1559
|
+
HedgePolicy hedge_policy = 27;
|
|
1560
|
+
|
|
1561
|
+
// Specifies the maximum stream duration for this route.
|
|
1562
|
+
MaxStreamDuration max_stream_duration = 36;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
// HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`.
|
|
1566
|
+
// [#next-free-field: 14]
|
|
1567
|
+
message RetryPolicy {
|
|
1568
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RetryPolicy";
|
|
1569
|
+
|
|
1570
|
+
enum ResetHeaderFormat {
|
|
1571
|
+
SECONDS = 0;
|
|
1572
|
+
UNIX_TIMESTAMP = 1;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
message RetryPriority {
|
|
1576
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1577
|
+
"envoy.api.v2.route.RetryPolicy.RetryPriority";
|
|
1578
|
+
|
|
1579
|
+
reserved 2;
|
|
1580
|
+
|
|
1581
|
+
reserved "config";
|
|
1582
|
+
|
|
1583
|
+
string name = 1 [(validate.rules).string = {min_len: 1}];
|
|
1584
|
+
|
|
1585
|
+
// [#extension-category: envoy.retry_priorities]
|
|
1586
|
+
oneof config_type {
|
|
1587
|
+
google.protobuf.Any typed_config = 3;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
message RetryHostPredicate {
|
|
1592
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1593
|
+
"envoy.api.v2.route.RetryPolicy.RetryHostPredicate";
|
|
1594
|
+
|
|
1595
|
+
reserved 2;
|
|
1596
|
+
|
|
1597
|
+
reserved "config";
|
|
1598
|
+
|
|
1599
|
+
string name = 1 [(validate.rules).string = {min_len: 1}];
|
|
1600
|
+
|
|
1601
|
+
// [#extension-category: envoy.retry_host_predicates]
|
|
1602
|
+
oneof config_type {
|
|
1603
|
+
google.protobuf.Any typed_config = 3;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
message RetryBackOff {
|
|
1608
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1609
|
+
"envoy.api.v2.route.RetryPolicy.RetryBackOff";
|
|
1610
|
+
|
|
1611
|
+
// Specifies the base interval between retries. This parameter is required and must be greater
|
|
1612
|
+
// than zero. Values less than 1 ms are rounded up to 1 ms.
|
|
1613
|
+
// See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion of Envoy's
|
|
1614
|
+
// back-off algorithm.
|
|
1615
|
+
google.protobuf.Duration base_interval = 1 [(validate.rules).duration = {
|
|
1616
|
+
required: true
|
|
1617
|
+
gt {}
|
|
1618
|
+
}];
|
|
1619
|
+
|
|
1620
|
+
// Specifies the maximum interval between retries. This parameter is optional, but must be
|
|
1621
|
+
// greater than or equal to the ``base_interval`` if set. The default is 10 times the
|
|
1622
|
+
// ``base_interval``. See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion
|
|
1623
|
+
// of Envoy's back-off algorithm.
|
|
1624
|
+
google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {}}];
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
message ResetHeader {
|
|
1628
|
+
// The name of the reset header.
|
|
1629
|
+
//
|
|
1630
|
+
// .. note::
|
|
1631
|
+
//
|
|
1632
|
+
// If the header appears multiple times only the first value is used.
|
|
1633
|
+
string name = 1
|
|
1634
|
+
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
1635
|
+
|
|
1636
|
+
// The format of the reset header.
|
|
1637
|
+
ResetHeaderFormat format = 2 [(validate.rules).enum = {defined_only: true}];
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// A retry back-off strategy that applies when the upstream server rate limits
|
|
1641
|
+
// the request.
|
|
1642
|
+
//
|
|
1643
|
+
// Given this configuration:
|
|
1644
|
+
//
|
|
1645
|
+
// .. code-block:: yaml
|
|
1646
|
+
//
|
|
1647
|
+
// rate_limited_retry_back_off:
|
|
1648
|
+
// reset_headers:
|
|
1649
|
+
// - name: Retry-After
|
|
1650
|
+
// format: SECONDS
|
|
1651
|
+
// - name: X-RateLimit-Reset
|
|
1652
|
+
// format: UNIX_TIMESTAMP
|
|
1653
|
+
// max_interval: "300s"
|
|
1654
|
+
//
|
|
1655
|
+
// The following algorithm will apply:
|
|
1656
|
+
//
|
|
1657
|
+
// 1. If the response contains the header ``Retry-After`` its value must be on
|
|
1658
|
+
// the form ``120`` (an integer that represents the number of seconds to
|
|
1659
|
+
// wait before retrying). If so, this value is used as the back-off interval.
|
|
1660
|
+
// 2. Otherwise, if the response contains the header ``X-RateLimit-Reset`` its
|
|
1661
|
+
// value must be on the form ``1595320702`` (an integer that represents the
|
|
1662
|
+
// point in time at which to retry, as a Unix timestamp in seconds). If so,
|
|
1663
|
+
// the current time is subtracted from this value and the result is used as
|
|
1664
|
+
// the back-off interval.
|
|
1665
|
+
// 3. Otherwise, Envoy will use the default
|
|
1666
|
+
// :ref:`exponential back-off <envoy_v3_api_field_config.route.v3.RetryPolicy.retry_back_off>`
|
|
1667
|
+
// strategy.
|
|
1668
|
+
//
|
|
1669
|
+
// No matter which format is used, if the resulting back-off interval exceeds
|
|
1670
|
+
// ``max_interval`` it is discarded and the next header in ``reset_headers``
|
|
1671
|
+
// is tried. If a request timeout is configured for the route it will further
|
|
1672
|
+
// limit how long the request will be allowed to run.
|
|
1673
|
+
//
|
|
1674
|
+
// To prevent many clients retrying at the same point in time jitter is added
|
|
1675
|
+
// to the back-off interval, so the resulting interval is decided by taking:
|
|
1676
|
+
// ``random(interval, interval * 1.5)``.
|
|
1677
|
+
//
|
|
1678
|
+
// .. attention::
|
|
1679
|
+
//
|
|
1680
|
+
// Configuring ``rate_limited_retry_back_off`` will not by itself cause a request
|
|
1681
|
+
// to be retried. You will still need to configure the right retry policy to match
|
|
1682
|
+
// the responses from the upstream server.
|
|
1683
|
+
message RateLimitedRetryBackOff {
|
|
1684
|
+
// Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``)
|
|
1685
|
+
// to match against the response. Headers are tried in order, and matched case
|
|
1686
|
+
// insensitive. The first header to be parsed successfully is used. If no headers
|
|
1687
|
+
// match the default exponential back-off is used instead.
|
|
1688
|
+
repeated ResetHeader reset_headers = 1 [(validate.rules).repeated = {min_items: 1}];
|
|
1689
|
+
|
|
1690
|
+
// Specifies the maximum back off interval that Envoy will allow. If a reset
|
|
1691
|
+
// header contains an interval longer than this then it will be discarded and
|
|
1692
|
+
// the next header will be tried.
|
|
1693
|
+
//
|
|
1694
|
+
// Defaults to 300 seconds.
|
|
1695
|
+
google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {}}];
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
// Specifies the conditions under which retry takes place. These are the same
|
|
1699
|
+
// conditions documented for :ref:`config_http_filters_router_x-envoy-retry-on` and
|
|
1700
|
+
// :ref:`config_http_filters_router_x-envoy-retry-grpc-on`.
|
|
1701
|
+
string retry_on = 1;
|
|
1702
|
+
|
|
1703
|
+
// Specifies the allowed number of retries. This parameter is optional and
|
|
1704
|
+
// defaults to 1. These are the same conditions documented for
|
|
1705
|
+
// :ref:`config_http_filters_router_x-envoy-max-retries`.
|
|
1706
|
+
google.protobuf.UInt32Value num_retries = 2
|
|
1707
|
+
[(udpa.annotations.field_migrate).rename = "max_retries"];
|
|
1708
|
+
|
|
1709
|
+
// Specifies a non-zero upstream timeout per retry attempt (including the initial attempt). This
|
|
1710
|
+
// parameter is optional. The same conditions documented for
|
|
1711
|
+
// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply.
|
|
1712
|
+
//
|
|
1713
|
+
// .. note::
|
|
1714
|
+
//
|
|
1715
|
+
// If left unspecified, Envoy will use the global
|
|
1716
|
+
// :ref:`route timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` for the request.
|
|
1717
|
+
// Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
|
|
1718
|
+
// retry policy, a request that times out will not be retried as the total timeout budget
|
|
1719
|
+
// would have been exhausted.
|
|
1720
|
+
google.protobuf.Duration per_try_timeout = 3;
|
|
1721
|
+
|
|
1722
|
+
// Specifies an upstream idle timeout per retry attempt (including the initial attempt). This
|
|
1723
|
+
// parameter is optional and if absent there is no per-try idle timeout. The semantics of the per-
|
|
1724
|
+
// try idle timeout are similar to the
|
|
1725
|
+
// :ref:`route idle timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` and
|
|
1726
|
+
// :ref:`stream idle timeout
|
|
1727
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
|
|
1728
|
+
// both enforced by the HTTP connection manager. The difference is that this idle timeout
|
|
1729
|
+
// is enforced by the router for each individual attempt and thus after all previous filters have
|
|
1730
|
+
// run, as opposed to *before* all previous filters run for the other idle timeouts. This timeout
|
|
1731
|
+
// is useful in cases in which total request timeout is bounded by a number of retries and a
|
|
1732
|
+
// :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`, but
|
|
1733
|
+
// there is a desire to ensure each try is making incremental progress. Note also that similar
|
|
1734
|
+
// to :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`,
|
|
1735
|
+
// this idle timeout does not start until after both the entire request has been received by the
|
|
1736
|
+
// router *and* a connection pool connection has been obtained. Unlike
|
|
1737
|
+
// :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`,
|
|
1738
|
+
// the idle timer continues once the response starts streaming back to the downstream client.
|
|
1739
|
+
// This ensures that response data continues to make progress without using one of the HTTP
|
|
1740
|
+
// connection manager idle timeouts.
|
|
1741
|
+
google.protobuf.Duration per_try_idle_timeout = 13;
|
|
1742
|
+
|
|
1743
|
+
// Specifies an implementation of a RetryPriority which is used to determine the
|
|
1744
|
+
// distribution of load across priorities used for retries. Refer to
|
|
1745
|
+
// :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details.
|
|
1746
|
+
RetryPriority retry_priority = 4;
|
|
1747
|
+
|
|
1748
|
+
// Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
|
|
1749
|
+
// for retries. If any of the predicates reject the host, host selection will be reattempted.
|
|
1750
|
+
// Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
|
|
1751
|
+
// details.
|
|
1752
|
+
repeated RetryHostPredicate retry_host_predicate = 5;
|
|
1753
|
+
|
|
1754
|
+
// Retry options predicates that will be applied prior to retrying a request. These predicates
|
|
1755
|
+
// allow customizing request behavior between retries.
|
|
1756
|
+
// [#comment: add [#extension-category: envoy.retry_options_predicates] when there are built-in extensions]
|
|
1757
|
+
repeated core.v3.TypedExtensionConfig retry_options_predicates = 12;
|
|
1758
|
+
|
|
1759
|
+
// The maximum number of times host selection will be reattempted before giving up, at which
|
|
1760
|
+
// point the host that was last selected will be routed to. If unspecified, this will default to
|
|
1761
|
+
// retrying once.
|
|
1762
|
+
int64 host_selection_retry_max_attempts = 6;
|
|
1763
|
+
|
|
1764
|
+
// HTTP status codes that should trigger a retry in addition to those specified by retry_on.
|
|
1765
|
+
repeated uint32 retriable_status_codes = 7;
|
|
1766
|
+
|
|
1767
|
+
// Specifies parameters that control exponential retry back off. This parameter is optional, in which case the
|
|
1768
|
+
// default base interval is 25 milliseconds or, if set, the current value of the
|
|
1769
|
+
// ``upstream.base_retry_backoff_ms`` runtime parameter. The default maximum interval is 10 times
|
|
1770
|
+
// the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries`
|
|
1771
|
+
// describes Envoy's back-off algorithm.
|
|
1772
|
+
RetryBackOff retry_back_off = 8;
|
|
1773
|
+
|
|
1774
|
+
// Specifies parameters that control a retry back-off strategy that is used
|
|
1775
|
+
// when the request is rate limited by the upstream server. The server may
|
|
1776
|
+
// return a response header like ``Retry-After`` or ``X-RateLimit-Reset`` to
|
|
1777
|
+
// provide feedback to the client on how long to wait before retrying. If
|
|
1778
|
+
// configured, this back-off strategy will be used instead of the
|
|
1779
|
+
// default exponential back off strategy (configured using ``retry_back_off``)
|
|
1780
|
+
// whenever a response includes the matching headers.
|
|
1781
|
+
RateLimitedRetryBackOff rate_limited_retry_back_off = 11;
|
|
1782
|
+
|
|
1783
|
+
// HTTP response headers that trigger a retry if present in the response. A retry will be
|
|
1784
|
+
// triggered if any of the header matches match the upstream response headers.
|
|
1785
|
+
// The field is only consulted if 'retriable-headers' retry policy is active.
|
|
1786
|
+
repeated HeaderMatcher retriable_headers = 9;
|
|
1787
|
+
|
|
1788
|
+
// HTTP headers which must be present in the request for retries to be attempted.
|
|
1789
|
+
repeated HeaderMatcher retriable_request_headers = 10;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
// HTTP request hedging :ref:`architecture overview <arch_overview_http_routing_hedging>`.
|
|
1793
|
+
message HedgePolicy {
|
|
1794
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.HedgePolicy";
|
|
1795
|
+
|
|
1796
|
+
// Specifies the number of initial requests that should be sent upstream.
|
|
1797
|
+
// Must be at least 1.
|
|
1798
|
+
//
|
|
1799
|
+
// Defaults to 1.
|
|
1800
|
+
// [#not-implemented-hide:]
|
|
1801
|
+
google.protobuf.UInt32Value initial_requests = 1 [(validate.rules).uint32 = {gte: 1}];
|
|
1802
|
+
|
|
1803
|
+
// Specifies a probability that an additional upstream request should be sent
|
|
1804
|
+
// on top of what is specified by initial_requests.
|
|
1805
|
+
//
|
|
1806
|
+
// Defaults to 0.
|
|
1807
|
+
// [#not-implemented-hide:]
|
|
1808
|
+
type.v3.FractionalPercent additional_request_chance = 2;
|
|
1809
|
+
|
|
1810
|
+
// Indicates that a hedged request should be sent when the per-try timeout is hit.
|
|
1811
|
+
// This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
|
|
1812
|
+
// The first request to complete successfully will be the one returned to the caller.
|
|
1813
|
+
//
|
|
1814
|
+
// * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
|
|
1815
|
+
// * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned to the client
|
|
1816
|
+
// if there are no more retries left.
|
|
1817
|
+
// * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
|
|
1818
|
+
//
|
|
1819
|
+
// .. note::
|
|
1820
|
+
//
|
|
1821
|
+
// For this to have effect, you must have a :ref:`RetryPolicy <envoy_v3_api_msg_config.route.v3.RetryPolicy>` that retries at least
|
|
1822
|
+
// one error code and specifies a maximum number of retries.
|
|
1823
|
+
//
|
|
1824
|
+
// Defaults to ``false``.
|
|
1825
|
+
bool hedge_on_per_try_timeout = 3;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
// [#next-free-field: 10]
|
|
1829
|
+
message RedirectAction {
|
|
1830
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RedirectAction";
|
|
1831
|
+
|
|
1832
|
+
enum RedirectResponseCode {
|
|
1833
|
+
// Moved Permanently HTTP Status Code - 301.
|
|
1834
|
+
MOVED_PERMANENTLY = 0;
|
|
1835
|
+
|
|
1836
|
+
// Found HTTP Status Code - 302.
|
|
1837
|
+
FOUND = 1;
|
|
1838
|
+
|
|
1839
|
+
// See Other HTTP Status Code - 303.
|
|
1840
|
+
SEE_OTHER = 2;
|
|
1841
|
+
|
|
1842
|
+
// Temporary Redirect HTTP Status Code - 307.
|
|
1843
|
+
TEMPORARY_REDIRECT = 3;
|
|
1844
|
+
|
|
1845
|
+
// Permanent Redirect HTTP Status Code - 308.
|
|
1846
|
+
PERMANENT_REDIRECT = 4;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
// When the scheme redirection take place, the following rules apply:
|
|
1850
|
+
// 1. If the source URI scheme is ``http`` and the port is explicitly
|
|
1851
|
+
// set to ``:80``, the port will be removed after the redirection
|
|
1852
|
+
// 2. If the source URI scheme is ``https`` and the port is explicitly
|
|
1853
|
+
// set to ``:443``, the port will be removed after the redirection
|
|
1854
|
+
oneof scheme_rewrite_specifier {
|
|
1855
|
+
// The scheme portion of the URL will be swapped with "https".
|
|
1856
|
+
bool https_redirect = 4;
|
|
1857
|
+
|
|
1858
|
+
// The scheme portion of the URL will be swapped with this value.
|
|
1859
|
+
string scheme_redirect = 7;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
// The host portion of the URL will be swapped with this value.
|
|
1863
|
+
string host_redirect = 1
|
|
1864
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
1865
|
+
|
|
1866
|
+
// The port value of the URL will be swapped with this value.
|
|
1867
|
+
uint32 port_redirect = 8;
|
|
1868
|
+
|
|
1869
|
+
oneof path_rewrite_specifier {
|
|
1870
|
+
// The path portion of the URL will be swapped with this value.
|
|
1871
|
+
// Please note that query string in path_redirect will override the
|
|
1872
|
+
// request's query string and will not be stripped.
|
|
1873
|
+
//
|
|
1874
|
+
// For example, let's say we have the following routes:
|
|
1875
|
+
//
|
|
1876
|
+
// - match: { path: "/old-path-1" }
|
|
1877
|
+
// redirect: { path_redirect: "/new-path-1" }
|
|
1878
|
+
// - match: { path: "/old-path-2" }
|
|
1879
|
+
// redirect: { path_redirect: "/new-path-2", strip-query: "true" }
|
|
1880
|
+
// - match: { path: "/old-path-3" }
|
|
1881
|
+
// redirect: { path_redirect: "/new-path-3?foo=1", strip_query: "true" }
|
|
1882
|
+
//
|
|
1883
|
+
// 1. if request uri is "/old-path-1?bar=1", users will be redirected to "/new-path-1?bar=1"
|
|
1884
|
+
// 2. if request uri is "/old-path-2?bar=1", users will be redirected to "/new-path-2"
|
|
1885
|
+
// 3. if request uri is "/old-path-3?bar=1", users will be redirected to "/new-path-3?foo=1"
|
|
1886
|
+
string path_redirect = 2
|
|
1887
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
1888
|
+
|
|
1889
|
+
// Indicates that during redirection, the matched prefix (or path)
|
|
1890
|
+
// should be swapped with this value. This option allows redirect URLs be dynamically created
|
|
1891
|
+
// based on the request.
|
|
1892
|
+
//
|
|
1893
|
+
// .. attention::
|
|
1894
|
+
//
|
|
1895
|
+
// Pay attention to the use of trailing slashes as mentioned in
|
|
1896
|
+
// :ref:`RouteAction's prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>`.
|
|
1897
|
+
string prefix_rewrite = 5
|
|
1898
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
1899
|
+
|
|
1900
|
+
// Indicates that during redirect, portions of the path that match the
|
|
1901
|
+
// pattern should be rewritten, even allowing the substitution of capture
|
|
1902
|
+
// groups from the pattern into the new path as specified by the rewrite
|
|
1903
|
+
// substitution string. This is useful to allow application paths to be
|
|
1904
|
+
// rewritten in a way that is aware of segments with variable content like
|
|
1905
|
+
// identifiers.
|
|
1906
|
+
//
|
|
1907
|
+
// Examples using Google's `RE2 <https://github.com/google/re2>`_ engine:
|
|
1908
|
+
//
|
|
1909
|
+
// * The path pattern ``^/service/([^/]+)(/.*)$`` paired with a substitution
|
|
1910
|
+
// string of ``\2/instance/\1`` would transform ``/service/foo/v1/api``
|
|
1911
|
+
// into ``/v1/api/instance/foo``.
|
|
1912
|
+
//
|
|
1913
|
+
// * The pattern ``one`` paired with a substitution string of ``two`` would
|
|
1914
|
+
// transform ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/two/zzz``.
|
|
1915
|
+
//
|
|
1916
|
+
// * The pattern ``^(.*?)one(.*)$`` paired with a substitution string of
|
|
1917
|
+
// ``\1two\2`` would replace only the first occurrence of ``one``,
|
|
1918
|
+
// transforming path ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/one/zzz``.
|
|
1919
|
+
//
|
|
1920
|
+
// * The pattern ``(?i)/xxx/`` paired with a substitution string of ``/yyy/``
|
|
1921
|
+
// would do a case-insensitive match and transform path ``/aaa/XxX/bbb`` to
|
|
1922
|
+
// ``/aaa/yyy/bbb``.
|
|
1923
|
+
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 9;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
// The HTTP status code to use in the redirect response. The default response
|
|
1927
|
+
// code is MOVED_PERMANENTLY (301).
|
|
1928
|
+
RedirectResponseCode response_code = 3 [(validate.rules).enum = {defined_only: true}];
|
|
1929
|
+
|
|
1930
|
+
// Indicates that during redirection, the query portion of the URL will
|
|
1931
|
+
// be removed. Default value is false.
|
|
1932
|
+
bool strip_query = 6;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
message DirectResponseAction {
|
|
1936
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
1937
|
+
"envoy.api.v2.route.DirectResponseAction";
|
|
1938
|
+
|
|
1939
|
+
// Specifies the HTTP response status to be returned.
|
|
1940
|
+
uint32 status = 1 [(validate.rules).uint32 = {lt: 600 gte: 200}];
|
|
1941
|
+
|
|
1942
|
+
// Specifies the content of the response body. If this setting is omitted,
|
|
1943
|
+
// no body is included in the generated response.
|
|
1944
|
+
//
|
|
1945
|
+
// .. note::
|
|
1946
|
+
//
|
|
1947
|
+
// Headers can be specified using ``response_headers_to_add`` in the enclosing
|
|
1948
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` or
|
|
1949
|
+
// :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`.
|
|
1950
|
+
core.v3.DataSource body = 2;
|
|
1951
|
+
|
|
1952
|
+
// Specifies a format string for the response body. If present, the contents of
|
|
1953
|
+
// ``body_format`` will be formatted and used as the response body, where the
|
|
1954
|
+
// contents of ``body`` (may be empty) will be passed as the variable ``%LOCAL_REPLY_BODY%``.
|
|
1955
|
+
// If neither are provided, no body is included in the generated response.
|
|
1956
|
+
core.v3.SubstitutionFormatString body_format = 3;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
// [#not-implemented-hide:]
|
|
1960
|
+
message NonForwardingAction {
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
message Decorator {
|
|
1964
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.Decorator";
|
|
1965
|
+
|
|
1966
|
+
// The operation name associated with the request matched to this route. If tracing is
|
|
1967
|
+
// enabled, this information will be used as the span name reported for this request.
|
|
1968
|
+
//
|
|
1969
|
+
// .. note::
|
|
1970
|
+
//
|
|
1971
|
+
// For ingress (inbound) requests, or egress (outbound) responses, this value may be overridden
|
|
1972
|
+
// by the :ref:`x-envoy-decorator-operation
|
|
1973
|
+
// <config_http_filters_router_x-envoy-decorator-operation>` header.
|
|
1974
|
+
string operation = 1 [(validate.rules).string = {min_len: 1}];
|
|
1975
|
+
|
|
1976
|
+
// Whether the decorated details should be propagated to the other party. The default is ``true``.
|
|
1977
|
+
google.protobuf.BoolValue propagate = 2;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
// [#next-free-field: 7]
|
|
1981
|
+
message Tracing {
|
|
1982
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.Tracing";
|
|
1983
|
+
|
|
1984
|
+
// Target percentage of requests managed by this HTTP connection manager that will be force
|
|
1985
|
+
// traced if the :ref:`x-client-trace-id <config_http_conn_man_headers_x-client-trace-id>`
|
|
1986
|
+
// header is set. This field is a direct analog for the runtime variable
|
|
1987
|
+
// 'tracing.client_enabled' in the :ref:`HTTP Connection Manager
|
|
1988
|
+
// <config_http_conn_man_runtime>`.
|
|
1989
|
+
// Default: 100%
|
|
1990
|
+
type.v3.FractionalPercent client_sampling = 1;
|
|
1991
|
+
|
|
1992
|
+
// Target percentage of requests managed by this HTTP connection manager that will be randomly
|
|
1993
|
+
// selected for trace generation, if not requested by the client or not forced. This field is
|
|
1994
|
+
// a direct analog for the runtime variable 'tracing.random_sampling' in the
|
|
1995
|
+
// :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`.
|
|
1996
|
+
// Default: 100%
|
|
1997
|
+
type.v3.FractionalPercent random_sampling = 2;
|
|
1998
|
+
|
|
1999
|
+
// Target percentage of requests managed by this HTTP connection manager that will be traced
|
|
2000
|
+
// after all other sampling checks have been applied (client-directed, force tracing, random
|
|
2001
|
+
// sampling). This field functions as an upper limit on the total configured sampling rate. For
|
|
2002
|
+
// instance, setting client_sampling to 100% but overall_sampling to 1% will result in only 1%
|
|
2003
|
+
// of client requests with the appropriate headers to be force traced. This field is a direct
|
|
2004
|
+
// analog for the runtime variable 'tracing.global_enabled' in the
|
|
2005
|
+
// :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`.
|
|
2006
|
+
// Default: 100%
|
|
2007
|
+
type.v3.FractionalPercent overall_sampling = 3;
|
|
2008
|
+
|
|
2009
|
+
// A list of custom tags with unique tag name to create tags for the active span.
|
|
2010
|
+
// It will take effect after merging with the :ref:`corresponding configuration
|
|
2011
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.custom_tags>`
|
|
2012
|
+
// configured in the HTTP connection manager. If two tags with the same name are configured
|
|
2013
|
+
// each in the HTTP connection manager and the route level, the one configured here takes
|
|
2014
|
+
// priority.
|
|
2015
|
+
repeated type.tracing.v3.CustomTag custom_tags = 4;
|
|
2016
|
+
|
|
2017
|
+
// The operation name of the span which will be used for tracing.
|
|
2018
|
+
//
|
|
2019
|
+
// The same :ref:`format specifier <config_access_log_format>` as used for
|
|
2020
|
+
// :ref:`HTTP access logging <config_access_log>` applies here, however
|
|
2021
|
+
// unknown specifier values are replaced with the empty string instead of ``-``.
|
|
2022
|
+
//
|
|
2023
|
+
// This field will take precedence over and make following settings ineffective:
|
|
2024
|
+
//
|
|
2025
|
+
// * :ref:`route decorator <envoy_v3_api_field_config.route.v3.Route.decorator>`.
|
|
2026
|
+
// * :ref:`x-envoy-decorator-operation <config_http_filters_router_x-envoy-decorator-operation>`.
|
|
2027
|
+
// * :ref:`HCM tracing operation
|
|
2028
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.operation>`.
|
|
2029
|
+
string operation = 5;
|
|
2030
|
+
|
|
2031
|
+
// The operation name of the upstream span which will be used for tracing.
|
|
2032
|
+
// This only takes effect when ``spawn_upstream_span`` is set to true and the upstream
|
|
2033
|
+
// span is created.
|
|
2034
|
+
//
|
|
2035
|
+
// The same :ref:`format specifier <config_access_log_format>` as used for
|
|
2036
|
+
// :ref:`HTTP access logging <config_access_log>` applies here, however
|
|
2037
|
+
// unknown specifier values are replaced with the empty string instead of ``-``.
|
|
2038
|
+
//
|
|
2039
|
+
// This field will take precedence over and make following settings ineffective:
|
|
2040
|
+
//
|
|
2041
|
+
// * :ref:`HCM tracing upstream operation
|
|
2042
|
+
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.upstream_operation>`
|
|
2043
|
+
string upstream_operation = 6;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
// A virtual cluster is a way of specifying a regex matching rule against
|
|
2047
|
+
// certain important endpoints such that statistics are generated explicitly for
|
|
2048
|
+
// the matched requests. The reason this is useful is that when doing
|
|
2049
|
+
// prefix/path matching Envoy does not always know what the application
|
|
2050
|
+
// considers to be an endpoint. Thus, it’s impossible for Envoy to generically
|
|
2051
|
+
// emit per endpoint statistics. However, often systems have highly critical
|
|
2052
|
+
// endpoints that they wish to get “perfect” statistics on. Virtual cluster
|
|
2053
|
+
// statistics are perfect in the sense that they are emitted on the downstream
|
|
2054
|
+
// side such that they include network level failures.
|
|
2055
|
+
//
|
|
2056
|
+
// Documentation for :ref:`virtual cluster statistics <config_http_filters_router_vcluster_stats>`.
|
|
2057
|
+
//
|
|
2058
|
+
// .. note::
|
|
2059
|
+
//
|
|
2060
|
+
// Virtual clusters are a useful tool, but we do not recommend setting up a virtual cluster for
|
|
2061
|
+
// every application endpoint. This is both not easily maintainable and as well the matching and
|
|
2062
|
+
// statistics output are not free.
|
|
2063
|
+
message VirtualCluster {
|
|
2064
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.VirtualCluster";
|
|
2065
|
+
|
|
2066
|
+
reserved 1, 3;
|
|
2067
|
+
|
|
2068
|
+
reserved "pattern", "method";
|
|
2069
|
+
|
|
2070
|
+
// Specifies a list of header matchers to use for matching requests. Each specified header must
|
|
2071
|
+
// match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
|
|
2072
|
+
// method, respectively.
|
|
2073
|
+
repeated HeaderMatcher headers = 4;
|
|
2074
|
+
|
|
2075
|
+
// Specifies the name of the virtual cluster. The virtual cluster name as well
|
|
2076
|
+
// as the virtual host name are used when emitting statistics. The statistics are emitted by the
|
|
2077
|
+
// router filter and are documented :ref:`here <config_http_filters_router_stats>`.
|
|
2078
|
+
string name = 2 [(validate.rules).string = {min_len: 1}];
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
// Global rate limiting :ref:`architecture overview <arch_overview_global_rate_limit>`.
|
|
2082
|
+
// Also applies to Local rate limiting :ref:`using descriptors <config_http_filters_local_rate_limit_descriptors>`.
|
|
2083
|
+
// [#next-free-field: 7]
|
|
2084
|
+
message RateLimit {
|
|
2085
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RateLimit";
|
|
2086
|
+
|
|
2087
|
+
// [#next-free-field: 13]
|
|
2088
|
+
message Action {
|
|
2089
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2090
|
+
"envoy.api.v2.route.RateLimit.Action";
|
|
2091
|
+
|
|
2092
|
+
// The following descriptor entry is appended to the descriptor:
|
|
2093
|
+
//
|
|
2094
|
+
// .. code-block:: cpp
|
|
2095
|
+
//
|
|
2096
|
+
// ("source_cluster", "<local service cluster>")
|
|
2097
|
+
//
|
|
2098
|
+
// <local service cluster> is derived from the :option:`--service-cluster` option.
|
|
2099
|
+
message SourceCluster {
|
|
2100
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2101
|
+
"envoy.api.v2.route.RateLimit.Action.SourceCluster";
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
// The following descriptor entry is appended to the descriptor:
|
|
2105
|
+
//
|
|
2106
|
+
// .. code-block:: cpp
|
|
2107
|
+
//
|
|
2108
|
+
// ("destination_cluster", "<routed target cluster>")
|
|
2109
|
+
//
|
|
2110
|
+
// Once a request matches against a route table rule, a routed cluster is determined by one of
|
|
2111
|
+
// the following :ref:`route table configuration <envoy_v3_api_msg_config.route.v3.RouteConfiguration>`
|
|
2112
|
+
// settings:
|
|
2113
|
+
//
|
|
2114
|
+
// * :ref:`cluster <envoy_v3_api_field_config.route.v3.RouteAction.cluster>` indicates the upstream cluster
|
|
2115
|
+
// to route to.
|
|
2116
|
+
// * :ref:`weighted_clusters <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>`
|
|
2117
|
+
// chooses a cluster randomly from a set of clusters with attributed weight.
|
|
2118
|
+
// * :ref:`cluster_header <envoy_v3_api_field_config.route.v3.RouteAction.cluster_header>` indicates which
|
|
2119
|
+
// header in the request contains the target cluster.
|
|
2120
|
+
message DestinationCluster {
|
|
2121
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2122
|
+
"envoy.api.v2.route.RateLimit.Action.DestinationCluster";
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
// The following descriptor entry is appended when a header contains a key that matches the
|
|
2126
|
+
// ``header_name``:
|
|
2127
|
+
//
|
|
2128
|
+
// .. code-block:: cpp
|
|
2129
|
+
//
|
|
2130
|
+
// ("<descriptor_key>", "<header_value_queried_from_header>")
|
|
2131
|
+
message RequestHeaders {
|
|
2132
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2133
|
+
"envoy.api.v2.route.RateLimit.Action.RequestHeaders";
|
|
2134
|
+
|
|
2135
|
+
// The header name to be queried from the request headers. The header’s
|
|
2136
|
+
// value is used to populate the value of the descriptor entry for the
|
|
2137
|
+
// descriptor_key.
|
|
2138
|
+
string header_name = 1
|
|
2139
|
+
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
2140
|
+
|
|
2141
|
+
// The key to use in the descriptor entry.
|
|
2142
|
+
string descriptor_key = 2 [(validate.rules).string = {min_len: 1}];
|
|
2143
|
+
|
|
2144
|
+
// Controls the behavior when the specified header is not present in the request.
|
|
2145
|
+
//
|
|
2146
|
+
// If set to ``false`` (default):
|
|
2147
|
+
//
|
|
2148
|
+
// * Envoy does **NOT** call the rate limiting service for this descriptor.
|
|
2149
|
+
// * Useful if the header is optional and you prefer to skip rate limiting when it's absent.
|
|
2150
|
+
//
|
|
2151
|
+
// If set to ``true``:
|
|
2152
|
+
//
|
|
2153
|
+
// * Envoy calls the rate limiting service but omits this descriptor if the header is missing.
|
|
2154
|
+
// * Useful if you want Envoy to enforce rate limiting even when the header is not present.
|
|
2155
|
+
//
|
|
2156
|
+
bool skip_if_absent = 3;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
// The following descriptor entry is appended when a query parameter contains a key that matches the
|
|
2160
|
+
// ``query_parameter_name``:
|
|
2161
|
+
//
|
|
2162
|
+
// .. code-block:: cpp
|
|
2163
|
+
//
|
|
2164
|
+
// ("<descriptor_key>", "<query_parameter_value_queried_from_query_parameter>")
|
|
2165
|
+
message QueryParameters {
|
|
2166
|
+
// The name of the query parameter to use for rate limiting. Value of this query parameter is used to populate
|
|
2167
|
+
// the value of the descriptor entry for the descriptor_key.
|
|
2168
|
+
string query_parameter_name = 1 [(validate.rules).string = {min_len: 1}];
|
|
2169
|
+
|
|
2170
|
+
// The key to use when creating the rate limit descriptor entry. This descriptor key will be used to identify the
|
|
2171
|
+
// rate limit rule in the rate limiting service.
|
|
2172
|
+
string descriptor_key = 2 [(validate.rules).string = {min_len: 1}];
|
|
2173
|
+
|
|
2174
|
+
// Controls the behavior when the specified query parameter is not present in the request.
|
|
2175
|
+
//
|
|
2176
|
+
// If set to ``false`` (default):
|
|
2177
|
+
//
|
|
2178
|
+
// * Envoy does **NOT** call the rate limiting service for this descriptor.
|
|
2179
|
+
// * Useful if the query parameter is optional and you prefer to skip rate limiting when it's absent.
|
|
2180
|
+
//
|
|
2181
|
+
// If set to ``true``:
|
|
2182
|
+
//
|
|
2183
|
+
// * Envoy calls the rate limiting service but omits this descriptor if the query parameter is missing.
|
|
2184
|
+
// * Useful if you want Envoy to enforce rate limiting even when the query parameter is not present.
|
|
2185
|
+
//
|
|
2186
|
+
bool skip_if_absent = 3;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
// The following descriptor entry is appended to the descriptor and is populated using the
|
|
2190
|
+
// trusted address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`:
|
|
2191
|
+
//
|
|
2192
|
+
// .. code-block:: cpp
|
|
2193
|
+
//
|
|
2194
|
+
// ("remote_address", "<trusted address from x-forwarded-for>")
|
|
2195
|
+
message RemoteAddress {
|
|
2196
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2197
|
+
"envoy.api.v2.route.RateLimit.Action.RemoteAddress";
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
// The following descriptor entry is appended to the descriptor and is populated using the
|
|
2201
|
+
// masked address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`:
|
|
2202
|
+
//
|
|
2203
|
+
// .. code-block:: cpp
|
|
2204
|
+
//
|
|
2205
|
+
// ("masked_remote_address", "<masked address from x-forwarded-for>")
|
|
2206
|
+
message MaskedRemoteAddress {
|
|
2207
|
+
// Length of prefix mask len for IPv4 (e.g. 0, 32).
|
|
2208
|
+
//
|
|
2209
|
+
// Defaults to 32 when unset.
|
|
2210
|
+
//
|
|
2211
|
+
// For example, trusted address from x-forwarded-for is ``192.168.1.1``,
|
|
2212
|
+
// the descriptor entry is ("masked_remote_address", "192.168.1.1/32");
|
|
2213
|
+
// if mask len is 24, the descriptor entry is ("masked_remote_address", "192.168.1.0/24").
|
|
2214
|
+
google.protobuf.UInt32Value v4_prefix_mask_len = 1 [(validate.rules).uint32 = {lte: 32}];
|
|
2215
|
+
|
|
2216
|
+
// Length of prefix mask len for IPv6 (e.g. 0, 128).
|
|
2217
|
+
//
|
|
2218
|
+
// Defaults to 128 when unset.
|
|
2219
|
+
//
|
|
2220
|
+
// For example, trusted address from x-forwarded-for is ``2001:abcd:ef01:2345:6789:abcd:ef01:234``,
|
|
2221
|
+
// the descriptor entry is ("masked_remote_address", "2001:abcd:ef01:2345:6789:abcd:ef01:234/128");
|
|
2222
|
+
// if mask len is 64, the descriptor entry is ("masked_remote_address", "2001:abcd:ef01:2345::/64").
|
|
2223
|
+
google.protobuf.UInt32Value v6_prefix_mask_len = 2 [(validate.rules).uint32 = {lte: 128}];
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
// The following descriptor entry is appended to the descriptor:
|
|
2227
|
+
//
|
|
2228
|
+
// .. code-block:: cpp
|
|
2229
|
+
//
|
|
2230
|
+
// ("generic_key", "<descriptor_value>")
|
|
2231
|
+
message GenericKey {
|
|
2232
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2233
|
+
"envoy.api.v2.route.RateLimit.Action.GenericKey";
|
|
2234
|
+
|
|
2235
|
+
// Descriptor value of entry.
|
|
2236
|
+
//
|
|
2237
|
+
// The same :ref:`format specifier <config_access_log_format>` as used for
|
|
2238
|
+
// :ref:`HTTP access logging <config_access_log>` applies here, however
|
|
2239
|
+
// unknown specifier values are replaced with the empty string instead of ``-``.
|
|
2240
|
+
//
|
|
2241
|
+
// .. note::
|
|
2242
|
+
//
|
|
2243
|
+
// Formatter parsing is controlled by the runtime feature flag
|
|
2244
|
+
// ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value``
|
|
2245
|
+
// (disabled by default).
|
|
2246
|
+
//
|
|
2247
|
+
// When enabled: The format string can contain multiple valid substitution
|
|
2248
|
+
// fields. If multiple substitution fields are present, their results will be concatenated
|
|
2249
|
+
// to form the final descriptor value. If it contains no substitution fields, the value
|
|
2250
|
+
// will be used as is. If the final concatenated result is empty and ``default_value`` is set,
|
|
2251
|
+
// the ``default_value`` will be used. If ``default_value`` is not set and the result is
|
|
2252
|
+
// empty, this descriptor will be skipped and not included in the rate limit call.
|
|
2253
|
+
//
|
|
2254
|
+
// When disabled (default): The descriptor_value is used as a literal string without any formatter
|
|
2255
|
+
// parsing or substitution.
|
|
2256
|
+
//
|
|
2257
|
+
// For example, ``static_value`` will be used as is since there are no substitution fields.
|
|
2258
|
+
// ``%REQ(:method)%`` will be replaced with the HTTP method, and
|
|
2259
|
+
// ``%REQ(:method)%%REQ(:path)%`` will be replaced with the concatenation of the HTTP method and path.
|
|
2260
|
+
// ``%CEL(request.headers['user-id'])%`` will use CEL to extract the user ID from request headers.
|
|
2261
|
+
//
|
|
2262
|
+
string descriptor_value = 1 [(validate.rules).string = {min_len: 1}];
|
|
2263
|
+
|
|
2264
|
+
// An optional value to use if the final concatenated ``descriptor_value`` result is empty.
|
|
2265
|
+
// Only applicable when formatter parsing is enabled by the runtime feature flag
|
|
2266
|
+
// ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value`` (disabled by default).
|
|
2267
|
+
string default_value = 3;
|
|
2268
|
+
|
|
2269
|
+
// An optional key to use in the descriptor entry. If not set it defaults
|
|
2270
|
+
// to 'generic_key' as the descriptor key.
|
|
2271
|
+
string descriptor_key = 2;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
// The following descriptor entry is appended to the descriptor:
|
|
2275
|
+
//
|
|
2276
|
+
// .. code-block:: cpp
|
|
2277
|
+
//
|
|
2278
|
+
// ("header_match", "<descriptor_value>")
|
|
2279
|
+
// [#next-free-field: 6]
|
|
2280
|
+
message HeaderValueMatch {
|
|
2281
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2282
|
+
"envoy.api.v2.route.RateLimit.Action.HeaderValueMatch";
|
|
2283
|
+
|
|
2284
|
+
// Descriptor value of entry.
|
|
2285
|
+
//
|
|
2286
|
+
// The same :ref:`format specifier <config_access_log_format>` as used for
|
|
2287
|
+
// :ref:`HTTP access logging <config_access_log>` applies here, however
|
|
2288
|
+
// unknown specifier values are replaced with the empty string instead of ``-``.
|
|
2289
|
+
//
|
|
2290
|
+
// .. note::
|
|
2291
|
+
//
|
|
2292
|
+
// Formatter parsing is controlled by the runtime feature flag
|
|
2293
|
+
// ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value``
|
|
2294
|
+
// (disabled by default).
|
|
2295
|
+
//
|
|
2296
|
+
// When enabled: The format string can contain multiple valid substitution
|
|
2297
|
+
// fields. If multiple substitution fields are present, their results will be concatenated
|
|
2298
|
+
// to form the final descriptor value. If it contains no substitution fields, the value
|
|
2299
|
+
// will be used as is. All substitution fields will be evaluated and their results
|
|
2300
|
+
// concatenated. If the final concatenated result is empty and ``default_value`` is set,
|
|
2301
|
+
// the ``default_value`` will be used. If ``default_value`` is not set and the result is
|
|
2302
|
+
// empty, this descriptor will be skipped and not included in the rate limit call.
|
|
2303
|
+
//
|
|
2304
|
+
// When disabled (default): The descriptor_value is used as a literal string without any formatter
|
|
2305
|
+
// parsing or substitution.
|
|
2306
|
+
//
|
|
2307
|
+
// For example, ``static_value`` will be used as is since there are no substitution fields.
|
|
2308
|
+
// ``%REQ(:method)%`` will be replaced with the HTTP method, and
|
|
2309
|
+
// ``%REQ(:method)%%REQ(:path)%`` will be replaced with the concatenation of the HTTP method and path.
|
|
2310
|
+
// ``%CEL(request.headers['user-id'])%`` will use CEL to extract the user ID from request headers.
|
|
2311
|
+
//
|
|
2312
|
+
string descriptor_value = 1 [(validate.rules).string = {min_len: 1}];
|
|
2313
|
+
|
|
2314
|
+
// An optional value to use if the final concatenated ``descriptor_value`` result is empty.
|
|
2315
|
+
// Only applicable when formatter parsing is enabled by the runtime feature flag
|
|
2316
|
+
// ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value`` (disabled by default).
|
|
2317
|
+
string default_value = 5;
|
|
2318
|
+
|
|
2319
|
+
// The key to use in the descriptor entry.
|
|
2320
|
+
//
|
|
2321
|
+
// Defaults to ``header_match``.
|
|
2322
|
+
string descriptor_key = 4;
|
|
2323
|
+
|
|
2324
|
+
// If set to true, the action will append a descriptor entry when the
|
|
2325
|
+
// request matches the headers. If set to false, the action will append a
|
|
2326
|
+
// descriptor entry when the request does not match the headers. The
|
|
2327
|
+
// default value is true.
|
|
2328
|
+
google.protobuf.BoolValue expect_match = 2;
|
|
2329
|
+
|
|
2330
|
+
// Specifies a set of headers that the rate limit action should match
|
|
2331
|
+
// on. The action will check the request's headers against all the
|
|
2332
|
+
// specified headers in the config. A match will happen if all the
|
|
2333
|
+
// headers in the config are present in the request with the same values
|
|
2334
|
+
// (or based on presence if the value field is not in the config).
|
|
2335
|
+
repeated HeaderMatcher headers = 3 [(validate.rules).repeated = {min_items: 1}];
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
// The following descriptor entry is appended when the
|
|
2339
|
+
// :ref:`dynamic metadata <well_known_dynamic_metadata>` contains a key value:
|
|
2340
|
+
//
|
|
2341
|
+
// .. code-block:: cpp
|
|
2342
|
+
//
|
|
2343
|
+
// ("<descriptor_key>", "<value_queried_from_dynamic_metadata>")
|
|
2344
|
+
//
|
|
2345
|
+
// .. attention::
|
|
2346
|
+
// This action has been deprecated in favor of the :ref:`metadata <envoy_v3_api_msg_config.route.v3.RateLimit.Action.MetaData>` action
|
|
2347
|
+
message DynamicMetaData {
|
|
2348
|
+
// The key to use in the descriptor entry.
|
|
2349
|
+
string descriptor_key = 1 [(validate.rules).string = {min_len: 1}];
|
|
2350
|
+
|
|
2351
|
+
// Metadata struct that defines the key and path to retrieve the string value. A match will
|
|
2352
|
+
// only happen if the value in the dynamic metadata is of type string.
|
|
2353
|
+
type.metadata.v3.MetadataKey metadata_key = 2 [(validate.rules).message = {required: true}];
|
|
2354
|
+
|
|
2355
|
+
// An optional value to use if ``metadata_key`` is empty. If not set and
|
|
2356
|
+
// no value is present under the metadata_key then no descriptor is generated.
|
|
2357
|
+
string default_value = 3;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
// The following descriptor entry is appended when the metadata contains a key value:
|
|
2361
|
+
//
|
|
2362
|
+
// .. code-block:: cpp
|
|
2363
|
+
//
|
|
2364
|
+
// ("<descriptor_key>", "<value_queried_from_metadata>")
|
|
2365
|
+
// [#next-free-field: 6]
|
|
2366
|
+
message MetaData {
|
|
2367
|
+
enum Source {
|
|
2368
|
+
// Query :ref:`dynamic metadata <well_known_dynamic_metadata>`
|
|
2369
|
+
DYNAMIC = 0;
|
|
2370
|
+
|
|
2371
|
+
// Query :ref:`route entry metadata <envoy_v3_api_field_config.route.v3.Route.metadata>`
|
|
2372
|
+
ROUTE_ENTRY = 1;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
// The key to use in the descriptor entry.
|
|
2376
|
+
string descriptor_key = 1 [(validate.rules).string = {min_len: 1}];
|
|
2377
|
+
|
|
2378
|
+
// Metadata struct that defines the key and path to retrieve the string value. A match will
|
|
2379
|
+
// only happen if the value in the metadata is of type string.
|
|
2380
|
+
type.metadata.v3.MetadataKey metadata_key = 2 [(validate.rules).message = {required: true}];
|
|
2381
|
+
|
|
2382
|
+
// An optional value to use if ``metadata_key`` is empty. If not set and
|
|
2383
|
+
// no value is present under the metadata_key then ``skip_if_absent`` is followed to
|
|
2384
|
+
// skip calling the rate limiting service or skip the descriptor.
|
|
2385
|
+
string default_value = 3;
|
|
2386
|
+
|
|
2387
|
+
// Source of metadata
|
|
2388
|
+
Source source = 4 [(validate.rules).enum = {defined_only: true}];
|
|
2389
|
+
|
|
2390
|
+
// Controls the behavior when the specified ``metadata_key`` is empty and ``default_value`` is not set.
|
|
2391
|
+
//
|
|
2392
|
+
// If set to ``false`` (default):
|
|
2393
|
+
//
|
|
2394
|
+
// * Envoy does **NOT** call the rate limiting service for this descriptor.
|
|
2395
|
+
// * Useful if the metadata is optional and you prefer to skip rate limiting when it's absent.
|
|
2396
|
+
//
|
|
2397
|
+
// If set to ``true``:
|
|
2398
|
+
//
|
|
2399
|
+
// * Envoy calls the rate limiting service but omits this descriptor if the ``metadata_key`` is empty and
|
|
2400
|
+
// ``default_value`` is missing.
|
|
2401
|
+
// * Useful if you want Envoy to enforce rate limiting even when the metadata is not present.
|
|
2402
|
+
//
|
|
2403
|
+
bool skip_if_absent = 5;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
// The following descriptor entry is appended to the descriptor:
|
|
2407
|
+
//
|
|
2408
|
+
// .. code-block:: cpp
|
|
2409
|
+
//
|
|
2410
|
+
// ("query_match", "<descriptor_value>")
|
|
2411
|
+
// [#next-free-field: 6]
|
|
2412
|
+
message QueryParameterValueMatch {
|
|
2413
|
+
// Descriptor value of entry.
|
|
2414
|
+
//
|
|
2415
|
+
// The same :ref:`format specifier <config_access_log_format>` as used for
|
|
2416
|
+
// :ref:`HTTP access logging <config_access_log>` applies here, however
|
|
2417
|
+
// unknown specifier values are replaced with the empty string instead of ``-``.
|
|
2418
|
+
//
|
|
2419
|
+
// .. note::
|
|
2420
|
+
//
|
|
2421
|
+
// Formatter parsing is controlled by the runtime feature flag
|
|
2422
|
+
// ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value``
|
|
2423
|
+
// (disabled by default).
|
|
2424
|
+
//
|
|
2425
|
+
// When enabled: The format string can contain multiple valid substitution
|
|
2426
|
+
// fields. If multiple substitution fields are present, their results will be concatenated
|
|
2427
|
+
// to form the final descriptor value. If it contains no substitution fields, the value
|
|
2428
|
+
// will be used as is. All substitution fields will be evaluated and their results
|
|
2429
|
+
// concatenated. If the final concatenated result is empty and ``default_value`` is set,
|
|
2430
|
+
// the ``default_value`` will be used. If ``default_value`` is not set and the result is
|
|
2431
|
+
// empty, this descriptor will be skipped and not included in the rate limit call.
|
|
2432
|
+
//
|
|
2433
|
+
// When disabled (default): The descriptor_value is used as a literal string without any formatter
|
|
2434
|
+
// parsing or substitution.
|
|
2435
|
+
//
|
|
2436
|
+
// For example, ``static_value`` will be used as is since there are no substitution fields.
|
|
2437
|
+
// ``%REQ(:method)%`` will be replaced with the HTTP method, and
|
|
2438
|
+
// ``%REQ(:method)%%REQ(:path)%`` will be replaced with the concatenation of the HTTP method and path.
|
|
2439
|
+
// ``%CEL(request.headers['user-id'])%`` will use CEL to extract the user ID from request headers.
|
|
2440
|
+
//
|
|
2441
|
+
string descriptor_value = 1 [(validate.rules).string = {min_len: 1}];
|
|
2442
|
+
|
|
2443
|
+
// An optional value to use if the final concatenated ``descriptor_value`` result is empty.
|
|
2444
|
+
// Only applicable when formatter parsing is enabled by the runtime feature flag
|
|
2445
|
+
// ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value`` (disabled by default).
|
|
2446
|
+
string default_value = 5;
|
|
2447
|
+
|
|
2448
|
+
// The key to use in the descriptor entry.
|
|
2449
|
+
//
|
|
2450
|
+
// Defaults to ``query_match``.
|
|
2451
|
+
string descriptor_key = 4;
|
|
2452
|
+
|
|
2453
|
+
// If set to true, the action will append a descriptor entry when the
|
|
2454
|
+
// request matches the headers. If set to false, the action will append a
|
|
2455
|
+
// descriptor entry when the request does not match the headers. The
|
|
2456
|
+
// default value is true.
|
|
2457
|
+
google.protobuf.BoolValue expect_match = 2;
|
|
2458
|
+
|
|
2459
|
+
// Specifies a set of query parameters that the rate limit action should match
|
|
2460
|
+
// on. The action will check the request's query parameters against all the
|
|
2461
|
+
// specified query parameters in the config. A match will happen if all the
|
|
2462
|
+
// query parameters in the config are present in the request with the same values
|
|
2463
|
+
// (or based on presence if the value field is not in the config).
|
|
2464
|
+
repeated QueryParameterMatcher query_parameters = 3
|
|
2465
|
+
[(validate.rules).repeated = {min_items: 1}];
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
oneof action_specifier {
|
|
2469
|
+
option (validate.required) = true;
|
|
2470
|
+
|
|
2471
|
+
// Rate limit on source cluster.
|
|
2472
|
+
SourceCluster source_cluster = 1;
|
|
2473
|
+
|
|
2474
|
+
// Rate limit on destination cluster.
|
|
2475
|
+
DestinationCluster destination_cluster = 2;
|
|
2476
|
+
|
|
2477
|
+
// Rate limit on request headers.
|
|
2478
|
+
RequestHeaders request_headers = 3;
|
|
2479
|
+
|
|
2480
|
+
// Rate limit on query parameters.
|
|
2481
|
+
QueryParameters query_parameters = 12;
|
|
2482
|
+
|
|
2483
|
+
// Rate limit on remote address.
|
|
2484
|
+
RemoteAddress remote_address = 4;
|
|
2485
|
+
|
|
2486
|
+
// Rate limit on a generic key.
|
|
2487
|
+
GenericKey generic_key = 5;
|
|
2488
|
+
|
|
2489
|
+
// Rate limit on the existence of request headers.
|
|
2490
|
+
HeaderValueMatch header_value_match = 6;
|
|
2491
|
+
|
|
2492
|
+
// Rate limit on dynamic metadata.
|
|
2493
|
+
//
|
|
2494
|
+
// .. attention::
|
|
2495
|
+
// This field has been deprecated in favor of the :ref:`metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.metadata>` field
|
|
2496
|
+
DynamicMetaData dynamic_metadata = 7 [
|
|
2497
|
+
deprecated = true,
|
|
2498
|
+
(envoy.annotations.deprecated_at_minor_version) = "3.0",
|
|
2499
|
+
(envoy.annotations.disallowed_by_default) = true
|
|
2500
|
+
];
|
|
2501
|
+
|
|
2502
|
+
// Rate limit on metadata.
|
|
2503
|
+
MetaData metadata = 8;
|
|
2504
|
+
|
|
2505
|
+
// Rate limit descriptor extension. See the rate limit descriptor extensions documentation.
|
|
2506
|
+
//
|
|
2507
|
+
// :ref:`HTTP matching input functions <arch_overview_matching_api>` are
|
|
2508
|
+
// permitted as descriptor extensions. The input functions are only
|
|
2509
|
+
// looked up if there is no rate limit descriptor extension matching
|
|
2510
|
+
// the type URL.
|
|
2511
|
+
//
|
|
2512
|
+
// [#extension-category: envoy.rate_limit_descriptors]
|
|
2513
|
+
core.v3.TypedExtensionConfig extension = 9;
|
|
2514
|
+
|
|
2515
|
+
// Rate limit on masked remote address.
|
|
2516
|
+
MaskedRemoteAddress masked_remote_address = 10;
|
|
2517
|
+
|
|
2518
|
+
// Rate limit on the existence of query parameters.
|
|
2519
|
+
QueryParameterValueMatch query_parameter_value_match = 11;
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
message Override {
|
|
2524
|
+
// Fetches the override from the dynamic metadata.
|
|
2525
|
+
message DynamicMetadata {
|
|
2526
|
+
// Metadata struct that defines the key and path to retrieve the struct value.
|
|
2527
|
+
// The value must be a struct containing an integer "requests_per_unit" property
|
|
2528
|
+
// and a "unit" property with a value parseable to :ref:`RateLimitUnit
|
|
2529
|
+
// enum <envoy_v3_api_enum_type.v3.RateLimitUnit>`
|
|
2530
|
+
type.metadata.v3.MetadataKey metadata_key = 1 [(validate.rules).message = {required: true}];
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
oneof override_specifier {
|
|
2534
|
+
option (validate.required) = true;
|
|
2535
|
+
|
|
2536
|
+
// Limit override from dynamic metadata.
|
|
2537
|
+
DynamicMetadata dynamic_metadata = 1;
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
message HitsAddend {
|
|
2542
|
+
// Fixed number of hits to add to the rate limit descriptor.
|
|
2543
|
+
//
|
|
2544
|
+
// One of the ``number`` or ``format`` fields should be set but not both.
|
|
2545
|
+
google.protobuf.UInt64Value number = 1 [(validate.rules).uint64 = {lte: 1000000000}];
|
|
2546
|
+
|
|
2547
|
+
// Substitution format string to extract the number of hits to add to the rate limit descriptor.
|
|
2548
|
+
// The same :ref:`format specifier <config_access_log_format>` as used for
|
|
2549
|
+
// :ref:`HTTP access logging <config_access_log>` applies here.
|
|
2550
|
+
//
|
|
2551
|
+
// .. note::
|
|
2552
|
+
//
|
|
2553
|
+
// The format string must contains only single valid substitution field. If the format string
|
|
2554
|
+
// not meets the requirement, the configuration will be rejected.
|
|
2555
|
+
//
|
|
2556
|
+
// The substitution field should generates a non-negative number or string representation of
|
|
2557
|
+
// a non-negative number. The value of the non-negative number should be less than or equal
|
|
2558
|
+
// to 1000000000 like the ``number`` field. If the output of the substitution field not meet
|
|
2559
|
+
// the requirement, this will be treated as an error and the current descriptor will be ignored.
|
|
2560
|
+
//
|
|
2561
|
+
// For example, the ``%BYTES_RECEIVED%`` format string will be replaced with the number of bytes
|
|
2562
|
+
// received in the request.
|
|
2563
|
+
//
|
|
2564
|
+
// One of the ``number`` or ``format`` fields should be set but not both.
|
|
2565
|
+
string format = 2 [(validate.rules).string = {prefix: "%" suffix: "%" ignore_empty: true}];
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
// Refers to the stage set in the filter. The rate limit configuration only
|
|
2569
|
+
// applies to filters with the same stage number. The default stage number is
|
|
2570
|
+
// 0.
|
|
2571
|
+
//
|
|
2572
|
+
// .. note::
|
|
2573
|
+
//
|
|
2574
|
+
// The filter supports a range of 0 - 10 inclusively for stage numbers.
|
|
2575
|
+
//
|
|
2576
|
+
// .. note::
|
|
2577
|
+
// This is not supported if the rate limit action is configured in the ``typed_per_filter_config`` like
|
|
2578
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>` or
|
|
2579
|
+
// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>`, etc.
|
|
2580
|
+
google.protobuf.UInt32Value stage = 1 [(validate.rules).uint32 = {lte: 10}];
|
|
2581
|
+
|
|
2582
|
+
// The key to be set in runtime to disable this rate limit configuration.
|
|
2583
|
+
//
|
|
2584
|
+
// .. note::
|
|
2585
|
+
// This is not supported if the rate limit action is configured in the ``typed_per_filter_config`` like
|
|
2586
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>` or
|
|
2587
|
+
// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>`, etc.
|
|
2588
|
+
string disable_key = 2;
|
|
2589
|
+
|
|
2590
|
+
// A list of actions that are to be applied for this rate limit configuration.
|
|
2591
|
+
// Order matters as the actions are processed sequentially and the descriptor
|
|
2592
|
+
// is composed by appending descriptor entries in that sequence. If an action
|
|
2593
|
+
// cannot append a descriptor entry, no descriptor is generated for the
|
|
2594
|
+
// configuration. See :ref:`composing actions
|
|
2595
|
+
// <config_http_filters_rate_limit_composing_actions>` for additional documentation.
|
|
2596
|
+
repeated Action actions = 3 [(validate.rules).repeated = {min_items: 1}];
|
|
2597
|
+
|
|
2598
|
+
// An optional limit override to be appended to the descriptor produced by this
|
|
2599
|
+
// rate limit configuration. If the override value is invalid or cannot be resolved
|
|
2600
|
+
// from metadata, no override is provided. See :ref:`rate limit override
|
|
2601
|
+
// <config_http_filters_rate_limit_rate_limit_override>` for more information.
|
|
2602
|
+
//
|
|
2603
|
+
// .. note::
|
|
2604
|
+
// This is not supported if the rate limit action is configured in the ``typed_per_filter_config`` like
|
|
2605
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>` or
|
|
2606
|
+
// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>`, etc.
|
|
2607
|
+
Override limit = 4;
|
|
2608
|
+
|
|
2609
|
+
// An optional hits addend to be appended to the descriptor produced by this rate limit
|
|
2610
|
+
// configuration.
|
|
2611
|
+
//
|
|
2612
|
+
// .. note::
|
|
2613
|
+
// This is only supported if the rate limit action is configured in the ``typed_per_filter_config`` like
|
|
2614
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>` or
|
|
2615
|
+
// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>`, etc.
|
|
2616
|
+
HitsAddend hits_addend = 5;
|
|
2617
|
+
|
|
2618
|
+
// If true, the rate limit request will be applied when the stream completes. The default value is false.
|
|
2619
|
+
// This is useful when the rate limit budget needs to reflect the response context that is not available
|
|
2620
|
+
// on the request path.
|
|
2621
|
+
//
|
|
2622
|
+
// For example, let's say the upstream service calculates the usage statistics and returns them in the response body
|
|
2623
|
+
// and we want to utilize these numbers to apply the rate limit action for the subsequent requests.
|
|
2624
|
+
// Combined with another filter that can set the desired addend based on the response (e.g. Lua filter),
|
|
2625
|
+
// this can be used to subtract the usage statistics from the rate limit budget.
|
|
2626
|
+
//
|
|
2627
|
+
// A rate limit applied on the stream completion is "fire-and-forget" by nature, and rate limit is not enforced by this config.
|
|
2628
|
+
// In other words, the current request won't be blocked when this is true, but the budget will be updated for the subsequent
|
|
2629
|
+
// requests based on the action with this field set to true. Users should ensure that the rate limit is enforced by the actions
|
|
2630
|
+
// applied on the request path, i.e. the ones with this field set to false.
|
|
2631
|
+
//
|
|
2632
|
+
// Currently, this is only supported by the HTTP global rate filter.
|
|
2633
|
+
bool apply_on_stream_done = 6;
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
// .. attention::
|
|
2637
|
+
//
|
|
2638
|
+
// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1 ``Host``
|
|
2639
|
+
// header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
|
|
2640
|
+
//
|
|
2641
|
+
// .. attention::
|
|
2642
|
+
//
|
|
2643
|
+
// To route on HTTP method, use the special HTTP/2 ``:method`` header. This works for both
|
|
2644
|
+
// HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
|
|
2645
|
+
//
|
|
2646
|
+
// .. code-block:: json
|
|
2647
|
+
//
|
|
2648
|
+
// {
|
|
2649
|
+
// "name": ":method",
|
|
2650
|
+
// "string_match": {
|
|
2651
|
+
// "exact": "POST"
|
|
2652
|
+
// }
|
|
2653
|
+
// }
|
|
2654
|
+
//
|
|
2655
|
+
// .. attention::
|
|
2656
|
+
// In the absence of any header match specifier, match will default to :ref:`present_match
|
|
2657
|
+
// <envoy_v3_api_field_config.route.v3.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
|
|
2658
|
+
// <envoy_v3_api_field_config.route.v3.HeaderMatcher.name>` header will match, regardless of the header's
|
|
2659
|
+
// value.
|
|
2660
|
+
//
|
|
2661
|
+
// [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.]
|
|
2662
|
+
// [#next-free-field: 15]
|
|
2663
|
+
message HeaderMatcher {
|
|
2664
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.HeaderMatcher";
|
|
2665
|
+
|
|
2666
|
+
reserved 2, 3, 5;
|
|
2667
|
+
|
|
2668
|
+
reserved "regex_match";
|
|
2669
|
+
|
|
2670
|
+
// Specifies the name of the header in the request.
|
|
2671
|
+
string name = 1
|
|
2672
|
+
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
2673
|
+
|
|
2674
|
+
// Specifies how the header match will be performed to route the request.
|
|
2675
|
+
oneof header_match_specifier {
|
|
2676
|
+
// If specified, header match will be performed based on the value of the header.
|
|
2677
|
+
//
|
|
2678
|
+
// .. attention::
|
|
2679
|
+
//
|
|
2680
|
+
// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
|
|
2681
|
+
string exact_match = 4
|
|
2682
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
2683
|
+
|
|
2684
|
+
// If specified, this regex string is a regular expression rule which implies the entire request
|
|
2685
|
+
// header value must match the regex. The rule will not match if only a subsequence of the
|
|
2686
|
+
// request header value matches the regex.
|
|
2687
|
+
//
|
|
2688
|
+
// .. attention::
|
|
2689
|
+
//
|
|
2690
|
+
// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
|
|
2691
|
+
type.matcher.v3.RegexMatcher safe_regex_match = 11
|
|
2692
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
2693
|
+
|
|
2694
|
+
// If specified, header match will be performed based on range.
|
|
2695
|
+
// The rule will match if the request header value is within this range.
|
|
2696
|
+
// The entire request header value must represent an integer in base 10 notation: consisting of
|
|
2697
|
+
// an optional plus or minus sign followed by a sequence of digits. The rule will not match if
|
|
2698
|
+
// the header value does not represent an integer. Match will fail for empty values, floating
|
|
2699
|
+
// point numbers or if only a subsequence of the header value is an integer.
|
|
2700
|
+
//
|
|
2701
|
+
// Examples:
|
|
2702
|
+
//
|
|
2703
|
+
// * For range [-10,0), route will match for header value -1, but not for 0, ``somestring``, 10.9,
|
|
2704
|
+
// ``-1somestring``
|
|
2705
|
+
type.v3.Int64Range range_match = 6;
|
|
2706
|
+
|
|
2707
|
+
// If specified as true, header match will be performed based on whether the header is in the
|
|
2708
|
+
// request. If specified as false, header match will be performed based on whether the header is absent.
|
|
2709
|
+
bool present_match = 7;
|
|
2710
|
+
|
|
2711
|
+
// If specified, header match will be performed based on the prefix of the header value.
|
|
2712
|
+
//
|
|
2713
|
+
// .. note::
|
|
2714
|
+
//
|
|
2715
|
+
// Empty prefix is not allowed. Please use ``present_match`` instead.
|
|
2716
|
+
//
|
|
2717
|
+
// .. attention::
|
|
2718
|
+
//
|
|
2719
|
+
// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
|
|
2720
|
+
//
|
|
2721
|
+
// Examples:
|
|
2722
|
+
//
|
|
2723
|
+
// * The prefix ``abcd`` matches the value ``abcdxyz``, but not for ``abcxyz``.
|
|
2724
|
+
string prefix_match = 9 [
|
|
2725
|
+
deprecated = true,
|
|
2726
|
+
(validate.rules).string = {min_len: 1},
|
|
2727
|
+
(envoy.annotations.deprecated_at_minor_version) = "3.0"
|
|
2728
|
+
];
|
|
2729
|
+
|
|
2730
|
+
// If specified, header match will be performed based on the suffix of the header value.
|
|
2731
|
+
//
|
|
2732
|
+
// .. note::
|
|
2733
|
+
//
|
|
2734
|
+
// Empty suffix is not allowed. Please use ``present_match`` instead.
|
|
2735
|
+
//
|
|
2736
|
+
// .. attention::
|
|
2737
|
+
//
|
|
2738
|
+
// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
|
|
2739
|
+
//
|
|
2740
|
+
// Examples:
|
|
2741
|
+
//
|
|
2742
|
+
// * The suffix ``abcd`` matches the value ``xyzabcd``, but not for ``xyzbcd``.
|
|
2743
|
+
string suffix_match = 10 [
|
|
2744
|
+
deprecated = true,
|
|
2745
|
+
(validate.rules).string = {min_len: 1},
|
|
2746
|
+
(envoy.annotations.deprecated_at_minor_version) = "3.0"
|
|
2747
|
+
];
|
|
2748
|
+
|
|
2749
|
+
// If specified, header match will be performed based on whether the header value contains
|
|
2750
|
+
// the given value or not.
|
|
2751
|
+
//
|
|
2752
|
+
// .. note::
|
|
2753
|
+
//
|
|
2754
|
+
// Empty contains match is not allowed. Please use ``present_match`` instead.
|
|
2755
|
+
//
|
|
2756
|
+
// .. attention::
|
|
2757
|
+
//
|
|
2758
|
+
// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
|
|
2759
|
+
//
|
|
2760
|
+
// Examples:
|
|
2761
|
+
//
|
|
2762
|
+
// * The value ``abcd`` matches the value ``xyzabcdpqr``, but not for ``xyzbcdpqr``.
|
|
2763
|
+
string contains_match = 12 [
|
|
2764
|
+
deprecated = true,
|
|
2765
|
+
(validate.rules).string = {min_len: 1},
|
|
2766
|
+
(envoy.annotations.deprecated_at_minor_version) = "3.0"
|
|
2767
|
+
];
|
|
2768
|
+
|
|
2769
|
+
// If specified, header match will be performed based on the string match of the header value.
|
|
2770
|
+
type.matcher.v3.StringMatcher string_match = 13;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
// If specified, the match result will be inverted before checking.
|
|
2774
|
+
//
|
|
2775
|
+
// Defaults to ``false``.
|
|
2776
|
+
//
|
|
2777
|
+
// Examples:
|
|
2778
|
+
//
|
|
2779
|
+
// * The regex ``\d{3}`` does not match the value ``1234``, so it will match when inverted.
|
|
2780
|
+
// * The range [-10,0) will match the value -1, so it will not match when inverted.
|
|
2781
|
+
bool invert_match = 8;
|
|
2782
|
+
|
|
2783
|
+
// If specified, for any header match rule, if the header match rule specified header
|
|
2784
|
+
// does not exist, this header value will be treated as empty.
|
|
2785
|
+
//
|
|
2786
|
+
// Defaults to ``false``.
|
|
2787
|
+
//
|
|
2788
|
+
// Examples:
|
|
2789
|
+
//
|
|
2790
|
+
// * The header match rule specified header "header1" to range match of [0, 10],
|
|
2791
|
+
// :ref:`invert_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.invert_match>`
|
|
2792
|
+
// is set to true and :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
|
|
2793
|
+
// is set to true; The "header1" header is not present. The match rule will
|
|
2794
|
+
// treat the "header1" as an empty header. The empty header does not match the range,
|
|
2795
|
+
// so it will match when inverted.
|
|
2796
|
+
// * The header match rule specified header "header2" to range match of [0, 10],
|
|
2797
|
+
// :ref:`invert_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.invert_match>`
|
|
2798
|
+
// is set to true and :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
|
|
2799
|
+
// is set to false; The "header2" header is not present and the header
|
|
2800
|
+
// matcher rule for "header2" will be ignored so it will not match.
|
|
2801
|
+
// * The header match rule specified header "header3" to a string regex match
|
|
2802
|
+
// ``^$`` which means an empty string, and
|
|
2803
|
+
// :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
|
|
2804
|
+
// is set to true; The "header3" header is not present.
|
|
2805
|
+
// The match rule will treat the "header3" header as an empty header so it will match.
|
|
2806
|
+
// * The header match rule specified header "header4" to a string regex match
|
|
2807
|
+
// ``^$`` which means an empty string, and
|
|
2808
|
+
// :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
|
|
2809
|
+
// is set to false; The "header4" header is not present.
|
|
2810
|
+
// The match rule for "header4" will be ignored so it will not match.
|
|
2811
|
+
bool treat_missing_header_as_empty = 14;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
// Query parameter matching treats the query string of a request's :path header
|
|
2815
|
+
// as an ampersand-separated list of keys and/or key=value elements.
|
|
2816
|
+
// [#next-free-field: 7]
|
|
2817
|
+
message QueryParameterMatcher {
|
|
2818
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
2819
|
+
"envoy.api.v2.route.QueryParameterMatcher";
|
|
2820
|
+
|
|
2821
|
+
reserved 3, 4;
|
|
2822
|
+
|
|
2823
|
+
reserved "value", "regex";
|
|
2824
|
+
|
|
2825
|
+
// Specifies the name of a key that must be present in the requested
|
|
2826
|
+
// ``path``'s query string.
|
|
2827
|
+
string name = 1 [(validate.rules).string = {min_len: 1 max_bytes: 1024}];
|
|
2828
|
+
|
|
2829
|
+
oneof query_parameter_match_specifier {
|
|
2830
|
+
// Specifies whether a query parameter value should match against a string.
|
|
2831
|
+
type.matcher.v3.StringMatcher string_match = 5 [(validate.rules).message = {required: true}];
|
|
2832
|
+
|
|
2833
|
+
// Specifies whether a query parameter should be present.
|
|
2834
|
+
bool present_match = 6;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
// Cookie matching inspects individual name/value pairs parsed from the ``Cookie`` header.
|
|
2839
|
+
message CookieMatcher {
|
|
2840
|
+
// Specifies the cookie name to evaluate.
|
|
2841
|
+
string name = 1 [(validate.rules).string = {min_len: 1 max_bytes: 1024}];
|
|
2842
|
+
|
|
2843
|
+
// Match the cookie value using :ref:`StringMatcher
|
|
2844
|
+
// <envoy_v3_api_msg_type.matcher.v3.StringMatcher>` semantics.
|
|
2845
|
+
type.matcher.v3.StringMatcher string_match = 2 [(validate.rules).message = {required: true}];
|
|
2846
|
+
|
|
2847
|
+
// Invert the match result. If the cookie is not present, the match result is false, so
|
|
2848
|
+
// ``invert_match`` will cause the matcher to succeed when the cookie is absent.
|
|
2849
|
+
bool invert_match = 3;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
// HTTP Internal Redirect :ref:`architecture overview <arch_overview_internal_redirects>`.
|
|
2853
|
+
// [#next-free-field: 6]
|
|
2854
|
+
message InternalRedirectPolicy {
|
|
2855
|
+
// An internal redirect is not handled, unless the number of previous internal redirects that a
|
|
2856
|
+
// downstream request has encountered is lower than this value.
|
|
2857
|
+
// In the case where a downstream request is bounced among multiple routes by internal redirect,
|
|
2858
|
+
// the first route that hits this threshold, or does not set :ref:`internal_redirect_policy
|
|
2859
|
+
// <envoy_v3_api_field_config.route.v3.RouteAction.internal_redirect_policy>`
|
|
2860
|
+
// will pass the redirect back to downstream.
|
|
2861
|
+
//
|
|
2862
|
+
// If not specified, at most one redirect will be followed.
|
|
2863
|
+
google.protobuf.UInt32Value max_internal_redirects = 1;
|
|
2864
|
+
|
|
2865
|
+
// Defines what upstream response codes are allowed to trigger internal redirect. If unspecified,
|
|
2866
|
+
// only 302 will be treated as internal redirect.
|
|
2867
|
+
// Only 301, 302, 303, 307 and 308 are valid values. Any other codes will be ignored.
|
|
2868
|
+
repeated uint32 redirect_response_codes = 2 [(validate.rules).repeated = {max_items: 5}];
|
|
2869
|
+
|
|
2870
|
+
// Specifies a list of predicates that are queried when an upstream response is deemed
|
|
2871
|
+
// to trigger an internal redirect by all other criteria. Any predicate in the list can reject
|
|
2872
|
+
// the redirect, causing the response to be proxied to downstream.
|
|
2873
|
+
// [#extension-category: envoy.internal_redirect_predicates]
|
|
2874
|
+
repeated core.v3.TypedExtensionConfig predicates = 3;
|
|
2875
|
+
|
|
2876
|
+
// Allow internal redirect to follow a target URI with a different scheme than the value of
|
|
2877
|
+
// x-forwarded-proto. The default is ``false``.
|
|
2878
|
+
bool allow_cross_scheme_redirect = 4;
|
|
2879
|
+
|
|
2880
|
+
// Specifies a list of headers, by name, to copy from the internal redirect into the subsequent
|
|
2881
|
+
// request. If a header is specified here but not present in the redirect, it will be cleared in
|
|
2882
|
+
// the subsequent request.
|
|
2883
|
+
repeated string response_headers_to_copy = 5 [(validate.rules).repeated = {
|
|
2884
|
+
unique: true
|
|
2885
|
+
items {string {well_known_regex: HTTP_HEADER_NAME strict: false}}
|
|
2886
|
+
}];
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
// A simple wrapper for an HTTP filter config. This is intended to be used as a wrapper for the
|
|
2890
|
+
// map value in
|
|
2891
|
+
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`,
|
|
2892
|
+
// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>`,
|
|
2893
|
+
// or :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_v3_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`
|
|
2894
|
+
// to add additional flags to the filter.
|
|
2895
|
+
message FilterConfig {
|
|
2896
|
+
// The filter config.
|
|
2897
|
+
google.protobuf.Any config = 1;
|
|
2898
|
+
|
|
2899
|
+
// If true, the filter is optional, meaning that if the client does
|
|
2900
|
+
// not support the specified filter, it may ignore the map entry rather
|
|
2901
|
+
// than rejecting the config.
|
|
2902
|
+
bool is_optional = 2;
|
|
2903
|
+
|
|
2904
|
+
// If true, the filter is disabled in the route or virtual host and the ``config`` field is ignored.
|
|
2905
|
+
// See :ref:`route based filter chain <arch_overview_http_filters_route_based_filter_chain>`
|
|
2906
|
+
// for more details.
|
|
2907
|
+
//
|
|
2908
|
+
// .. note::
|
|
2909
|
+
//
|
|
2910
|
+
// This field will take effect when the request arrive and filter chain is created for the request.
|
|
2911
|
+
// If initial route is selected for the request and a filter is disabled in the initial route, then
|
|
2912
|
+
// the filter will not be added to the filter chain.
|
|
2913
|
+
// And if the request is mutated later and re-match to another route, the disabled filter by the
|
|
2914
|
+
// initial route will not be added back to the filter chain because the filter chain is already
|
|
2915
|
+
// created and it is too late to change the chain.
|
|
2916
|
+
//
|
|
2917
|
+
bool disabled = 3;
|
|
2918
|
+
}
|