1syntax = "proto3"; 2 3package envoy.api.v2.route; 4 5import "envoy/api/v2/core/base.proto"; 6import "envoy/type/matcher/regex.proto"; 7import "envoy/type/matcher/string.proto"; 8import "envoy/type/percent.proto"; 9import "envoy/type/range.proto"; 10import "envoy/type/tracing/v2/custom_tag.proto"; 11 12import "google/protobuf/any.proto"; 13import "google/protobuf/duration.proto"; 14import "google/protobuf/struct.proto"; 15import "google/protobuf/wrappers.proto"; 16 17import "envoy/annotations/deprecation.proto"; 18import "udpa/annotations/migrate.proto"; 19import "udpa/annotations/status.proto"; 20import "validate/validate.proto"; 21 22option java_package = "io.envoyproxy.envoy.api.v2.route"; 23option java_outer_classname = "RouteComponentsProto"; 24option java_multiple_files = true; 25option go_package = "github.com/envoyproxy/go-control-plane/envoy/api/v2/route"; 26option (udpa.annotations.file_migrate).move_to_package = "envoy.config.route.v3"; 27option (udpa.annotations.file_status).package_version_status = FROZEN; 28 29// [#protodoc-title: HTTP route components] 30// * Routing :ref:`architecture overview <arch_overview_http_routing>` 31// * HTTP :ref:`router filter <config_http_filters_router>` 32 33// The top level element in the routing configuration is a virtual host. Each virtual host has 34// a logical name as well as a set of domains that get routed to it based on the incoming request's 35// host header. This allows a single listener to service multiple top level domain path trees. Once 36// a virtual host is selected based on the domain, the routes are processed in order to see which 37// upstream cluster to route to or whether to perform a redirect. 38// [#next-free-field: 21] 39message VirtualHost { 40 enum TlsRequirementType { 41 // No TLS requirement for the virtual host. 42 NONE = 0; 43 44 // External requests must use TLS. If a request is external and it is not 45 // using TLS, a 301 redirect will be sent telling the client to use HTTPS. 46 EXTERNAL_ONLY = 1; 47 48 // All requests must use TLS. If a request is not using TLS, a 301 redirect 49 // will be sent telling the client to use HTTPS. 50 ALL = 2; 51 } 52 53 reserved 9; 54 55 // The logical name of the virtual host. This is used when emitting certain 56 // statistics but is not relevant for routing. 57 string name = 1 [(validate.rules).string = {min_bytes: 1}]; 58 59 // A list of domains (host/authority header) that will be matched to this 60 // virtual host. Wildcard hosts are supported in the suffix or prefix form. 61 // 62 // Domain search order: 63 // 1. Exact domain names: ``www.foo.com``. 64 // 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``. 65 // 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``. 66 // 4. Special wildcard ``*`` matching any domain. 67 // 68 // .. note:: 69 // 70 // The wildcard will not match the empty string. 71 // e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``. 72 // The longest wildcards match first. 73 // Only a single virtual host in the entire route configuration can match on ``*``. A domain 74 // must be unique across all virtual hosts or the config will fail to load. 75 // 76 // Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE. 77 repeated string domains = 2 [(validate.rules).repeated = { 78 min_items: 1 79 items {string {well_known_regex: HTTP_HEADER_VALUE strict: false}} 80 }]; 81 82 // The list of routes that will be matched, in order, for incoming requests. 83 // The first route that matches will be used. 84 repeated Route routes = 3; 85 86 // Specifies the type of TLS enforcement the virtual host expects. If this option is not 87 // specified, there is no TLS requirement for the virtual host. 88 TlsRequirementType require_tls = 4 [(validate.rules).enum = {defined_only: true}]; 89 90 // A list of virtual clusters defined for this virtual host. Virtual clusters 91 // are used for additional statistics gathering. 92 repeated VirtualCluster virtual_clusters = 5; 93 94 // Specifies a set of rate limit configurations that will be applied to the 95 // virtual host. 96 repeated RateLimit rate_limits = 6; 97 98 // Specifies a list of HTTP headers that should be added to each request 99 // handled by this virtual host. Headers specified at this level are applied 100 // after headers from enclosed :ref:`envoy_api_msg_route.Route` and before headers from the 101 // enclosing :ref:`envoy_api_msg_RouteConfiguration`. For more information, including 102 // details on header value syntax, see the documentation on :ref:`custom request headers 103 // <config_http_conn_man_headers_custom_request_headers>`. 104 repeated core.HeaderValueOption request_headers_to_add = 7 105 [(validate.rules).repeated = {max_items: 1000}]; 106 107 // Specifies a list of HTTP headers that should be removed from each request 108 // handled by this virtual host. 109 repeated string request_headers_to_remove = 13; 110 111 // Specifies a list of HTTP headers that should be added to each response 112 // handled by this virtual host. Headers specified at this level are applied 113 // after headers from enclosed :ref:`envoy_api_msg_route.Route` and before headers from the 114 // enclosing :ref:`envoy_api_msg_RouteConfiguration`. For more information, including 115 // details on header value syntax, see the documentation on :ref:`custom request headers 116 // <config_http_conn_man_headers_custom_request_headers>`. 117 repeated core.HeaderValueOption response_headers_to_add = 10 118 [(validate.rules).repeated = {max_items: 1000}]; 119 120 // Specifies a list of HTTP headers that should be removed from each response 121 // handled by this virtual host. 122 repeated string response_headers_to_remove = 11; 123 124 // Indicates that the virtual host has a CORS policy. 125 CorsPolicy cors = 8; 126 127 // The per_filter_config field can be used to provide virtual host-specific 128 // configurations for filters. The key should match the filter name, such as 129 // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter 130 // specific; see the :ref:`HTTP filter documentation <config_http_filters>` 131 // for if and how it is utilized. 132 map<string, google.protobuf.Struct> per_filter_config = 12 [deprecated = true]; 133 134 // The per_filter_config field can be used to provide virtual host-specific 135 // configurations for filters. The key should match the filter name, such as 136 // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter 137 // specific; see the :ref:`HTTP filter documentation <config_http_filters>` 138 // for if and how it is utilized. 139 map<string, google.protobuf.Any> typed_per_filter_config = 15; 140 141 // Decides whether the :ref:`x-envoy-attempt-count 142 // <config_http_filters_router_x-envoy-attempt-count>` header should be included 143 // in the upstream request. Setting this option will cause it to override any existing header 144 // value, so in the case of two Envoys on the request path with this option enabled, the upstream 145 // will see the attempt count as perceived by the second Envoy. Defaults to false. 146 // This header is unaffected by the 147 // :ref:`suppress_envoy_headers 148 // <envoy_api_field_config.filter.http.router.v2.Router.suppress_envoy_headers>` flag. 149 // 150 // [#next-major-version: rename to include_attempt_count_in_request.] 151 bool include_request_attempt_count = 14; 152 153 // Decides whether the :ref:`x-envoy-attempt-count 154 // <config_http_filters_router_x-envoy-attempt-count>` header should be included 155 // in the downstream response. Setting this option will cause the router to override any existing header 156 // value, so in the case of two Envoys on the request path with this option enabled, the downstream 157 // will see the attempt count as perceived by the Envoy closest upstream from itself. Defaults to false. 158 // This header is unaffected by the 159 // :ref:`suppress_envoy_headers 160 // <envoy_api_field_config.filter.http.router.v2.Router.suppress_envoy_headers>` flag. 161 bool include_attempt_count_in_response = 19; 162 163 // Indicates the retry policy for all routes in this virtual host. Note that setting a 164 // route level entry will take precedence over this config and it'll be treated 165 // independently (e.g.: values are not inherited). 166 RetryPolicy retry_policy = 16; 167 168 // [#not-implemented-hide:] 169 // Specifies the configuration for retry policy extension. Note that setting a route level entry 170 // will take precedence over this config and it'll be treated independently (e.g.: values are not 171 // inherited). :ref:`Retry policy <envoy_api_field_route.VirtualHost.retry_policy>` should not be 172 // set if this field is used. 173 google.protobuf.Any retry_policy_typed_config = 20; 174 175 // Indicates the hedge policy for all routes in this virtual host. Note that setting a 176 // route level entry will take precedence over this config and it'll be treated 177 // independently (e.g.: values are not inherited). 178 HedgePolicy hedge_policy = 17; 179 180 // The maximum bytes which will be buffered for retries and shadowing. 181 // If set and a route-specific limit is not set, the bytes actually buffered will be the minimum 182 // value of this and the listener per_connection_buffer_limit_bytes. 183 google.protobuf.UInt32Value per_request_buffer_limit_bytes = 18; 184} 185 186// A filter-defined action type. 187message FilterAction { 188 google.protobuf.Any action = 1; 189} 190 191// A route is both a specification of how to match a request as well as an indication of what to do 192// next (e.g., redirect, forward, rewrite, etc.). 193// 194// .. attention:: 195// 196// Envoy supports routing on HTTP method via :ref:`header matching 197// <envoy_api_msg_route.HeaderMatcher>`. 198// [#next-free-field: 18] 199message Route { 200 reserved 6; 201 202 // Name for the route. 203 string name = 14; 204 205 // Route matching parameters. 206 RouteMatch match = 1 [(validate.rules).message = {required: true}]; 207 208 oneof action { 209 option (validate.required) = true; 210 211 // Route request to some upstream cluster. 212 RouteAction route = 2; 213 214 // Return a redirect. 215 RedirectAction redirect = 3; 216 217 // Return an arbitrary HTTP response directly, without proxying. 218 DirectResponseAction direct_response = 7; 219 220 // [#not-implemented-hide:] 221 // If true, a filter will define the action (e.g., it could dynamically generate the 222 // RouteAction). 223 FilterAction filter_action = 17; 224 } 225 226 // The Metadata field can be used to provide additional information 227 // about the route. It can be used for configuration, stats, and logging. 228 // The metadata should go under the filter namespace that will need it. 229 // For instance, if the metadata is intended for the Router filter, 230 // the filter name should be specified as *envoy.filters.http.router*. 231 core.Metadata metadata = 4; 232 233 // Decorator for the matched route. 234 Decorator decorator = 5; 235 236 // The per_filter_config field can be used to provide route-specific 237 // configurations for filters. The key should match the filter name, such as 238 // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter 239 // specific; see the :ref:`HTTP filter documentation <config_http_filters>` for 240 // if and how it is utilized. 241 map<string, google.protobuf.Struct> per_filter_config = 8 [deprecated = true]; 242 243 // The typed_per_filter_config field can be used to provide route-specific 244 // configurations for filters. The key should match the filter name, such as 245 // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter 246 // specific; see the :ref:`HTTP filter documentation <config_http_filters>` for 247 // if and how it is utilized. 248 map<string, google.protobuf.Any> typed_per_filter_config = 13; 249 250 // Specifies a set of headers that will be added to requests matching this 251 // route. Headers specified at this level are applied before headers from the 252 // enclosing :ref:`envoy_api_msg_route.VirtualHost` and 253 // :ref:`envoy_api_msg_RouteConfiguration`. For more information, including details on 254 // header value syntax, see the documentation on :ref:`custom request headers 255 // <config_http_conn_man_headers_custom_request_headers>`. 256 repeated core.HeaderValueOption request_headers_to_add = 9 257 [(validate.rules).repeated = {max_items: 1000}]; 258 259 // Specifies a list of HTTP headers that should be removed from each request 260 // matching this route. 261 repeated string request_headers_to_remove = 12; 262 263 // Specifies a set of headers that will be added to responses to requests 264 // matching this route. Headers specified at this level are applied before 265 // headers from the enclosing :ref:`envoy_api_msg_route.VirtualHost` and 266 // :ref:`envoy_api_msg_RouteConfiguration`. For more information, including 267 // details on header value syntax, see the documentation on 268 // :ref:`custom request headers <config_http_conn_man_headers_custom_request_headers>`. 269 repeated core.HeaderValueOption response_headers_to_add = 10 270 [(validate.rules).repeated = {max_items: 1000}]; 271 272 // Specifies a list of HTTP headers that should be removed from each response 273 // to requests matching this route. 274 repeated string response_headers_to_remove = 11; 275 276 // Presence of the object defines whether the connection manager's tracing configuration 277 // is overridden by this route specific instance. 278 Tracing tracing = 15; 279 280 // The maximum bytes which will be buffered for retries and shadowing. 281 // If set, the bytes actually buffered will be the minimum value of this and the 282 // listener per_connection_buffer_limit_bytes. 283 google.protobuf.UInt32Value per_request_buffer_limit_bytes = 16; 284} 285 286// Compared to the :ref:`cluster <envoy_api_field_route.RouteAction.cluster>` field that specifies a 287// single upstream cluster as the target of a request, the :ref:`weighted_clusters 288// <envoy_api_field_route.RouteAction.weighted_clusters>` option allows for specification of 289// multiple upstream clusters along with weights that indicate the percentage of 290// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the 291// weights. 292message WeightedCluster { 293 // [#next-free-field: 11] 294 message ClusterWeight { 295 reserved 7; 296 297 // Name of the upstream cluster. The cluster must exist in the 298 // :ref:`cluster manager configuration <config_cluster_manager>`. 299 string name = 1 [(validate.rules).string = {min_bytes: 1}]; 300 301 // An integer between 0 and :ref:`total_weight 302 // <envoy_api_field_route.WeightedCluster.total_weight>`. When a request matches the route, 303 // the choice of an upstream cluster is determined by its weight. The sum of weights across all 304 // entries in the clusters array must add up to the total_weight, if total_weight is greater than 0. 305 google.protobuf.UInt32Value weight = 2; 306 307 // Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in 308 // the upstream cluster with metadata matching what is set in this field will be considered for 309 // load balancing. Note that this will be merged with what's provided in 310 // :ref:`RouteAction.metadata_match <envoy_api_field_route.RouteAction.metadata_match>`, with 311 // values here taking precedence. The filter name should be specified as *envoy.lb*. 312 core.Metadata metadata_match = 3; 313 314 // Specifies a list of headers to be added to requests when this cluster is selected 315 // through the enclosing :ref:`envoy_api_msg_route.RouteAction`. 316 // Headers specified at this level are applied before headers from the enclosing 317 // :ref:`envoy_api_msg_route.Route`, :ref:`envoy_api_msg_route.VirtualHost`, and 318 // :ref:`envoy_api_msg_RouteConfiguration`. For more information, including details on 319 // header value syntax, see the documentation on :ref:`custom request headers 320 // <config_http_conn_man_headers_custom_request_headers>`. 321 repeated core.HeaderValueOption request_headers_to_add = 4 322 [(validate.rules).repeated = {max_items: 1000}]; 323 324 // Specifies a list of HTTP headers that should be removed from each request when 325 // this cluster is selected through the enclosing :ref:`envoy_api_msg_route.RouteAction`. 326 repeated string request_headers_to_remove = 9; 327 328 // Specifies a list of headers to be added to responses when this cluster is selected 329 // through the enclosing :ref:`envoy_api_msg_route.RouteAction`. 330 // Headers specified at this level are applied before headers from the enclosing 331 // :ref:`envoy_api_msg_route.Route`, :ref:`envoy_api_msg_route.VirtualHost`, and 332 // :ref:`envoy_api_msg_RouteConfiguration`. For more information, including details on 333 // header value syntax, see the documentation on :ref:`custom request headers 334 // <config_http_conn_man_headers_custom_request_headers>`. 335 repeated core.HeaderValueOption response_headers_to_add = 5 336 [(validate.rules).repeated = {max_items: 1000}]; 337 338 // Specifies a list of headers to be removed from responses when this cluster is selected 339 // through the enclosing :ref:`envoy_api_msg_route.RouteAction`. 340 repeated string response_headers_to_remove = 6; 341 342 // The per_filter_config field can be used to provide weighted cluster-specific 343 // configurations for filters. The key should match the filter name, such as 344 // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter 345 // specific; see the :ref:`HTTP filter documentation <config_http_filters>` 346 // for if and how it is utilized. 347 map<string, google.protobuf.Struct> per_filter_config = 8 [deprecated = true]; 348 349 // The per_filter_config field can be used to provide weighted cluster-specific 350 // configurations for filters. The key should match the filter name, such as 351 // *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter 352 // specific; see the :ref:`HTTP filter documentation <config_http_filters>` 353 // for if and how it is utilized. 354 map<string, google.protobuf.Any> typed_per_filter_config = 10; 355 } 356 357 // Specifies one or more upstream clusters associated with the route. 358 repeated ClusterWeight clusters = 1 [(validate.rules).repeated = {min_items: 1}]; 359 360 // Specifies the total weight across all clusters. The sum of all cluster weights must equal this 361 // value, which must be greater than 0. Defaults to 100. 362 google.protobuf.UInt32Value total_weight = 3 [(validate.rules).uint32 = {gte: 1}]; 363 364 // Specifies the runtime key prefix that should be used to construct the 365 // runtime keys associated with each cluster. When the *runtime_key_prefix* is 366 // specified, the router will look for weights associated with each upstream 367 // cluster under the key *runtime_key_prefix* + "." + *cluster[i].name* where 368 // *cluster[i]* denotes an entry in the clusters array field. If the runtime 369 // key for the cluster does not exist, the value specified in the 370 // configuration file will be used as the default weight. See the :ref:`runtime documentation 371 // <operations_runtime>` for how key names map to the underlying implementation. 372 string runtime_key_prefix = 2; 373} 374 375// [#next-free-field: 12] 376message RouteMatch { 377 message GrpcRouteMatchOptions { 378 } 379 380 message TlsContextMatchOptions { 381 // If specified, the route will match against whether or not a certificate is presented. 382 // If not specified, certificate presentation status (true or false) will not be considered when route matching. 383 google.protobuf.BoolValue presented = 1; 384 385 // If specified, the route will match against whether or not a certificate is validated. 386 // If not specified, certificate validation status (true or false) will not be considered when route matching. 387 google.protobuf.BoolValue validated = 2; 388 } 389 390 reserved 5; 391 392 oneof path_specifier { 393 option (validate.required) = true; 394 395 // If specified, the route is a prefix rule meaning that the prefix must 396 // match the beginning of the *:path* header. 397 string prefix = 1; 398 399 // If specified, the route is an exact path rule meaning that the path must 400 // exactly match the *:path* header once the query string is removed. 401 string path = 2; 402 403 // If specified, the route is a regular expression rule meaning that the 404 // regex must match the *:path* header once the query string is removed. The entire path 405 // (without the query string) must match the regex. The rule will not match if only a 406 // subsequence of the *:path* header matches the regex. The regex grammar is defined `here 407 // <https://en.cppreference.com/w/cpp/regex/ecmascript>`_. 408 // 409 // Examples: 410 // 411 // * The regex ``/b[io]t`` matches the path */bit* 412 // * The regex ``/b[io]t`` matches the path */bot* 413 // * The regex ``/b[io]t`` does not match the path */bite* 414 // * The regex ``/b[io]t`` does not match the path */bit/bot* 415 // 416 // .. attention:: 417 // This field has been deprecated in favor of `safe_regex` as it is not safe for use with 418 // untrusted input in all cases. 419 string regex = 3 [ 420 deprecated = true, 421 (validate.rules).string = {max_bytes: 1024}, 422 (envoy.annotations.disallowed_by_default) = true 423 ]; 424 425 // If specified, the route is a regular expression rule meaning that the 426 // regex must match the *:path* header once the query string is removed. The entire path 427 // (without the query string) must match the regex. The rule will not match if only a 428 // subsequence of the *:path* header matches the regex. 429 // 430 // [#next-major-version: In the v3 API we should redo how path specification works such 431 // that we utilize StringMatcher, and additionally have consistent options around whether we 432 // strip query strings, do a case sensitive match, etc. In the interim it will be too disruptive 433 // to deprecate the existing options. We should even consider whether we want to do away with 434 // path_specifier entirely and just rely on a set of header matchers which can already match 435 // on :path, etc. The issue with that is it is unclear how to generically deal with query string 436 // stripping. This needs more thought.] 437 type.matcher.RegexMatcher safe_regex = 10 [(validate.rules).message = {required: true}]; 438 } 439 440 // Indicates that prefix/path matching should be case sensitive. The default 441 // is true. 442 google.protobuf.BoolValue case_sensitive = 4; 443 444 // Indicates that the route should additionally match on a runtime key. Every time the route 445 // is considered for a match, it must also fall under the percentage of matches indicated by 446 // this field. For some fraction N/D, a random number in the range [0,D) is selected. If the 447 // number is <= the value of the numerator N, or if the key is not present, the default 448 // value, the router continues to evaluate the remaining match criteria. A runtime_fraction 449 // route configuration can be used to roll out route changes in a gradual manner without full 450 // code/config deploys. Refer to the :ref:`traffic shifting 451 // <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation. 452 // 453 // .. note:: 454 // 455 // Parsing this field is implemented such that the runtime key's data may be represented 456 // as a FractionalPercent proto represented as JSON/YAML and may also be represented as an 457 // integer with the assumption that the value is an integral percentage out of 100. For 458 // instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent 459 // whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics. 460 core.RuntimeFractionalPercent runtime_fraction = 9; 461 462 // Specifies a set of headers that the route should match on. The router will 463 // check the request’s headers against all the specified headers in the route 464 // config. A match will happen if all the headers in the route are present in 465 // the request with the same values (or based on presence if the value field 466 // is not in the config). 467 repeated HeaderMatcher headers = 6; 468 469 // Specifies a set of URL query parameters on which the route should 470 // match. The router will check the query string from the *path* header 471 // against all the specified query parameters. If the number of specified 472 // query parameters is nonzero, they all must match the *path* header's 473 // query string for a match to occur. 474 repeated QueryParameterMatcher query_parameters = 7; 475 476 // If specified, only gRPC requests will be matched. The router will check 477 // that the content-type header has a application/grpc or one of the various 478 // application/grpc+ values. 479 GrpcRouteMatchOptions grpc = 8; 480 481 // If specified, the client tls context will be matched against the defined 482 // match options. 483 // 484 // [#next-major-version: unify with RBAC] 485 TlsContextMatchOptions tls_context = 11; 486} 487 488// [#next-free-field: 12] 489message CorsPolicy { 490 // Specifies the origins that will be allowed to do CORS requests. 491 // 492 // An origin is allowed if either allow_origin or allow_origin_regex match. 493 // 494 // .. attention:: 495 // This field has been deprecated in favor of `allow_origin_string_match`. 496 repeated string allow_origin = 1 497 [deprecated = true, (envoy.annotations.disallowed_by_default) = true]; 498 499 // Specifies regex patterns that match allowed origins. 500 // 501 // An origin is allowed if either allow_origin or allow_origin_regex match. 502 // 503 // .. attention:: 504 // This field has been deprecated in favor of `allow_origin_string_match` as it is not safe for 505 // use with untrusted input in all cases. 506 repeated string allow_origin_regex = 8 507 [deprecated = true, (validate.rules).repeated = {items {string {max_bytes: 1024}}}]; 508 509 // Specifies string patterns that match allowed origins. An origin is allowed if any of the 510 // string matchers match. 511 repeated type.matcher.StringMatcher allow_origin_string_match = 11; 512 513 // Specifies the content for the *access-control-allow-methods* header. 514 string allow_methods = 2; 515 516 // Specifies the content for the *access-control-allow-headers* header. 517 string allow_headers = 3; 518 519 // Specifies the content for the *access-control-expose-headers* header. 520 string expose_headers = 4; 521 522 // Specifies the content for the *access-control-max-age* header. 523 string max_age = 5; 524 525 // Specifies whether the resource allows credentials. 526 google.protobuf.BoolValue allow_credentials = 6; 527 528 oneof enabled_specifier { 529 // Specifies if the CORS filter is enabled. Defaults to true. Only effective on route. 530 // 531 // .. attention:: 532 // 533 // **This field is deprecated**. Set the 534 // :ref:`filter_enabled<envoy_api_field_route.CorsPolicy.filter_enabled>` field instead. 535 google.protobuf.BoolValue enabled = 7 536 [deprecated = true, (envoy.annotations.disallowed_by_default) = true]; 537 538 // Specifies the % of requests for which the CORS filter is enabled. 539 // 540 // If neither ``enabled``, ``filter_enabled``, nor ``shadow_enabled`` are specified, the CORS 541 // filter will be enabled for 100% of the requests. 542 // 543 // If :ref:`runtime_key <envoy_api_field_core.RuntimeFractionalPercent.runtime_key>` is 544 // specified, Envoy will lookup the runtime key to get the percentage of requests to filter. 545 core.RuntimeFractionalPercent filter_enabled = 9; 546 } 547 548 // Specifies the % of requests for which the CORS policies will be evaluated and tracked, but not 549 // enforced. 550 // 551 // This field is intended to be used when ``filter_enabled`` and ``enabled`` are off. One of those 552 // fields have to explicitly disable the filter in order for this setting to take effect. 553 // 554 // If :ref:`runtime_key <envoy_api_field_core.RuntimeFractionalPercent.runtime_key>` is specified, 555 // Envoy will lookup the runtime key to get the percentage of requests for which it will evaluate 556 // and track the request's *Origin* to determine if it's valid but will not enforce any policies. 557 core.RuntimeFractionalPercent shadow_enabled = 10; 558} 559 560// [#next-free-field: 34] 561message RouteAction { 562 enum ClusterNotFoundResponseCode { 563 // HTTP status code - 503 Service Unavailable. 564 SERVICE_UNAVAILABLE = 0; 565 566 // HTTP status code - 404 Not Found. 567 NOT_FOUND = 1; 568 } 569 570 // Configures :ref:`internal redirect <arch_overview_internal_redirects>` behavior. 571 enum InternalRedirectAction { 572 PASS_THROUGH_INTERNAL_REDIRECT = 0; 573 HANDLE_INTERNAL_REDIRECT = 1; 574 } 575 576 // The router is capable of shadowing traffic from one cluster to another. The current 577 // implementation is "fire and forget," meaning Envoy will not wait for the shadow cluster to 578 // respond before returning the response from the primary cluster. All normal statistics are 579 // collected for the shadow cluster making this feature useful for testing. 580 // 581 // During shadowing, the host/authority header is altered such that *-shadow* is appended. This is 582 // useful for logging. For example, *cluster1* becomes *cluster1-shadow*. 583 // 584 // .. note:: 585 // 586 // Shadowing will not be triggered if the primary cluster does not exist. 587 message RequestMirrorPolicy { 588 // Specifies the cluster that requests will be mirrored to. The cluster must 589 // exist in the cluster manager configuration. 590 string cluster = 1 [(validate.rules).string = {min_bytes: 1}]; 591 592 // If not specified, all requests to the target cluster will be mirrored. If 593 // specified, Envoy will lookup the runtime key to get the % of requests to 594 // mirror. Valid values are from 0 to 10000, allowing for increments of 595 // 0.01% of requests to be mirrored. If the runtime key is specified in the 596 // configuration but not present in runtime, 0 is the default and thus 0% of 597 // requests will be mirrored. 598 // 599 // .. attention:: 600 // 601 // **This field is deprecated**. Set the 602 // :ref:`runtime_fraction 603 // <envoy_api_field_route.RouteAction.RequestMirrorPolicy.runtime_fraction>` 604 // field instead. Mirroring occurs if both this and 605 // <envoy_api_field_route.RouteAction.RequestMirrorPolicy.runtime_fraction>` 606 // are not set. 607 string runtime_key = 2 [deprecated = true, (envoy.annotations.disallowed_by_default) = true]; 608 609 // If not specified, all requests to the target cluster will be mirrored. 610 // 611 // If specified, this field takes precedence over the `runtime_key` field and requests must also 612 // fall under the percentage of matches indicated by this field. 613 // 614 // For some fraction N/D, a random number in the range [0,D) is selected. If the 615 // number is <= the value of the numerator N, or if the key is not present, the default 616 // value, the request will be mirrored. 617 core.RuntimeFractionalPercent runtime_fraction = 3; 618 619 // Determines if the trace span should be sampled. Defaults to true. 620 google.protobuf.BoolValue trace_sampled = 4; 621 } 622 623 // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer 624 // <arch_overview_load_balancing_types>`. 625 // [#next-free-field: 7] 626 message HashPolicy { 627 message Header { 628 // The name of the request header that will be used to obtain the hash 629 // key. If the request header is not present, no hash will be produced. 630 string header_name = 1 [ 631 (validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false} 632 ]; 633 } 634 635 // Envoy supports two types of cookie affinity: 636 // 637 // 1. Passive. Envoy takes a cookie that's present in the cookies header and 638 // hashes on its value. 639 // 640 // 2. Generated. Envoy generates and sets a cookie with an expiration (TTL) 641 // on the first request from the client in its response to the client, 642 // based on the endpoint the request gets sent to. The client then 643 // presents this on the next and all subsequent requests. The hash of 644 // this is sufficient to ensure these requests get sent to the same 645 // endpoint. The cookie is generated by hashing the source and 646 // destination ports and addresses so that multiple independent HTTP2 647 // streams on the same connection will independently receive the same 648 // cookie, even if they arrive at the Envoy simultaneously. 649 message Cookie { 650 // The name of the cookie that will be used to obtain the hash key. If the 651 // cookie is not present and ttl below is not set, no hash will be 652 // produced. 653 string name = 1 [(validate.rules).string = {min_bytes: 1}]; 654 655 // If specified, a cookie with the TTL will be generated if the cookie is 656 // not present. If the TTL is present and zero, the generated cookie will 657 // be a session cookie. 658 google.protobuf.Duration ttl = 2; 659 660 // The name of the path for the cookie. If no path is specified here, no path 661 // will be set for the cookie. 662 string path = 3; 663 } 664 665 message ConnectionProperties { 666 // Hash on source IP address. 667 bool source_ip = 1; 668 } 669 670 message QueryParameter { 671 // The name of the URL query parameter that will be used to obtain the hash 672 // key. If the parameter is not present, no hash will be produced. Query 673 // parameter names are case-sensitive. 674 string name = 1 [(validate.rules).string = {min_bytes: 1}]; 675 } 676 677 message FilterState { 678 // The name of the Object in the per-request filterState, which is an 679 // Envoy::Hashable object. If there is no data associated with the key, 680 // or the stored object is not Envoy::Hashable, no hash will be produced. 681 string key = 1 [(validate.rules).string = {min_bytes: 1}]; 682 } 683 684 oneof policy_specifier { 685 option (validate.required) = true; 686 687 // Header hash policy. 688 Header header = 1; 689 690 // Cookie hash policy. 691 Cookie cookie = 2; 692 693 // Connection properties hash policy. 694 ConnectionProperties connection_properties = 3; 695 696 // Query parameter hash policy. 697 QueryParameter query_parameter = 5; 698 699 // Filter state hash policy. 700 FilterState filter_state = 6; 701 } 702 703 // The flag that short-circuits the hash computing. This field provides a 704 // 'fallback' style of configuration: "if a terminal policy doesn't work, 705 // fallback to rest of the policy list", it saves time when the terminal 706 // policy works. 707 // 708 // If true, and there is already a hash computed, ignore rest of the 709 // list of hash polices. 710 // For example, if the following hash methods are configured: 711 // 712 // ========= ======== 713 // specifier terminal 714 // ========= ======== 715 // Header A true 716 // Header B false 717 // Header C false 718 // ========= ======== 719 // 720 // The generateHash process ends if policy "header A" generates a hash, as 721 // it's a terminal policy. 722 bool terminal = 4; 723 } 724 725 // Allows enabling and disabling upgrades on a per-route basis. 726 // This overrides any enabled/disabled upgrade filter chain specified in the 727 // HttpConnectionManager 728 // :ref:`upgrade_configs 729 // <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.upgrade_configs>` 730 // but does not affect any custom filter chain specified there. 731 message UpgradeConfig { 732 // The case-insensitive name of this upgrade, e.g. "websocket". 733 // For each upgrade type present in upgrade_configs, requests with 734 // Upgrade: [upgrade_type] will be proxied upstream. 735 string upgrade_type = 1 736 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; 737 738 // Determines if upgrades are available on this route. Defaults to true. 739 google.protobuf.BoolValue enabled = 2; 740 } 741 742 reserved 12, 18, 19, 16, 22, 21; 743 744 oneof cluster_specifier { 745 option (validate.required) = true; 746 747 // Indicates the upstream cluster to which the request should be routed 748 // to. 749 string cluster = 1 [(validate.rules).string = {min_bytes: 1}]; 750 751 // Envoy will determine the cluster to route to by reading the value of the 752 // HTTP header named by cluster_header from the request headers. If the 753 // header is not found or the referenced cluster does not exist, Envoy will 754 // return a 404 response. 755 // 756 // .. attention:: 757 // 758 // Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 759 // *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead. 760 // 761 // .. note:: 762 // 763 // If the header appears multiple times only the first value is used. 764 string cluster_header = 2 765 [(validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false}]; 766 767 // Multiple upstream clusters can be specified for a given route. The 768 // request is routed to one of the upstream clusters based on weights 769 // assigned to each cluster. See 770 // :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>` 771 // for additional documentation. 772 WeightedCluster weighted_clusters = 3; 773 } 774 775 // The HTTP status code to use when configured cluster is not found. 776 // The default response code is 503 Service Unavailable. 777 ClusterNotFoundResponseCode cluster_not_found_response_code = 20 778 [(validate.rules).enum = {defined_only: true}]; 779 780 // Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints 781 // in the upstream cluster with metadata matching what's set in this field will be considered 782 // for load balancing. If using :ref:`weighted_clusters 783 // <envoy_api_field_route.RouteAction.weighted_clusters>`, metadata will be merged, with values 784 // provided there taking precedence. The filter name should be specified as *envoy.lb*. 785 core.Metadata metadata_match = 4; 786 787 // Indicates that during forwarding, the matched prefix (or path) should be 788 // swapped with this value. This option allows application URLs to be rooted 789 // at a different path from those exposed at the reverse proxy layer. The router filter will 790 // place the original path before rewrite into the :ref:`x-envoy-original-path 791 // <config_http_filters_router_x-envoy-original-path>` header. 792 // 793 // Only one of *prefix_rewrite* or 794 // :ref:`regex_rewrite <envoy_api_field_route.RouteAction.regex_rewrite>` 795 // may be specified. 796 // 797 // .. attention:: 798 // 799 // Pay careful attention to the use of trailing slashes in the 800 // :ref:`route's match <envoy_api_field_route.Route.match>` prefix value. 801 // Stripping a prefix from a path requires multiple Routes to handle all cases. For example, 802 // rewriting */prefix* to */* and */prefix/etc* to */etc* cannot be done in a single 803 // :ref:`Route <envoy_api_msg_route.Route>`, as shown by the below config entries: 804 // 805 // .. code-block:: yaml 806 // 807 // - match: 808 // prefix: "/prefix/" 809 // route: 810 // prefix_rewrite: "/" 811 // - match: 812 // prefix: "/prefix" 813 // route: 814 // prefix_rewrite: "/" 815 // 816 // Having above entries in the config, requests to */prefix* will be stripped to */*, while 817 // requests to */prefix/etc* will be stripped to */etc*. 818 string prefix_rewrite = 5 819 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; 820 821 // Indicates that during forwarding, portions of the path that match the 822 // pattern should be rewritten, even allowing the substitution of capture 823 // groups from the pattern into the new path as specified by the rewrite 824 // substitution string. This is useful to allow application paths to be 825 // rewritten in a way that is aware of segments with variable content like 826 // identifiers. The router filter will place the original path as it was 827 // before the rewrite into the :ref:`x-envoy-original-path 828 // <config_http_filters_router_x-envoy-original-path>` header. 829 // 830 // Only one of :ref:`prefix_rewrite <envoy_api_field_route.RouteAction.prefix_rewrite>` 831 // or *regex_rewrite* may be specified. 832 // 833 // Examples using Google's `RE2 <https://github.com/google/re2>`_ engine: 834 // 835 // * The path pattern ``^/service/([^/]+)(/.*)$`` paired with a substitution 836 // string of ``\2/instance/\1`` would transform ``/service/foo/v1/api`` 837 // into ``/v1/api/instance/foo``. 838 // 839 // * The pattern ``one`` paired with a substitution string of ``two`` would 840 // transform ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/two/zzz``. 841 // 842 // * The pattern ``^(.*?)one(.*)$`` paired with a substitution string of 843 // ``\1two\2`` would replace only the first occurrence of ``one``, 844 // transforming path ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/one/zzz``. 845 // 846 // * The pattern ``(?i)/xxx/`` paired with a substitution string of ``/yyy/`` 847 // would do a case-insensitive match and transform path ``/aaa/XxX/bbb`` to 848 // ``/aaa/yyy/bbb``. 849 type.matcher.RegexMatchAndSubstitute regex_rewrite = 32; 850 851 oneof host_rewrite_specifier { 852 // Indicates that during forwarding, the host header will be swapped with 853 // this value. 854 string host_rewrite = 6 [ 855 (validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}, 856 (udpa.annotations.field_migrate).rename = "host_rewrite_literal" 857 ]; 858 859 // Indicates that during forwarding, the host header will be swapped with 860 // the hostname of the upstream host chosen by the cluster manager. This 861 // option is applicable only when the destination cluster for a route is of 862 // type ``STRICT_DNS``, ``LOGICAL_DNS`` or ``STATIC``. For ``STATIC`` clusters, the 863 // hostname attribute of the endpoint must be configured. Setting this to true 864 // with other cluster types has no effect. 865 google.protobuf.BoolValue auto_host_rewrite = 7; 866 867 // Indicates that during forwarding, the host header will be swapped with the content of given 868 // downstream or :ref:`custom <config_http_conn_man_headers_custom_request_headers>` header. 869 // If header value is empty, host header is left intact. 870 // 871 // .. attention:: 872 // 873 // Pay attention to the potential security implications of using this option. Provided header 874 // must come from trusted source. 875 // 876 // .. note:: 877 // 878 // If the header appears multiple times only the first value is used. 879 string auto_host_rewrite_header = 29 [ 880 (validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}, 881 (udpa.annotations.field_migrate).rename = "host_rewrite_header" 882 ]; 883 } 884 885 // Specifies the upstream timeout for the route. If not specified, the default is 15s. This 886 // spans between the point at which the entire downstream request (i.e. end-of-stream) has been 887 // processed and when the upstream response has been completely processed. A value of 0 will 888 // disable the route's timeout. 889 // 890 // .. note:: 891 // 892 // This timeout includes all retries. See also 893 // :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`, 894 // :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the 895 // :ref:`retry overview <arch_overview_http_routing_retry>`. 896 google.protobuf.Duration timeout = 8; 897 898 // Specifies the idle timeout for the route. If not specified, there is no per-route idle timeout, 899 // although the connection manager wide :ref:`stream_idle_timeout 900 // <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.stream_idle_timeout>` 901 // will still apply. A value of 0 will completely disable the route's idle timeout, even if a 902 // connection manager stream idle timeout is configured. 903 // 904 // The idle timeout is distinct to :ref:`timeout 905 // <envoy_api_field_route.RouteAction.timeout>`, which provides an upper bound 906 // on the upstream response time; :ref:`idle_timeout 907 // <envoy_api_field_route.RouteAction.idle_timeout>` instead bounds the amount 908 // of time the request's stream may be idle. 909 // 910 // After header decoding, the idle timeout will apply on downstream and 911 // upstream request events. Each time an encode/decode event for headers or 912 // data is processed for the stream, the timer will be reset. If the timeout 913 // fires, the stream is terminated with a 408 Request Timeout error code if no 914 // upstream response header has been received, otherwise a stream reset 915 // occurs. 916 google.protobuf.Duration idle_timeout = 24; 917 918 // Indicates that the route has a retry policy. Note that if this is set, 919 // it'll take precedence over the virtual host level retry policy entirely 920 // (e.g.: policies are not merged, most internal one becomes the enforced policy). 921 RetryPolicy retry_policy = 9; 922 923 // [#not-implemented-hide:] 924 // Specifies the configuration for retry policy extension. Note that if this is set, it'll take 925 // precedence over the virtual host level retry policy entirely (e.g.: policies are not merged, 926 // most internal one becomes the enforced policy). :ref:`Retry policy <envoy_api_field_route.VirtualHost.retry_policy>` 927 // should not be set if this field is used. 928 google.protobuf.Any retry_policy_typed_config = 33; 929 930 // Indicates that the route has a request mirroring policy. 931 // 932 // .. attention:: 933 // This field has been deprecated in favor of `request_mirror_policies` which supports one or 934 // more mirroring policies. 935 RequestMirrorPolicy request_mirror_policy = 10 [deprecated = true]; 936 937 // Indicates that the route has request mirroring policies. 938 repeated RequestMirrorPolicy request_mirror_policies = 30; 939 940 // Optionally specifies the :ref:`routing priority <arch_overview_http_routing_priority>`. 941 core.RoutingPriority priority = 11 [(validate.rules).enum = {defined_only: true}]; 942 943 // Specifies a set of rate limit configurations that could be applied to the 944 // route. 945 repeated RateLimit rate_limits = 13; 946 947 // Specifies if the rate limit filter should include the virtual host rate 948 // limits. By default, if the route configured rate limits, the virtual host 949 // :ref:`rate_limits <envoy_api_field_route.VirtualHost.rate_limits>` are not applied to the 950 // request. 951 google.protobuf.BoolValue include_vh_rate_limits = 14; 952 953 // Specifies a list of hash policies to use for ring hash load balancing. Each 954 // hash policy is evaluated individually and the combined result is used to 955 // route the request. The method of combination is deterministic such that 956 // identical lists of hash policies will produce the same hash. Since a hash 957 // policy examines specific parts of a request, it can fail to produce a hash 958 // (i.e. if the hashed header is not present). If (and only if) all configured 959 // hash policies fail to generate a hash, no hash will be produced for 960 // the route. In this case, the behavior is the same as if no hash policies 961 // were specified (i.e. the ring hash load balancer will choose a random 962 // backend). If a hash policy has the "terminal" attribute set to true, and 963 // there is already a hash generated, the hash is returned immediately, 964 // ignoring the rest of the hash policy list. 965 repeated HashPolicy hash_policy = 15; 966 967 // Indicates that the route has a CORS policy. 968 CorsPolicy cors = 17; 969 970 // If present, and the request is a gRPC request, use the 971 // `grpc-timeout header <https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_, 972 // or its default value (infinity) instead of 973 // :ref:`timeout <envoy_api_field_route.RouteAction.timeout>`, but limit the applied timeout 974 // to the maximum value specified here. If configured as 0, the maximum allowed timeout for 975 // gRPC requests is infinity. If not configured at all, the `grpc-timeout` header is not used 976 // and gRPC requests time out like any other requests using 977 // :ref:`timeout <envoy_api_field_route.RouteAction.timeout>` or its default. 978 // This can be used to prevent unexpected upstream request timeouts due to potentially long 979 // time gaps between gRPC request and response in gRPC streaming mode. 980 // 981 // .. note:: 982 // 983 // If a timeout is specified using :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`, it takes 984 // precedence over `grpc-timeout header <https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_, when 985 // both are present. See also 986 // :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`, 987 // :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the 988 // :ref:`retry overview <arch_overview_http_routing_retry>`. 989 google.protobuf.Duration max_grpc_timeout = 23; 990 991 // If present, Envoy will adjust the timeout provided by the `grpc-timeout` header by subtracting 992 // the provided duration from the header. This is useful in allowing Envoy to set its global 993 // timeout to be less than that of the deadline imposed by the calling client, which makes it more 994 // likely that Envoy will handle the timeout instead of having the call canceled by the client. 995 // The offset will only be applied if the provided grpc_timeout is greater than the offset. This 996 // ensures that the offset will only ever decrease the timeout and never set it to 0 (meaning 997 // infinity). 998 google.protobuf.Duration grpc_timeout_offset = 28; 999 1000 repeated UpgradeConfig upgrade_configs = 25; 1001 1002 InternalRedirectAction internal_redirect_action = 26; 1003 1004 // An internal redirect is handled, iff the number of previous internal redirects that a 1005 // downstream request has encountered is lower than this value, and 1006 // :ref:`internal_redirect_action <envoy_api_field_route.RouteAction.internal_redirect_action>` 1007 // is set to :ref:`HANDLE_INTERNAL_REDIRECT 1008 // <envoy_api_enum_value_route.RouteAction.InternalRedirectAction.HANDLE_INTERNAL_REDIRECT>` 1009 // In the case where a downstream request is bounced among multiple routes by internal redirect, 1010 // the first route that hits this threshold, or has 1011 // :ref:`internal_redirect_action <envoy_api_field_route.RouteAction.internal_redirect_action>` 1012 // set to 1013 // :ref:`PASS_THROUGH_INTERNAL_REDIRECT 1014 // <envoy_api_enum_value_route.RouteAction.InternalRedirectAction.PASS_THROUGH_INTERNAL_REDIRECT>` 1015 // will pass the redirect back to downstream. 1016 // 1017 // If not specified, at most one redirect will be followed. 1018 google.protobuf.UInt32Value max_internal_redirects = 31; 1019 1020 // Indicates that the route has a hedge policy. Note that if this is set, 1021 // it'll take precedence over the virtual host level hedge policy entirely 1022 // (e.g.: policies are not merged, most internal one becomes the enforced policy). 1023 HedgePolicy hedge_policy = 27; 1024} 1025 1026// HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`. 1027// [#next-free-field: 11] 1028message RetryPolicy { 1029 message RetryPriority { 1030 string name = 1 [(validate.rules).string = {min_bytes: 1}]; 1031 1032 oneof config_type { 1033 google.protobuf.Struct config = 2 [deprecated = true]; 1034 1035 google.protobuf.Any typed_config = 3; 1036 } 1037 } 1038 1039 message RetryHostPredicate { 1040 string name = 1 [(validate.rules).string = {min_bytes: 1}]; 1041 1042 oneof config_type { 1043 google.protobuf.Struct config = 2 [deprecated = true]; 1044 1045 google.protobuf.Any typed_config = 3; 1046 } 1047 } 1048 1049 message RetryBackOff { 1050 // Specifies the base interval between retries. This parameter is required and must be greater 1051 // than zero. Values less than 1 ms are rounded up to 1 ms. 1052 // See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion of Envoy's 1053 // back-off algorithm. 1054 google.protobuf.Duration base_interval = 1 [(validate.rules).duration = { 1055 required: true 1056 gt {} 1057 }]; 1058 1059 // Specifies the maximum interval between retries. This parameter is optional, but must be 1060 // greater than or equal to the `base_interval` if set. The default is 10 times the 1061 // `base_interval`. See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion 1062 // of Envoy's back-off algorithm. 1063 google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {}}]; 1064 } 1065 1066 // Specifies the conditions under which retry takes place. These are the same 1067 // conditions documented for :ref:`config_http_filters_router_x-envoy-retry-on` and 1068 // :ref:`config_http_filters_router_x-envoy-retry-grpc-on`. 1069 string retry_on = 1; 1070 1071 // Specifies the allowed number of retries. This parameter is optional and 1072 // defaults to 1. These are the same conditions documented for 1073 // :ref:`config_http_filters_router_x-envoy-max-retries`. 1074 google.protobuf.UInt32Value num_retries = 2; 1075 1076 // Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The 1077 // same conditions documented for 1078 // :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply. 1079 // 1080 // .. note:: 1081 // 1082 // If left unspecified, Envoy will use the global 1083 // :ref:`route timeout <envoy_api_field_route.RouteAction.timeout>` for the request. 1084 // Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based 1085 // retry policy, a request that times out will not be retried as the total timeout budget 1086 // would have been exhausted. 1087 google.protobuf.Duration per_try_timeout = 3; 1088 1089 // Specifies an implementation of a RetryPriority which is used to determine the 1090 // distribution of load across priorities used for retries. Refer to 1091 // :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details. 1092 RetryPriority retry_priority = 4; 1093 1094 // Specifies a collection of RetryHostPredicates that will be consulted when selecting a host 1095 // for retries. If any of the predicates reject the host, host selection will be reattempted. 1096 // Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more 1097 // details. 1098 repeated RetryHostPredicate retry_host_predicate = 5; 1099 1100 // The maximum number of times host selection will be reattempted before giving up, at which 1101 // point the host that was last selected will be routed to. If unspecified, this will default to 1102 // retrying once. 1103 int64 host_selection_retry_max_attempts = 6; 1104 1105 // HTTP status codes that should trigger a retry in addition to those specified by retry_on. 1106 repeated uint32 retriable_status_codes = 7; 1107 1108 // Specifies parameters that control retry back off. This parameter is optional, in which case the 1109 // default base interval is 25 milliseconds or, if set, the current value of the 1110 // `upstream.base_retry_backoff_ms` runtime parameter. The default maximum interval is 10 times 1111 // the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries` 1112 // describes Envoy's back-off algorithm. 1113 RetryBackOff retry_back_off = 8; 1114 1115 // HTTP response headers that trigger a retry if present in the response. A retry will be 1116 // triggered if any of the header matches match the upstream response headers. 1117 // The field is only consulted if 'retriable-headers' retry policy is active. 1118 repeated HeaderMatcher retriable_headers = 9; 1119 1120 // HTTP headers which must be present in the request for retries to be attempted. 1121 repeated HeaderMatcher retriable_request_headers = 10; 1122} 1123 1124// HTTP request hedging :ref:`architecture overview <arch_overview_http_routing_hedging>`. 1125message HedgePolicy { 1126 // Specifies the number of initial requests that should be sent upstream. 1127 // Must be at least 1. 1128 // Defaults to 1. 1129 // [#not-implemented-hide:] 1130 google.protobuf.UInt32Value initial_requests = 1 [(validate.rules).uint32 = {gte: 1}]; 1131 1132 // Specifies a probability that an additional upstream request should be sent 1133 // on top of what is specified by initial_requests. 1134 // Defaults to 0. 1135 // [#not-implemented-hide:] 1136 type.FractionalPercent additional_request_chance = 2; 1137 1138 // Indicates that a hedged request should be sent when the per-try timeout is hit. 1139 // This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight. 1140 // The first request to complete successfully will be the one returned to the caller. 1141 // 1142 // * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client. 1143 // * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client 1144 // if there are no more retries left. 1145 // * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress. 1146 // 1147 // Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_api_msg_route.RetryPolicy>` that retries at least 1148 // one error code and specifies a maximum number of retries. 1149 // 1150 // Defaults to false. 1151 bool hedge_on_per_try_timeout = 3; 1152} 1153 1154// [#next-free-field: 9] 1155message RedirectAction { 1156 enum RedirectResponseCode { 1157 // Moved Permanently HTTP Status Code - 301. 1158 MOVED_PERMANENTLY = 0; 1159 1160 // Found HTTP Status Code - 302. 1161 FOUND = 1; 1162 1163 // See Other HTTP Status Code - 303. 1164 SEE_OTHER = 2; 1165 1166 // Temporary Redirect HTTP Status Code - 307. 1167 TEMPORARY_REDIRECT = 3; 1168 1169 // Permanent Redirect HTTP Status Code - 308. 1170 PERMANENT_REDIRECT = 4; 1171 } 1172 1173 // When the scheme redirection take place, the following rules apply: 1174 // 1. If the source URI scheme is `http` and the port is explicitly 1175 // set to `:80`, the port will be removed after the redirection 1176 // 2. If the source URI scheme is `https` and the port is explicitly 1177 // set to `:443`, the port will be removed after the redirection 1178 oneof scheme_rewrite_specifier { 1179 // The scheme portion of the URL will be swapped with "https". 1180 bool https_redirect = 4; 1181 1182 // The scheme portion of the URL will be swapped with this value. 1183 string scheme_redirect = 7; 1184 } 1185 1186 // The host portion of the URL will be swapped with this value. 1187 string host_redirect = 1 1188 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; 1189 1190 // The port value of the URL will be swapped with this value. 1191 uint32 port_redirect = 8; 1192 1193 oneof path_rewrite_specifier { 1194 // The path portion of the URL will be swapped with this value. 1195 // Please note that query string in path_redirect will override the 1196 // request's query string and will not be stripped. 1197 // 1198 // For example, let's say we have the following routes: 1199 // 1200 // - match: { path: "/old-path-1" } 1201 // redirect: { path_redirect: "/new-path-1" } 1202 // - match: { path: "/old-path-2" } 1203 // redirect: { path_redirect: "/new-path-2", strip-query: "true" } 1204 // - match: { path: "/old-path-3" } 1205 // redirect: { path_redirect: "/new-path-3?foo=1", strip_query: "true" } 1206 // 1207 // 1. if request uri is "/old-path-1?bar=1", users will be redirected to "/new-path-1?bar=1" 1208 // 2. if request uri is "/old-path-2?bar=1", users will be redirected to "/new-path-2" 1209 // 3. if request uri is "/old-path-3?bar=1", users will be redirected to "/new-path-3?foo=1" 1210 string path_redirect = 2 1211 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; 1212 1213 // Indicates that during redirection, the matched prefix (or path) 1214 // should be swapped with this value. This option allows redirect URLs be dynamically created 1215 // based on the request. 1216 // 1217 // .. attention:: 1218 // 1219 // Pay attention to the use of trailing slashes as mentioned in 1220 // :ref:`RouteAction's prefix_rewrite <envoy_api_field_route.RouteAction.prefix_rewrite>`. 1221 string prefix_rewrite = 5 1222 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}]; 1223 } 1224 1225 // The HTTP status code to use in the redirect response. The default response 1226 // code is MOVED_PERMANENTLY (301). 1227 RedirectResponseCode response_code = 3 [(validate.rules).enum = {defined_only: true}]; 1228 1229 // Indicates that during redirection, the query portion of the URL will 1230 // be removed. Default value is false. 1231 bool strip_query = 6; 1232} 1233 1234message DirectResponseAction { 1235 // Specifies the HTTP response status to be returned. 1236 uint32 status = 1 [(validate.rules).uint32 = {lt: 600 gte: 100}]; 1237 1238 // Specifies the content of the response body. If this setting is omitted, 1239 // no body is included in the generated response. 1240 // 1241 // .. note:: 1242 // 1243 // Headers can be specified using *response_headers_to_add* in the enclosing 1244 // :ref:`envoy_api_msg_route.Route`, :ref:`envoy_api_msg_RouteConfiguration` or 1245 // :ref:`envoy_api_msg_route.VirtualHost`. 1246 core.DataSource body = 2; 1247} 1248 1249message Decorator { 1250 // The operation name associated with the request matched to this route. If tracing is 1251 // enabled, this information will be used as the span name reported for this request. 1252 // 1253 // .. note:: 1254 // 1255 // For ingress (inbound) requests, or egress (outbound) responses, this value may be overridden 1256 // by the :ref:`x-envoy-decorator-operation 1257 // <config_http_filters_router_x-envoy-decorator-operation>` header. 1258 string operation = 1 [(validate.rules).string = {min_bytes: 1}]; 1259 1260 // Whether the decorated details should be propagated to the other party. The default is true. 1261 google.protobuf.BoolValue propagate = 2; 1262} 1263 1264message Tracing { 1265 // Target percentage of requests managed by this HTTP connection manager that will be force 1266 // traced if the :ref:`x-client-trace-id <config_http_conn_man_headers_x-client-trace-id>` 1267 // header is set. This field is a direct analog for the runtime variable 1268 // 'tracing.client_enabled' in the :ref:`HTTP Connection Manager 1269 // <config_http_conn_man_runtime>`. 1270 // Default: 100% 1271 type.FractionalPercent client_sampling = 1; 1272 1273 // Target percentage of requests managed by this HTTP connection manager that will be randomly 1274 // selected for trace generation, if not requested by the client or not forced. This field is 1275 // a direct analog for the runtime variable 'tracing.random_sampling' in the 1276 // :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`. 1277 // Default: 100% 1278 type.FractionalPercent random_sampling = 2; 1279 1280 // Target percentage of requests managed by this HTTP connection manager that will be traced 1281 // after all other sampling checks have been applied (client-directed, force tracing, random 1282 // sampling). This field functions as an upper limit on the total configured sampling rate. For 1283 // instance, setting client_sampling to 100% but overall_sampling to 1% will result in only 1% 1284 // of client requests with the appropriate headers to be force traced. This field is a direct 1285 // analog for the runtime variable 'tracing.global_enabled' in the 1286 // :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`. 1287 // Default: 100% 1288 type.FractionalPercent overall_sampling = 3; 1289 1290 // A list of custom tags with unique tag name to create tags for the active span. 1291 // It will take effect after merging with the :ref:`corresponding configuration 1292 // <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.custom_tags>` 1293 // configured in the HTTP connection manager. If two tags with the same name are configured 1294 // each in the HTTP connection manager and the route level, the one configured here takes 1295 // priority. 1296 repeated type.tracing.v2.CustomTag custom_tags = 4; 1297} 1298 1299// A virtual cluster is a way of specifying a regex matching rule against 1300// certain important endpoints such that statistics are generated explicitly for 1301// the matched requests. The reason this is useful is that when doing 1302// prefix/path matching Envoy does not always know what the application 1303// considers to be an endpoint. Thus, it’s impossible for Envoy to generically 1304// emit per endpoint statistics. However, often systems have highly critical 1305// endpoints that they wish to get “perfect” statistics on. Virtual cluster 1306// statistics are perfect in the sense that they are emitted on the downstream 1307// side such that they include network level failures. 1308// 1309// Documentation for :ref:`virtual cluster statistics <config_http_filters_router_vcluster_stats>`. 1310// 1311// .. note:: 1312// 1313// Virtual clusters are a useful tool, but we do not recommend setting up a virtual cluster for 1314// every application endpoint. This is both not easily maintainable and as well the matching and 1315// statistics output are not free. 1316message VirtualCluster { 1317 // Specifies a regex pattern to use for matching requests. The entire path of the request 1318 // must match the regex. The regex grammar used is defined `here 1319 // <https://en.cppreference.com/w/cpp/regex/ecmascript>`_. 1320 // 1321 // Examples: 1322 // 1323 // * The regex ``/rides/\d+`` matches the path */rides/0* 1324 // * The regex ``/rides/\d+`` matches the path */rides/123* 1325 // * The regex ``/rides/\d+`` does not match the path */rides/123/456* 1326 // 1327 // .. attention:: 1328 // This field has been deprecated in favor of `headers` as it is not safe for use with 1329 // untrusted input in all cases. 1330 string pattern = 1 [ 1331 deprecated = true, 1332 (validate.rules).string = {max_bytes: 1024}, 1333 (envoy.annotations.disallowed_by_default) = true 1334 ]; 1335 1336 // Specifies a list of header matchers to use for matching requests. Each specified header must 1337 // match. The pseudo-headers `:path` and `:method` can be used to match the request path and 1338 // method, respectively. 1339 repeated HeaderMatcher headers = 4; 1340 1341 // Specifies the name of the virtual cluster. The virtual cluster name as well 1342 // as the virtual host name are used when emitting statistics. The statistics are emitted by the 1343 // router filter and are documented :ref:`here <config_http_filters_router_stats>`. 1344 string name = 2 [(validate.rules).string = {min_bytes: 1}]; 1345 1346 // Optionally specifies the HTTP method to match on. For example GET, PUT, 1347 // etc. 1348 // 1349 // .. attention:: 1350 // This field has been deprecated in favor of `headers`. 1351 core.RequestMethod method = 3 1352 [deprecated = true, (envoy.annotations.disallowed_by_default) = true]; 1353} 1354 1355// Global rate limiting :ref:`architecture overview <arch_overview_global_rate_limit>`. 1356message RateLimit { 1357 // [#next-free-field: 7] 1358 message Action { 1359 // The following descriptor entry is appended to the descriptor: 1360 // 1361 // .. code-block:: cpp 1362 // 1363 // ("source_cluster", "<local service cluster>") 1364 // 1365 // <local service cluster> is derived from the :option:`--service-cluster` option. 1366 message SourceCluster { 1367 } 1368 1369 // The following descriptor entry is appended to the descriptor: 1370 // 1371 // .. code-block:: cpp 1372 // 1373 // ("destination_cluster", "<routed target cluster>") 1374 // 1375 // Once a request matches against a route table rule, a routed cluster is determined by one of 1376 // the following :ref:`route table configuration <envoy_api_msg_RouteConfiguration>` 1377 // settings: 1378 // 1379 // * :ref:`cluster <envoy_api_field_route.RouteAction.cluster>` indicates the upstream cluster 1380 // to route to. 1381 // * :ref:`weighted_clusters <envoy_api_field_route.RouteAction.weighted_clusters>` 1382 // chooses a cluster randomly from a set of clusters with attributed weight. 1383 // * :ref:`cluster_header <envoy_api_field_route.RouteAction.cluster_header>` indicates which 1384 // header in the request contains the target cluster. 1385 message DestinationCluster { 1386 } 1387 1388 // The following descriptor entry is appended when a header contains a key that matches the 1389 // *header_name*: 1390 // 1391 // .. code-block:: cpp 1392 // 1393 // ("<descriptor_key>", "<header_value_queried_from_header>") 1394 message RequestHeaders { 1395 // The header name to be queried from the request headers. The header’s 1396 // value is used to populate the value of the descriptor entry for the 1397 // descriptor_key. 1398 string header_name = 1 [ 1399 (validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false} 1400 ]; 1401 1402 // The key to use in the descriptor entry. 1403 string descriptor_key = 2 [(validate.rules).string = {min_bytes: 1}]; 1404 } 1405 1406 // The following descriptor entry is appended to the descriptor and is populated using the 1407 // trusted address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`: 1408 // 1409 // .. code-block:: cpp 1410 // 1411 // ("remote_address", "<trusted address from x-forwarded-for>") 1412 message RemoteAddress { 1413 } 1414 1415 // The following descriptor entry is appended to the descriptor: 1416 // 1417 // .. code-block:: cpp 1418 // 1419 // ("generic_key", "<descriptor_value>") 1420 message GenericKey { 1421 // The value to use in the descriptor entry. 1422 string descriptor_value = 1 [(validate.rules).string = {min_bytes: 1}]; 1423 } 1424 1425 // The following descriptor entry is appended to the descriptor: 1426 // 1427 // .. code-block:: cpp 1428 // 1429 // ("header_match", "<descriptor_value>") 1430 message HeaderValueMatch { 1431 // The value to use in the descriptor entry. 1432 string descriptor_value = 1 [(validate.rules).string = {min_bytes: 1}]; 1433 1434 // If set to true, the action will append a descriptor entry when the 1435 // request matches the headers. If set to false, the action will append a 1436 // descriptor entry when the request does not match the headers. The 1437 // default value is true. 1438 google.protobuf.BoolValue expect_match = 2; 1439 1440 // Specifies a set of headers that the rate limit action should match 1441 // on. The action will check the request’s headers against all the 1442 // specified headers in the config. A match will happen if all the 1443 // headers in the config are present in the request with the same values 1444 // (or based on presence if the value field is not in the config). 1445 repeated HeaderMatcher headers = 3 [(validate.rules).repeated = {min_items: 1}]; 1446 } 1447 1448 oneof action_specifier { 1449 option (validate.required) = true; 1450 1451 // Rate limit on source cluster. 1452 SourceCluster source_cluster = 1; 1453 1454 // Rate limit on destination cluster. 1455 DestinationCluster destination_cluster = 2; 1456 1457 // Rate limit on request headers. 1458 RequestHeaders request_headers = 3; 1459 1460 // Rate limit on remote address. 1461 RemoteAddress remote_address = 4; 1462 1463 // Rate limit on a generic key. 1464 GenericKey generic_key = 5; 1465 1466 // Rate limit on the existence of request headers. 1467 HeaderValueMatch header_value_match = 6; 1468 } 1469 } 1470 1471 // Refers to the stage set in the filter. The rate limit configuration only 1472 // applies to filters with the same stage number. The default stage number is 1473 // 0. 1474 // 1475 // .. note:: 1476 // 1477 // The filter supports a range of 0 - 10 inclusively for stage numbers. 1478 google.protobuf.UInt32Value stage = 1 [(validate.rules).uint32 = {lte: 10}]; 1479 1480 // The key to be set in runtime to disable this rate limit configuration. 1481 string disable_key = 2; 1482 1483 // A list of actions that are to be applied for this rate limit configuration. 1484 // Order matters as the actions are processed sequentially and the descriptor 1485 // is composed by appending descriptor entries in that sequence. If an action 1486 // cannot append a descriptor entry, no descriptor is generated for the 1487 // configuration. See :ref:`composing actions 1488 // <config_http_filters_rate_limit_composing_actions>` for additional documentation. 1489 repeated Action actions = 3 [(validate.rules).repeated = {min_items: 1}]; 1490} 1491 1492// .. attention:: 1493// 1494// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host* 1495// header. Thus, if attempting to match on *Host*, match on *:authority* instead. 1496// 1497// .. attention:: 1498// 1499// To route on HTTP method, use the special HTTP/2 *:method* header. This works for both 1500// HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g., 1501// 1502// .. code-block:: json 1503// 1504// { 1505// "name": ":method", 1506// "exact_match": "POST" 1507// } 1508// 1509// .. attention:: 1510// In the absence of any header match specifier, match will default to :ref:`present_match 1511// <envoy_api_field_route.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name 1512// <envoy_api_field_route.HeaderMatcher.name>` header will match, regardless of the header's 1513// value. 1514// 1515// [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.] 1516// [#next-free-field: 12] 1517message HeaderMatcher { 1518 reserved 2, 3; 1519 1520 // Specifies the name of the header in the request. 1521 string name = 1 1522 [(validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false}]; 1523 1524 // Specifies how the header match will be performed to route the request. 1525 oneof header_match_specifier { 1526 // If specified, header match will be performed based on the value of the header. 1527 string exact_match = 4; 1528 1529 // If specified, this regex string is a regular expression rule which implies the entire request 1530 // header value must match the regex. The rule will not match if only a subsequence of the 1531 // request header value matches the regex. The regex grammar used in the value field is defined 1532 // `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_. 1533 // 1534 // Examples: 1535 // 1536 // * The regex ``\d{3}`` matches the value *123* 1537 // * The regex ``\d{3}`` does not match the value *1234* 1538 // * The regex ``\d{3}`` does not match the value *123.456* 1539 // 1540 // .. attention:: 1541 // This field has been deprecated in favor of `safe_regex_match` as it is not safe for use 1542 // with untrusted input in all cases. 1543 string regex_match = 5 [ 1544 deprecated = true, 1545 (validate.rules).string = {max_bytes: 1024}, 1546 (envoy.annotations.disallowed_by_default) = true 1547 ]; 1548 1549 // If specified, this regex string is a regular expression rule which implies the entire request 1550 // header value must match the regex. The rule will not match if only a subsequence of the 1551 // request header value matches the regex. 1552 type.matcher.RegexMatcher safe_regex_match = 11; 1553 1554 // If specified, header match will be performed based on range. 1555 // The rule will match if the request header value is within this range. 1556 // The entire request header value must represent an integer in base 10 notation: consisting of 1557 // an optional plus or minus sign followed by a sequence of digits. The rule will not match if 1558 // the header value does not represent an integer. Match will fail for empty values, floating 1559 // point numbers or if only a subsequence of the header value is an integer. 1560 // 1561 // Examples: 1562 // 1563 // * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9, 1564 // "-1somestring" 1565 type.Int64Range range_match = 6; 1566 1567 // If specified, header match will be performed based on whether the header is in the 1568 // request. 1569 bool present_match = 7; 1570 1571 // If specified, header match will be performed based on the prefix of the header value. 1572 // Note: empty prefix is not allowed, please use present_match instead. 1573 // 1574 // Examples: 1575 // 1576 // * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*. 1577 string prefix_match = 9 [(validate.rules).string = {min_bytes: 1}]; 1578 1579 // If specified, header match will be performed based on the suffix of the header value. 1580 // Note: empty suffix is not allowed, please use present_match instead. 1581 // 1582 // Examples: 1583 // 1584 // * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*. 1585 string suffix_match = 10 [(validate.rules).string = {min_bytes: 1}]; 1586 } 1587 1588 // If specified, the match result will be inverted before checking. Defaults to false. 1589 // 1590 // Examples: 1591 // 1592 // * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted. 1593 // * The range [-10,0) will match the value -1, so it will not match when inverted. 1594 bool invert_match = 8; 1595} 1596 1597// Query parameter matching treats the query string of a request's :path header 1598// as an ampersand-separated list of keys and/or key=value elements. 1599// [#next-free-field: 7] 1600message QueryParameterMatcher { 1601 // Specifies the name of a key that must be present in the requested 1602 // *path*'s query string. 1603 string name = 1 [(validate.rules).string = {min_bytes: 1 max_bytes: 1024}]; 1604 1605 // Specifies the value of the key. If the value is absent, a request 1606 // that contains the key in its query string will match, whether the 1607 // key appears with a value (e.g., "?debug=true") or not (e.g., "?debug") 1608 // 1609 // ..attention:: 1610 // This field is deprecated. Use an `exact` match inside the `string_match` field. 1611 string value = 3 [deprecated = true, (envoy.annotations.disallowed_by_default) = true]; 1612 1613 // Specifies whether the query parameter value is a regular expression. 1614 // Defaults to false. The entire query parameter value (i.e., the part to 1615 // the right of the equals sign in "key=value") must match the regex. 1616 // E.g., the regex ``\d+$`` will match *123* but not *a123* or *123a*. 1617 // 1618 // ..attention:: 1619 // This field is deprecated. Use a `safe_regex` match inside the `string_match` field. 1620 google.protobuf.BoolValue regex = 4 1621 [deprecated = true, (envoy.annotations.disallowed_by_default) = true]; 1622 1623 oneof query_parameter_match_specifier { 1624 // Specifies whether a query parameter value should match against a string. 1625 type.matcher.StringMatcher string_match = 5 [(validate.rules).message = {required: true}]; 1626 1627 // Specifies whether a query parameter should be present. 1628 bool present_match = 6; 1629 } 1630} 1631