xds_api/generated/envoy.config.route.v3.rs
1// This file is @generated by prost-build.
2/// The top level element in the routing configuration is a virtual host. Each virtual host has
3/// a logical name as well as a set of domains that get routed to it based on the incoming request's
4/// host header. This allows a single listener to service multiple top level domain path trees. Once
5/// a virtual host is selected based on the domain, the routes are processed in order to see which
6/// upstream cluster to route to or whether to perform a redirect.
7/// \[#next-free-field: 25\]
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct VirtualHost {
10 /// The logical name of the virtual host. This is used when emitting certain
11 /// statistics but is not relevant for routing.
12 #[prost(string, tag = "1")]
13 pub name: ::prost::alloc::string::String,
14 /// A list of domains (host/authority header) that will be matched to this
15 /// virtual host. Wildcard hosts are supported in the suffix or prefix form.
16 ///
17 /// Domain search order:
18 /// 1. Exact domain names: ``www.foo.com``.
19 /// 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``.
20 /// 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``.
21 /// 4. Special wildcard ``*`` matching any domain.
22 ///
23 /// .. note::
24 ///
25 /// The wildcard will not match the empty string.
26 /// e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``.
27 /// The longest wildcards match first.
28 /// Only a single virtual host in the entire route configuration can match on ``*``. A domain
29 /// must be unique across all virtual hosts or the config will fail to load.
30 ///
31 /// Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE.
32 #[prost(string, repeated, tag = "2")]
33 pub domains: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
34 /// The list of routes that will be matched, in order, for incoming requests.
35 /// The first route that matches will be used.
36 /// Only one of this and ``matcher`` can be specified.
37 #[prost(message, repeated, tag = "3")]
38 pub routes: ::prost::alloc::vec::Vec<Route>,
39 /// \[#next-major-version: This should be included in a oneof with routes wrapped in a message.\]
40 /// The match tree to use when resolving route actions for incoming requests. Only one of this and ``routes``
41 /// can be specified.
42 #[prost(message, optional, tag = "21")]
43 pub matcher: ::core::option::Option<
44 super::super::super::super::xds::r#type::matcher::v3::Matcher,
45 >,
46 /// Specifies the type of TLS enforcement the virtual host expects. If this option is not
47 /// specified, there is no TLS requirement for the virtual host.
48 #[prost(enumeration = "virtual_host::TlsRequirementType", tag = "4")]
49 pub require_tls: i32,
50 /// A list of virtual clusters defined for this virtual host. Virtual clusters
51 /// are used for additional statistics gathering.
52 #[prost(message, repeated, tag = "5")]
53 pub virtual_clusters: ::prost::alloc::vec::Vec<VirtualCluster>,
54 /// Specifies a set of rate limit configurations that will be applied to the
55 /// virtual host.
56 #[prost(message, repeated, tag = "6")]
57 pub rate_limits: ::prost::alloc::vec::Vec<RateLimit>,
58 /// Specifies a list of HTTP headers that should be added to each request
59 /// handled by this virtual host. Headers specified at this level are applied
60 /// after headers from enclosed :ref:`envoy_v3_api_msg_config.route.v3.Route` and before headers from the
61 /// enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
62 /// details on header value syntax, see the documentation on :ref:`custom request headers
63 /// <config_http_conn_man_headers_custom_request_headers>`.
64 #[prost(message, repeated, tag = "7")]
65 pub request_headers_to_add: ::prost::alloc::vec::Vec<
66 super::super::core::v3::HeaderValueOption,
67 >,
68 /// Specifies a list of HTTP headers that should be removed from each request
69 /// handled by this virtual host.
70 #[prost(string, repeated, tag = "13")]
71 pub request_headers_to_remove: ::prost::alloc::vec::Vec<
72 ::prost::alloc::string::String,
73 >,
74 /// Specifies a list of HTTP headers that should be added to each response
75 /// handled by this virtual host. Headers specified at this level are applied
76 /// after headers from enclosed :ref:`envoy_v3_api_msg_config.route.v3.Route` and before headers from the
77 /// enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
78 /// details on header value syntax, see the documentation on :ref:`custom request headers
79 /// <config_http_conn_man_headers_custom_request_headers>`.
80 #[prost(message, repeated, tag = "10")]
81 pub response_headers_to_add: ::prost::alloc::vec::Vec<
82 super::super::core::v3::HeaderValueOption,
83 >,
84 /// Specifies a list of HTTP headers that should be removed from each response
85 /// handled by this virtual host.
86 #[prost(string, repeated, tag = "11")]
87 pub response_headers_to_remove: ::prost::alloc::vec::Vec<
88 ::prost::alloc::string::String,
89 >,
90 /// Indicates that the virtual host has a CORS policy. This field is ignored if related cors policy is
91 /// found in the
92 /// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`.
93 ///
94 /// .. attention::
95 ///
96 /// This option has been deprecated. Please use
97 /// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`
98 /// to configure the CORS HTTP filter.
99 #[deprecated]
100 #[prost(message, optional, tag = "8")]
101 pub cors: ::core::option::Option<CorsPolicy>,
102 /// This field can be used to provide virtual host level per filter config. The key should match the
103 /// :ref:`filter config name
104 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
105 /// See :ref:`Http filter route specific config <arch_overview_http_filters_per_filter_config>`
106 /// for details.
107 /// [#comment: An entry's value may be wrapped in a
108 /// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
109 /// message to specify additional options.]
110 #[prost(map = "string, message", tag = "15")]
111 pub typed_per_filter_config: ::std::collections::HashMap<
112 ::prost::alloc::string::String,
113 super::super::super::super::google::protobuf::Any,
114 >,
115 /// Decides whether the :ref:`x-envoy-attempt-count
116 /// <config_http_filters_router_x-envoy-attempt-count>` header should be included
117 /// in the upstream request. Setting this option will cause it to override any existing header
118 /// value, so in the case of two Envoys on the request path with this option enabled, the upstream
119 /// will see the attempt count as perceived by the second Envoy. Defaults to false.
120 /// This header is unaffected by the
121 /// :ref:`suppress_envoy_headers
122 /// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
123 ///
124 /// \[#next-major-version: rename to include_attempt_count_in_request.\]
125 #[prost(bool, tag = "14")]
126 pub include_request_attempt_count: bool,
127 /// Decides whether the :ref:`x-envoy-attempt-count
128 /// <config_http_filters_router_x-envoy-attempt-count>` header should be included
129 /// in the downstream response. Setting this option will cause the router to override any existing header
130 /// value, so in the case of two Envoys on the request path with this option enabled, the downstream
131 /// will see the attempt count as perceived by the Envoy closest upstream from itself. Defaults to false.
132 /// This header is unaffected by the
133 /// :ref:`suppress_envoy_headers
134 /// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
135 #[prost(bool, tag = "19")]
136 pub include_attempt_count_in_response: bool,
137 /// Indicates the retry policy for all routes in this virtual host. Note that setting a
138 /// route level entry will take precedence over this config and it'll be treated
139 /// independently (e.g.: values are not inherited).
140 #[prost(message, optional, tag = "16")]
141 pub retry_policy: ::core::option::Option<RetryPolicy>,
142 /// \[#not-implemented-hide:\]
143 /// Specifies the configuration for retry policy extension. Note that setting a route level entry
144 /// will take precedence over this config and it'll be treated independently (e.g.: values are not
145 /// inherited). :ref:`Retry policy <envoy_v3_api_field_config.route.v3.VirtualHost.retry_policy>` should not be
146 /// set if this field is used.
147 #[prost(message, optional, tag = "20")]
148 pub retry_policy_typed_config: ::core::option::Option<
149 super::super::super::super::google::protobuf::Any,
150 >,
151 /// Indicates the hedge policy for all routes in this virtual host. Note that setting a
152 /// route level entry will take precedence over this config and it'll be treated
153 /// independently (e.g.: values are not inherited).
154 #[prost(message, optional, tag = "17")]
155 pub hedge_policy: ::core::option::Option<HedgePolicy>,
156 /// Decides whether to include the :ref:`x-envoy-is-timeout-retry <config_http_filters_router_x-envoy-is-timeout-retry>`
157 /// request header in retries initiated by per try timeouts.
158 #[prost(bool, tag = "23")]
159 pub include_is_timeout_retry_header: bool,
160 /// The maximum bytes which will be buffered for retries and shadowing.
161 /// If set and a route-specific limit is not set, the bytes actually buffered will be the minimum
162 /// value of this and the listener per_connection_buffer_limit_bytes.
163 #[prost(message, optional, tag = "18")]
164 pub per_request_buffer_limit_bytes: ::core::option::Option<
165 super::super::super::super::google::protobuf::UInt32Value,
166 >,
167 /// Specify a set of default request mirroring policies for every route under this virtual host.
168 /// It takes precedence over the route config mirror policy entirely.
169 /// That is, policies are not merged, the most specific non-empty one becomes the mirror policies.
170 #[prost(message, repeated, tag = "22")]
171 pub request_mirror_policies: ::prost::alloc::vec::Vec<
172 route_action::RequestMirrorPolicy,
173 >,
174 /// The metadata field can be used to provide additional information
175 /// about the virtual host. It can be used for configuration, stats, and logging.
176 /// The metadata should go under the filter namespace that will need it.
177 /// For instance, if the metadata is intended for the Router filter,
178 /// the filter name should be specified as ``envoy.filters.http.router``.
179 #[prost(message, optional, tag = "24")]
180 pub metadata: ::core::option::Option<super::super::core::v3::Metadata>,
181}
182/// Nested message and enum types in `VirtualHost`.
183pub mod virtual_host {
184 #[derive(
185 Clone,
186 Copy,
187 Debug,
188 PartialEq,
189 Eq,
190 Hash,
191 PartialOrd,
192 Ord,
193 ::prost::Enumeration
194 )]
195 #[repr(i32)]
196 pub enum TlsRequirementType {
197 /// No TLS requirement for the virtual host.
198 None = 0,
199 /// External requests must use TLS. If a request is external and it is not
200 /// using TLS, a 301 redirect will be sent telling the client to use HTTPS.
201 ExternalOnly = 1,
202 /// All requests must use TLS. If a request is not using TLS, a 301 redirect
203 /// will be sent telling the client to use HTTPS.
204 All = 2,
205 }
206 impl TlsRequirementType {
207 /// String value of the enum field names used in the ProtoBuf definition.
208 ///
209 /// The values are not transformed in any way and thus are considered stable
210 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
211 pub fn as_str_name(&self) -> &'static str {
212 match self {
213 Self::None => "NONE",
214 Self::ExternalOnly => "EXTERNAL_ONLY",
215 Self::All => "ALL",
216 }
217 }
218 /// Creates an enum from field names used in the ProtoBuf definition.
219 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
220 match value {
221 "NONE" => Some(Self::None),
222 "EXTERNAL_ONLY" => Some(Self::ExternalOnly),
223 "ALL" => Some(Self::All),
224 _ => None,
225 }
226 }
227 }
228}
229impl ::prost::Name for VirtualHost {
230 const NAME: &'static str = "VirtualHost";
231 const PACKAGE: &'static str = "envoy.config.route.v3";
232 fn full_name() -> ::prost::alloc::string::String {
233 "envoy.config.route.v3.VirtualHost".into()
234 }
235 fn type_url() -> ::prost::alloc::string::String {
236 "type.googleapis.com/envoy.config.route.v3.VirtualHost".into()
237 }
238}
239/// A filter-defined action type.
240#[derive(Clone, PartialEq, ::prost::Message)]
241pub struct FilterAction {
242 #[prost(message, optional, tag = "1")]
243 pub action: ::core::option::Option<
244 super::super::super::super::google::protobuf::Any,
245 >,
246}
247impl ::prost::Name for FilterAction {
248 const NAME: &'static str = "FilterAction";
249 const PACKAGE: &'static str = "envoy.config.route.v3";
250 fn full_name() -> ::prost::alloc::string::String {
251 "envoy.config.route.v3.FilterAction".into()
252 }
253 fn type_url() -> ::prost::alloc::string::String {
254 "type.googleapis.com/envoy.config.route.v3.FilterAction".into()
255 }
256}
257/// This can be used in route matcher :ref:`VirtualHost.matcher <envoy_v3_api_field_config.route.v3.VirtualHost.matcher>`.
258/// When the matcher matches, routes will be matched and run.
259#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct RouteList {
261 /// The list of routes that will be matched and run, in order. The first route that matches will be used.
262 #[prost(message, repeated, tag = "1")]
263 pub routes: ::prost::alloc::vec::Vec<Route>,
264}
265impl ::prost::Name for RouteList {
266 const NAME: &'static str = "RouteList";
267 const PACKAGE: &'static str = "envoy.config.route.v3";
268 fn full_name() -> ::prost::alloc::string::String {
269 "envoy.config.route.v3.RouteList".into()
270 }
271 fn type_url() -> ::prost::alloc::string::String {
272 "type.googleapis.com/envoy.config.route.v3.RouteList".into()
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: 20\]
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct Route {
285 /// Name for the route.
286 #[prost(string, tag = "14")]
287 pub name: ::prost::alloc::string::String,
288 /// Route matching parameters.
289 #[prost(message, optional, tag = "1")]
290 pub r#match: ::core::option::Option<RouteMatch>,
291 /// The Metadata field can be used to provide additional information
292 /// about the route. It can be used for configuration, stats, and logging.
293 /// The metadata should go under the filter namespace that will need it.
294 /// For instance, if the metadata is intended for the Router filter,
295 /// the filter name should be specified as ``envoy.filters.http.router``.
296 #[prost(message, optional, tag = "4")]
297 pub metadata: ::core::option::Option<super::super::core::v3::Metadata>,
298 /// Decorator for the matched route.
299 #[prost(message, optional, tag = "5")]
300 pub decorator: ::core::option::Option<Decorator>,
301 /// This field can be used to provide route specific per filter config. The key should match the
302 /// :ref:`filter config name
303 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
304 /// See :ref:`Http filter route specific config <arch_overview_http_filters_per_filter_config>`
305 /// for details.
306 /// [#comment: An entry's value may be wrapped in a
307 /// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
308 /// message to specify additional options.]
309 #[prost(map = "string, message", tag = "13")]
310 pub typed_per_filter_config: ::std::collections::HashMap<
311 ::prost::alloc::string::String,
312 super::super::super::super::google::protobuf::Any,
313 >,
314 /// Specifies a set of headers that will be added to requests matching this
315 /// route. Headers specified at this level are applied before headers from the
316 /// enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
317 /// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
318 /// header value syntax, see the documentation on :ref:`custom request headers
319 /// <config_http_conn_man_headers_custom_request_headers>`.
320 #[prost(message, repeated, tag = "9")]
321 pub request_headers_to_add: ::prost::alloc::vec::Vec<
322 super::super::core::v3::HeaderValueOption,
323 >,
324 /// Specifies a list of HTTP headers that should be removed from each request
325 /// matching this route.
326 #[prost(string, repeated, tag = "12")]
327 pub request_headers_to_remove: ::prost::alloc::vec::Vec<
328 ::prost::alloc::string::String,
329 >,
330 /// Specifies a set of headers that will be added to responses to requests
331 /// matching this route. Headers specified at this level are applied before
332 /// headers from the enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
333 /// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
334 /// details on header value syntax, see the documentation on
335 /// :ref:`custom request headers <config_http_conn_man_headers_custom_request_headers>`.
336 #[prost(message, repeated, tag = "10")]
337 pub response_headers_to_add: ::prost::alloc::vec::Vec<
338 super::super::core::v3::HeaderValueOption,
339 >,
340 /// Specifies a list of HTTP headers that should be removed from each response
341 /// to requests matching this route.
342 #[prost(string, repeated, tag = "11")]
343 pub response_headers_to_remove: ::prost::alloc::vec::Vec<
344 ::prost::alloc::string::String,
345 >,
346 /// Presence of the object defines whether the connection manager's tracing configuration
347 /// is overridden by this route specific instance.
348 #[prost(message, optional, tag = "15")]
349 pub tracing: ::core::option::Option<Tracing>,
350 /// The maximum bytes which will be buffered for retries and shadowing.
351 /// If set, the bytes actually buffered will be the minimum value of this and the
352 /// listener per_connection_buffer_limit_bytes.
353 #[prost(message, optional, tag = "16")]
354 pub per_request_buffer_limit_bytes: ::core::option::Option<
355 super::super::super::super::google::protobuf::UInt32Value,
356 >,
357 /// The human readable prefix to use when emitting statistics for this endpoint.
358 /// The statistics are rooted at vhost.<virtual host name>.route.<stat_prefix>.
359 /// This should be set for highly critical
360 /// endpoints that one wishes to get “per-route” statistics on.
361 /// If not set, endpoint statistics are not generated.
362 ///
363 /// The emitted statistics are the same as those documented for :ref:`virtual clusters <config_http_filters_router_vcluster_stats>`.
364 ///
365 /// .. warning::
366 ///
367 /// We do not recommend setting up a stat prefix for
368 /// every application endpoint. This is both not easily maintainable and
369 /// statistics use a non-trivial amount of memory(approximately 1KiB per route).
370 #[prost(string, tag = "19")]
371 pub stat_prefix: ::prost::alloc::string::String,
372 #[prost(oneof = "route::Action", tags = "2, 3, 7, 17, 18")]
373 pub action: ::core::option::Option<route::Action>,
374}
375/// Nested message and enum types in `Route`.
376pub mod route {
377 #[derive(Clone, PartialEq, ::prost::Oneof)]
378 pub enum Action {
379 /// Route request to some upstream cluster.
380 #[prost(message, tag = "2")]
381 Route(super::RouteAction),
382 /// Return a redirect.
383 #[prost(message, tag = "3")]
384 Redirect(super::RedirectAction),
385 /// Return an arbitrary HTTP response directly, without proxying.
386 #[prost(message, tag = "7")]
387 DirectResponse(super::DirectResponseAction),
388 /// \[#not-implemented-hide:\]
389 /// A filter-defined action (e.g., it could dynamically generate the RouteAction).
390 /// [#comment: TODO(samflattery): Remove cleanup in route_fuzz_test.cc when
391 /// implemented]
392 #[prost(message, tag = "17")]
393 FilterAction(super::FilterAction),
394 /// \[#not-implemented-hide:\]
395 /// An action used when the route will generate a response directly,
396 /// without forwarding to an upstream host. This will be used in non-proxy
397 /// xDS clients like the gRPC server. It could also be used in the future
398 /// in Envoy for a filter that directly generates responses for requests.
399 #[prost(message, tag = "18")]
400 NonForwardingAction(super::NonForwardingAction),
401 }
402}
403impl ::prost::Name for Route {
404 const NAME: &'static str = "Route";
405 const PACKAGE: &'static str = "envoy.config.route.v3";
406 fn full_name() -> ::prost::alloc::string::String {
407 "envoy.config.route.v3.Route".into()
408 }
409 fn type_url() -> ::prost::alloc::string::String {
410 "type.googleapis.com/envoy.config.route.v3.Route".into()
411 }
412}
413/// Compared to the :ref:`cluster <envoy_v3_api_field_config.route.v3.RouteAction.cluster>` field that specifies a
414/// single upstream cluster as the target of a request, the :ref:`weighted_clusters
415/// <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>` option allows for specification of
416/// multiple upstream clusters along with weights that indicate the percentage of
417/// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
418/// weights.
419#[derive(Clone, PartialEq, ::prost::Message)]
420pub struct WeightedCluster {
421 /// Specifies one or more upstream clusters associated with the route.
422 #[prost(message, repeated, tag = "1")]
423 pub clusters: ::prost::alloc::vec::Vec<weighted_cluster::ClusterWeight>,
424 /// Specifies the total weight across all clusters. The sum of all cluster weights must equal this
425 /// value, if this is greater than 0.
426 /// This field is now deprecated, and the client will use the sum of all
427 /// cluster weights. It is up to the management server to supply the correct weights.
428 #[deprecated]
429 #[prost(message, optional, tag = "3")]
430 pub total_weight: ::core::option::Option<
431 super::super::super::super::google::protobuf::UInt32Value,
432 >,
433 /// Specifies the runtime key prefix that should be used to construct the
434 /// runtime keys associated with each cluster. When the ``runtime_key_prefix`` is
435 /// specified, the router will look for weights associated with each upstream
436 /// cluster under the key ``runtime_key_prefix`` + ``.`` + ``cluster\[i\].name`` where
437 /// ``cluster\[i\]`` denotes an entry in the clusters array field. If the runtime
438 /// key for the cluster does not exist, the value specified in the
439 /// configuration file will be used as the default weight. See the :ref:`runtime documentation
440 /// <operations_runtime>` for how key names map to the underlying implementation.
441 #[prost(string, tag = "2")]
442 pub runtime_key_prefix: ::prost::alloc::string::String,
443 #[prost(oneof = "weighted_cluster::RandomValueSpecifier", tags = "4")]
444 pub random_value_specifier: ::core::option::Option<
445 weighted_cluster::RandomValueSpecifier,
446 >,
447}
448/// Nested message and enum types in `WeightedCluster`.
449pub mod weighted_cluster {
450 /// \[#next-free-field: 13\]
451 #[derive(Clone, PartialEq, ::prost::Message)]
452 pub struct ClusterWeight {
453 /// Only one of ``name`` and ``cluster_header`` may be specified.
454 /// \[#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}\]
455 /// Name of the upstream cluster. The cluster must exist in the
456 /// :ref:`cluster manager configuration <config_cluster_manager>`.
457 #[prost(string, tag = "1")]
458 pub name: ::prost::alloc::string::String,
459 /// Only one of ``name`` and ``cluster_header`` may be specified.
460 /// \[#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1 }\]
461 /// Envoy will determine the cluster to route to by reading the value of the
462 /// HTTP header named by cluster_header from the request headers. If the
463 /// header is not found or the referenced cluster does not exist, Envoy will
464 /// return a 404 response.
465 ///
466 /// .. attention::
467 ///
468 /// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
469 /// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
470 ///
471 /// .. note::
472 ///
473 /// If the header appears multiple times only the first value is used.
474 #[prost(string, tag = "12")]
475 pub cluster_header: ::prost::alloc::string::String,
476 /// The weight of the cluster. This value is relative to the other clusters'
477 /// weights. When a request matches the route, the choice of an upstream cluster
478 /// is determined by its weight. The sum of weights across all
479 /// entries in the clusters array must be greater than 0, and must not exceed
480 /// uint32_t maximal value (4294967295).
481 #[prost(message, optional, tag = "2")]
482 pub weight: ::core::option::Option<
483 super::super::super::super::super::google::protobuf::UInt32Value,
484 >,
485 /// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in
486 /// the upstream cluster with metadata matching what is set in this field will be considered for
487 /// load balancing. Note that this will be merged with what's provided in
488 /// :ref:`RouteAction.metadata_match <envoy_v3_api_field_config.route.v3.RouteAction.metadata_match>`, with
489 /// values here taking precedence. The filter name should be specified as ``envoy.lb``.
490 #[prost(message, optional, tag = "3")]
491 pub metadata_match: ::core::option::Option<
492 super::super::super::core::v3::Metadata,
493 >,
494 /// Specifies a list of headers to be added to requests when this cluster is selected
495 /// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
496 /// Headers specified at this level are applied before headers from the enclosing
497 /// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`, and
498 /// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
499 /// header value syntax, see the documentation on :ref:`custom request headers
500 /// <config_http_conn_man_headers_custom_request_headers>`.
501 #[prost(message, repeated, tag = "4")]
502 pub request_headers_to_add: ::prost::alloc::vec::Vec<
503 super::super::super::core::v3::HeaderValueOption,
504 >,
505 /// Specifies a list of HTTP headers that should be removed from each request when
506 /// this cluster is selected through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
507 #[prost(string, repeated, tag = "9")]
508 pub request_headers_to_remove: ::prost::alloc::vec::Vec<
509 ::prost::alloc::string::String,
510 >,
511 /// Specifies a list of headers to be added to responses when this cluster is selected
512 /// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
513 /// Headers specified at this level are applied before headers from the enclosing
514 /// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`, and
515 /// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
516 /// header value syntax, see the documentation on :ref:`custom request headers
517 /// <config_http_conn_man_headers_custom_request_headers>`.
518 #[prost(message, repeated, tag = "5")]
519 pub response_headers_to_add: ::prost::alloc::vec::Vec<
520 super::super::super::core::v3::HeaderValueOption,
521 >,
522 /// Specifies a list of headers to be removed from responses when this cluster is selected
523 /// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
524 #[prost(string, repeated, tag = "6")]
525 pub response_headers_to_remove: ::prost::alloc::vec::Vec<
526 ::prost::alloc::string::String,
527 >,
528 /// This field can be used to provide weighted cluster specific per filter config. The key should match the
529 /// :ref:`filter config name
530 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
531 /// See :ref:`Http filter route specific config <arch_overview_http_filters_per_filter_config>`
532 /// for details.
533 /// [#comment: An entry's value may be wrapped in a
534 /// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
535 /// message to specify additional options.]
536 #[prost(map = "string, message", tag = "10")]
537 pub typed_per_filter_config: ::std::collections::HashMap<
538 ::prost::alloc::string::String,
539 super::super::super::super::super::google::protobuf::Any,
540 >,
541 #[prost(oneof = "cluster_weight::HostRewriteSpecifier", tags = "11")]
542 pub host_rewrite_specifier: ::core::option::Option<
543 cluster_weight::HostRewriteSpecifier,
544 >,
545 }
546 /// Nested message and enum types in `ClusterWeight`.
547 pub mod cluster_weight {
548 #[derive(Clone, PartialEq, ::prost::Oneof)]
549 pub enum HostRewriteSpecifier {
550 /// Indicates that during forwarding, the host header will be swapped with
551 /// this value.
552 #[prost(string, tag = "11")]
553 HostRewriteLiteral(::prost::alloc::string::String),
554 }
555 }
556 impl ::prost::Name for ClusterWeight {
557 const NAME: &'static str = "ClusterWeight";
558 const PACKAGE: &'static str = "envoy.config.route.v3";
559 fn full_name() -> ::prost::alloc::string::String {
560 "envoy.config.route.v3.WeightedCluster.ClusterWeight".into()
561 }
562 fn type_url() -> ::prost::alloc::string::String {
563 "type.googleapis.com/envoy.config.route.v3.WeightedCluster.ClusterWeight"
564 .into()
565 }
566 }
567 #[derive(Clone, PartialEq, ::prost::Oneof)]
568 pub enum RandomValueSpecifier {
569 /// Specifies the header name that is used to look up the random value passed in the request header.
570 /// This is used to ensure consistent cluster picking across multiple proxy levels for weighted traffic.
571 /// If header is not present or invalid, Envoy will fall back to use the internally generated random value.
572 /// This header is expected to be single-valued header as we only want to have one selected value throughout
573 /// the process for the consistency. And the value is a unsigned number between 0 and UINT64_MAX.
574 #[prost(string, tag = "4")]
575 HeaderName(::prost::alloc::string::String),
576 }
577}
578impl ::prost::Name for WeightedCluster {
579 const NAME: &'static str = "WeightedCluster";
580 const PACKAGE: &'static str = "envoy.config.route.v3";
581 fn full_name() -> ::prost::alloc::string::String {
582 "envoy.config.route.v3.WeightedCluster".into()
583 }
584 fn type_url() -> ::prost::alloc::string::String {
585 "type.googleapis.com/envoy.config.route.v3.WeightedCluster".into()
586 }
587}
588/// Configuration for a cluster specifier plugin.
589#[derive(Clone, PartialEq, ::prost::Message)]
590pub struct ClusterSpecifierPlugin {
591 /// The name of the plugin and its opaque configuration.
592 #[prost(message, optional, tag = "1")]
593 pub extension: ::core::option::Option<super::super::core::v3::TypedExtensionConfig>,
594 /// If is_optional is not set or is set to false and the plugin defined by this message is not a
595 /// supported type, the containing resource is NACKed. If is_optional is set to true, the resource
596 /// would not be NACKed for this reason. In this case, routes referencing this plugin's name would
597 /// not be treated as an illegal configuration, but would result in a failure if the route is
598 /// selected.
599 #[prost(bool, tag = "2")]
600 pub is_optional: bool,
601}
602impl ::prost::Name for ClusterSpecifierPlugin {
603 const NAME: &'static str = "ClusterSpecifierPlugin";
604 const PACKAGE: &'static str = "envoy.config.route.v3";
605 fn full_name() -> ::prost::alloc::string::String {
606 "envoy.config.route.v3.ClusterSpecifierPlugin".into()
607 }
608 fn type_url() -> ::prost::alloc::string::String {
609 "type.googleapis.com/envoy.config.route.v3.ClusterSpecifierPlugin".into()
610 }
611}
612/// \[#next-free-field: 16\]
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct RouteMatch {
615 /// Indicates that prefix/path matching should be case sensitive. The default
616 /// is true. Ignored for safe_regex matching.
617 #[prost(message, optional, tag = "4")]
618 pub case_sensitive: ::core::option::Option<
619 super::super::super::super::google::protobuf::BoolValue,
620 >,
621 /// Indicates that the route should additionally match on a runtime key. Every time the route
622 /// is considered for a match, it must also fall under the percentage of matches indicated by
623 /// this field. For some fraction N/D, a random number in the range [0,D) is selected. If the
624 /// number is <= the value of the numerator N, or if the key is not present, the default
625 /// value, the router continues to evaluate the remaining match criteria. A runtime_fraction
626 /// route configuration can be used to roll out route changes in a gradual manner without full
627 /// code/config deploys. Refer to the :ref:`traffic shifting
628 /// <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation.
629 ///
630 /// .. note::
631 ///
632 /// Parsing this field is implemented such that the runtime key's data may be represented
633 /// as a FractionalPercent proto represented as JSON/YAML and may also be represented as an
634 /// integer with the assumption that the value is an integral percentage out of 100. For
635 /// instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent
636 /// whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics.
637 #[prost(message, optional, tag = "9")]
638 pub runtime_fraction: ::core::option::Option<
639 super::super::core::v3::RuntimeFractionalPercent,
640 >,
641 /// Specifies a set of headers that the route should match on. The router will
642 /// check the request’s headers against all the specified headers in the route
643 /// config. A match will happen if all the headers in the route are present in
644 /// the request with the same values (or based on presence if the value field
645 /// is not in the config).
646 #[prost(message, repeated, tag = "6")]
647 pub headers: ::prost::alloc::vec::Vec<HeaderMatcher>,
648 /// Specifies a set of URL query parameters on which the route should
649 /// match. The router will check the query string from the ``path`` header
650 /// against all the specified query parameters. If the number of specified
651 /// query parameters is nonzero, they all must match the ``path`` header's
652 /// query string for a match to occur. In the event query parameters are
653 /// repeated, only the first value for each key will be considered.
654 ///
655 /// .. note::
656 ///
657 /// If query parameters are used to pass request message fields when
658 /// `grpc_json_transcoder <<https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter>`_>
659 /// is used, the transcoded message fields maybe different. The query parameters are
660 /// url encoded, but the message fields are not. For example, if a query
661 /// parameter is "foo%20bar", the message field will be "foo bar".
662 #[prost(message, repeated, tag = "7")]
663 pub query_parameters: ::prost::alloc::vec::Vec<QueryParameterMatcher>,
664 /// If specified, only gRPC requests will be matched. The router will check
665 /// that the content-type header has a application/grpc or one of the various
666 /// application/grpc+ values.
667 #[prost(message, optional, tag = "8")]
668 pub grpc: ::core::option::Option<route_match::GrpcRouteMatchOptions>,
669 /// If specified, the client tls context will be matched against the defined
670 /// match options.
671 ///
672 /// \[#next-major-version: unify with RBAC\]
673 #[prost(message, optional, tag = "11")]
674 pub tls_context: ::core::option::Option<route_match::TlsContextMatchOptions>,
675 /// Specifies a set of dynamic metadata matchers on which the route should match.
676 /// The router will check the dynamic metadata against all the specified dynamic metadata matchers.
677 /// If the number of specified dynamic metadata matchers is nonzero, they all must match the
678 /// dynamic metadata for a match to occur.
679 #[prost(message, repeated, tag = "13")]
680 pub dynamic_metadata: ::prost::alloc::vec::Vec<
681 super::super::super::r#type::matcher::v3::MetadataMatcher,
682 >,
683 #[prost(oneof = "route_match::PathSpecifier", tags = "1, 2, 10, 12, 14, 15")]
684 pub path_specifier: ::core::option::Option<route_match::PathSpecifier>,
685}
686/// Nested message and enum types in `RouteMatch`.
687pub mod route_match {
688 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
689 pub struct GrpcRouteMatchOptions {}
690 impl ::prost::Name for GrpcRouteMatchOptions {
691 const NAME: &'static str = "GrpcRouteMatchOptions";
692 const PACKAGE: &'static str = "envoy.config.route.v3";
693 fn full_name() -> ::prost::alloc::string::String {
694 "envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions".into()
695 }
696 fn type_url() -> ::prost::alloc::string::String {
697 "type.googleapis.com/envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions"
698 .into()
699 }
700 }
701 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
702 pub struct TlsContextMatchOptions {
703 /// If specified, the route will match against whether or not a certificate is presented.
704 /// If not specified, certificate presentation status (true or false) will not be considered when route matching.
705 #[prost(message, optional, tag = "1")]
706 pub presented: ::core::option::Option<
707 super::super::super::super::super::google::protobuf::BoolValue,
708 >,
709 /// If specified, the route will match against whether or not a certificate is validated.
710 /// If not specified, certificate validation status (true or false) will not be considered when route matching.
711 ///
712 /// .. warning::
713 ///
714 /// Client certificate validation is not currently performed upon TLS session resumption. For
715 /// a resumed TLS session the route will match only when ``validated`` is false, regardless of
716 /// whether the client TLS certificate is valid.
717 ///
718 /// The only known workaround for this issue is to disable TLS session resumption entirely, by
719 /// setting both :ref:`disable_stateless_session_resumption <envoy_v3_api_field_extensions.transport_sockets.tls.v3.DownstreamTlsContext.disable_stateless_session_resumption>`
720 /// and :ref:`disable_stateful_session_resumption <envoy_v3_api_field_extensions.transport_sockets.tls.v3.DownstreamTlsContext.disable_stateful_session_resumption>` on the DownstreamTlsContext.
721 #[prost(message, optional, tag = "2")]
722 pub validated: ::core::option::Option<
723 super::super::super::super::super::google::protobuf::BoolValue,
724 >,
725 }
726 impl ::prost::Name for TlsContextMatchOptions {
727 const NAME: &'static str = "TlsContextMatchOptions";
728 const PACKAGE: &'static str = "envoy.config.route.v3";
729 fn full_name() -> ::prost::alloc::string::String {
730 "envoy.config.route.v3.RouteMatch.TlsContextMatchOptions".into()
731 }
732 fn type_url() -> ::prost::alloc::string::String {
733 "type.googleapis.com/envoy.config.route.v3.RouteMatch.TlsContextMatchOptions"
734 .into()
735 }
736 }
737 /// An extensible message for matching CONNECT or CONNECT-UDP requests.
738 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
739 pub struct ConnectMatcher {}
740 impl ::prost::Name for ConnectMatcher {
741 const NAME: &'static str = "ConnectMatcher";
742 const PACKAGE: &'static str = "envoy.config.route.v3";
743 fn full_name() -> ::prost::alloc::string::String {
744 "envoy.config.route.v3.RouteMatch.ConnectMatcher".into()
745 }
746 fn type_url() -> ::prost::alloc::string::String {
747 "type.googleapis.com/envoy.config.route.v3.RouteMatch.ConnectMatcher".into()
748 }
749 }
750 #[derive(Clone, PartialEq, ::prost::Oneof)]
751 pub enum PathSpecifier {
752 /// If specified, the route is a prefix rule meaning that the prefix must
753 /// match the beginning of the ``:path`` header.
754 #[prost(string, tag = "1")]
755 Prefix(::prost::alloc::string::String),
756 /// If specified, the route is an exact path rule meaning that the path must
757 /// exactly match the ``:path`` header once the query string is removed.
758 #[prost(string, tag = "2")]
759 Path(::prost::alloc::string::String),
760 /// If specified, the route is a regular expression rule meaning that the
761 /// regex must match the ``:path`` header once the query string is removed. The entire path
762 /// (without the query string) must match the regex. The rule will not match if only a
763 /// subsequence of the ``:path`` header matches the regex.
764 ///
765 /// [#next-major-version: In the v3 API we should redo how path specification works such
766 /// that we utilize StringMatcher, and additionally have consistent options around whether we
767 /// strip query strings, do a case sensitive match, etc. In the interim it will be too disruptive
768 /// to deprecate the existing options. We should even consider whether we want to do away with
769 /// path_specifier entirely and just rely on a set of header matchers which can already match
770 /// on :path, etc. The issue with that is it is unclear how to generically deal with query string
771 /// stripping. This needs more thought.]
772 #[prost(message, tag = "10")]
773 SafeRegex(super::super::super::super::r#type::matcher::v3::RegexMatcher),
774 /// If this is used as the matcher, the matcher will only match CONNECT or CONNECT-UDP requests.
775 /// Note that this will not match other Extended CONNECT requests (WebSocket and the like) as
776 /// they are normalized in Envoy as HTTP/1.1 style upgrades.
777 /// This is the only way to match CONNECT requests for HTTP/1.1. For HTTP/2 and HTTP/3,
778 /// where Extended CONNECT requests may have a path, the path matchers will work if
779 /// there is a path present.
780 /// Note that CONNECT support is currently considered alpha in Envoy.
781 /// \[#comment: TODO(htuch): Replace the above comment with an alpha tag.\]
782 #[prost(message, tag = "12")]
783 ConnectMatcher(ConnectMatcher),
784 /// If specified, the route is a path-separated prefix rule meaning that the
785 /// ``:path`` header (without the query string) must either exactly match the
786 /// ``path_separated_prefix`` or have it as a prefix, followed by ``/``
787 ///
788 /// For example, ``/api/dev`` would match
789 /// ``/api/dev``, ``/api/dev/``, ``/api/dev/v1``, and ``/api/dev?param=true``
790 /// but would not match ``/api/developer``
791 ///
792 /// Expect the value to not contain ``?`` or ``#`` and not to end in ``/``
793 #[prost(string, tag = "14")]
794 PathSeparatedPrefix(::prost::alloc::string::String),
795 /// \[#extension-category: envoy.path.match\]
796 #[prost(message, tag = "15")]
797 PathMatchPolicy(super::super::super::core::v3::TypedExtensionConfig),
798 }
799}
800impl ::prost::Name for RouteMatch {
801 const NAME: &'static str = "RouteMatch";
802 const PACKAGE: &'static str = "envoy.config.route.v3";
803 fn full_name() -> ::prost::alloc::string::String {
804 "envoy.config.route.v3.RouteMatch".into()
805 }
806 fn type_url() -> ::prost::alloc::string::String {
807 "type.googleapis.com/envoy.config.route.v3.RouteMatch".into()
808 }
809}
810/// Cors policy configuration.
811///
812/// .. attention::
813///
814/// This message has been deprecated. Please use
815/// :ref:`CorsPolicy in filter extension <envoy_v3_api_msg_extensions.filters.http.cors.v3.CorsPolicy>`
816/// as as alternative.
817///
818/// \[#next-free-field: 14\]
819#[derive(Clone, PartialEq, ::prost::Message)]
820pub struct CorsPolicy {
821 /// Specifies string patterns that match allowed origins. An origin is allowed if any of the
822 /// string matchers match.
823 #[prost(message, repeated, tag = "11")]
824 pub allow_origin_string_match: ::prost::alloc::vec::Vec<
825 super::super::super::r#type::matcher::v3::StringMatcher,
826 >,
827 /// Specifies the content for the ``access-control-allow-methods`` header.
828 #[prost(string, tag = "2")]
829 pub allow_methods: ::prost::alloc::string::String,
830 /// Specifies the content for the ``access-control-allow-headers`` header.
831 #[prost(string, tag = "3")]
832 pub allow_headers: ::prost::alloc::string::String,
833 /// Specifies the content for the ``access-control-expose-headers`` header.
834 #[prost(string, tag = "4")]
835 pub expose_headers: ::prost::alloc::string::String,
836 /// Specifies the content for the ``access-control-max-age`` header.
837 #[prost(string, tag = "5")]
838 pub max_age: ::prost::alloc::string::String,
839 /// Specifies whether the resource allows credentials.
840 #[prost(message, optional, tag = "6")]
841 pub allow_credentials: ::core::option::Option<
842 super::super::super::super::google::protobuf::BoolValue,
843 >,
844 /// Specifies the % of requests for which the CORS policies will be evaluated and tracked, but not
845 /// enforced.
846 ///
847 /// This field is intended to be used when ``filter_enabled`` and ``enabled`` are off. One of those
848 /// fields have to explicitly disable the filter in order for this setting to take effect.
849 ///
850 /// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is specified,
851 /// Envoy will lookup the runtime key to get the percentage of requests for which it will evaluate
852 /// and track the request's ``Origin`` to determine if it's valid but will not enforce any policies.
853 #[prost(message, optional, tag = "10")]
854 pub shadow_enabled: ::core::option::Option<
855 super::super::core::v3::RuntimeFractionalPercent,
856 >,
857 /// Specify whether allow requests whose target server's IP address is more private than that from
858 /// which the request initiator was fetched.
859 ///
860 /// More details refer to <https://developer.chrome.com/blog/private-network-access-preflight.>
861 #[prost(message, optional, tag = "12")]
862 pub allow_private_network_access: ::core::option::Option<
863 super::super::super::super::google::protobuf::BoolValue,
864 >,
865 /// Specifies if preflight requests not matching the configured allowed origin should be forwarded
866 /// to the upstream. Default is true.
867 #[prost(message, optional, tag = "13")]
868 pub forward_not_matching_preflights: ::core::option::Option<
869 super::super::super::super::google::protobuf::BoolValue,
870 >,
871 #[prost(oneof = "cors_policy::EnabledSpecifier", tags = "9")]
872 pub enabled_specifier: ::core::option::Option<cors_policy::EnabledSpecifier>,
873}
874/// Nested message and enum types in `CorsPolicy`.
875pub mod cors_policy {
876 #[derive(Clone, PartialEq, ::prost::Oneof)]
877 pub enum EnabledSpecifier {
878 /// Specifies the % of requests for which the CORS filter is enabled.
879 ///
880 /// If neither ``enabled``, ``filter_enabled``, nor ``shadow_enabled`` are specified, the CORS
881 /// filter will be enabled for 100% of the requests.
882 ///
883 /// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is
884 /// specified, Envoy will lookup the runtime key to get the percentage of requests to filter.
885 #[prost(message, tag = "9")]
886 FilterEnabled(super::super::super::core::v3::RuntimeFractionalPercent),
887 }
888}
889impl ::prost::Name for CorsPolicy {
890 const NAME: &'static str = "CorsPolicy";
891 const PACKAGE: &'static str = "envoy.config.route.v3";
892 fn full_name() -> ::prost::alloc::string::String {
893 "envoy.config.route.v3.CorsPolicy".into()
894 }
895 fn type_url() -> ::prost::alloc::string::String {
896 "type.googleapis.com/envoy.config.route.v3.CorsPolicy".into()
897 }
898}
899/// \[#next-free-field: 42\]
900#[derive(Clone, PartialEq, ::prost::Message)]
901pub struct RouteAction {
902 /// The HTTP status code to use when configured cluster is not found.
903 /// The default response code is 503 Service Unavailable.
904 #[prost(enumeration = "route_action::ClusterNotFoundResponseCode", tag = "20")]
905 pub cluster_not_found_response_code: i32,
906 /// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints
907 /// in the upstream cluster with metadata matching what's set in this field will be considered
908 /// for load balancing. If using :ref:`weighted_clusters
909 /// <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>`, metadata will be merged, with values
910 /// provided there taking precedence. The filter name should be specified as ``envoy.lb``.
911 #[prost(message, optional, tag = "4")]
912 pub metadata_match: ::core::option::Option<super::super::core::v3::Metadata>,
913 /// Indicates that during forwarding, the matched prefix (or path) should be
914 /// swapped with this value. This option allows application URLs to be rooted
915 /// at a different path from those exposed at the reverse proxy layer. The router filter will
916 /// place the original path before rewrite into the :ref:`x-envoy-original-path
917 /// <config_http_filters_router_x-envoy-original-path>` header.
918 ///
919 /// Only one of :ref:`regex_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.regex_rewrite>`
920 /// :ref:`path_rewrite_policy <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite_policy>`,
921 /// or :ref:`prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>` may be specified.
922 ///
923 /// .. attention::
924 ///
925 /// Pay careful attention to the use of trailing slashes in the
926 /// :ref:`route's match <envoy_v3_api_field_config.route.v3.Route.match>` prefix value.
927 /// Stripping a prefix from a path requires multiple Routes to handle all cases. For example,
928 /// rewriting ``/prefix`` to ``/`` and ``/prefix/etc`` to ``/etc`` cannot be done in a single
929 /// :ref:`Route <envoy_v3_api_msg_config.route.v3.Route>`, as shown by the below config entries:
930 ///
931 /// .. code-block:: yaml
932 ///
933 /// - match:
934 /// prefix: "/prefix/"
935 /// route:
936 /// prefix_rewrite: "/"
937 /// - match:
938 /// prefix: "/prefix"
939 /// route:
940 /// prefix_rewrite: "/"
941 ///
942 /// Having above entries in the config, requests to ``/prefix`` will be stripped to ``/``, while
943 /// requests to ``/prefix/etc`` will be stripped to ``/etc``.
944 #[prost(string, tag = "5")]
945 pub prefix_rewrite: ::prost::alloc::string::String,
946 /// Indicates that during forwarding, portions of the path that match the
947 /// pattern should be rewritten, even allowing the substitution of capture
948 /// groups from the pattern into the new path as specified by the rewrite
949 /// substitution string. This is useful to allow application paths to be
950 /// rewritten in a way that is aware of segments with variable content like
951 /// identifiers. The router filter will place the original path as it was
952 /// before the rewrite into the :ref:`x-envoy-original-path
953 /// <config_http_filters_router_x-envoy-original-path>` header.
954 ///
955 /// Only one of :ref:`regex_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.regex_rewrite>`,
956 /// :ref:`prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>`, or
957 /// :ref:`path_rewrite_policy <envoy_v3_api_field_config.route.v3.RouteAction.path_rewrite_policy>`]
958 /// may be specified.
959 ///
960 /// Examples using Google's `RE2 <<https://github.com/google/re2>`_> engine:
961 ///
962 /// * The path pattern ``^/service/(\[^/\]+)(/.*)$`` paired with a substitution
963 /// string of ``\2/instance/\1`` would transform ``/service/foo/v1/api``
964 /// into ``/v1/api/instance/foo``.
965 ///
966 /// * The pattern ``one`` paired with a substitution string of ``two`` would
967 /// transform ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/two/zzz``.
968 ///
969 /// * The pattern ``^(.*?)one(.*)$`` paired with a substitution string of
970 /// ``\1two\2`` would replace only the first occurrence of ``one``,
971 /// transforming path ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/one/zzz``.
972 ///
973 /// * The pattern ``(?i)/xxx/`` paired with a substitution string of ``/yyy/``
974 /// would do a case-insensitive match and transform path ``/aaa/XxX/bbb`` to
975 /// ``/aaa/yyy/bbb``.
976 #[prost(message, optional, tag = "32")]
977 pub regex_rewrite: ::core::option::Option<
978 super::super::super::r#type::matcher::v3::RegexMatchAndSubstitute,
979 >,
980 /// \[#extension-category: envoy.path.rewrite\]
981 #[prost(message, optional, tag = "41")]
982 pub path_rewrite_policy: ::core::option::Option<
983 super::super::core::v3::TypedExtensionConfig,
984 >,
985 /// If set, then a host rewrite action (one of
986 /// :ref:`host_rewrite_literal <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_literal>`,
987 /// :ref:`auto_host_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.auto_host_rewrite>`,
988 /// :ref:`host_rewrite_header <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_header>`, or
989 /// :ref:`host_rewrite_path_regex <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_path_regex>`)
990 /// causes the original value of the host header, if any, to be appended to the
991 /// :ref:`config_http_conn_man_headers_x-forwarded-host` HTTP header if it is different to the last value appended.
992 #[prost(bool, tag = "38")]
993 pub append_x_forwarded_host: bool,
994 /// Specifies the upstream timeout for the route. If not specified, the default is 15s. This
995 /// spans between the point at which the entire downstream request (i.e. end-of-stream) has been
996 /// processed and when the upstream response has been completely processed. A value of 0 will
997 /// disable the route's timeout.
998 ///
999 /// .. note::
1000 ///
1001 /// This timeout includes all retries. See also
1002 /// :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`,
1003 /// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the
1004 /// :ref:`retry overview <arch_overview_http_routing_retry>`.
1005 #[prost(message, optional, tag = "8")]
1006 pub timeout: ::core::option::Option<
1007 super::super::super::super::google::protobuf::Duration,
1008 >,
1009 /// Specifies the idle timeout for the route. If not specified, there is no per-route idle timeout,
1010 /// although the connection manager wide :ref:`stream_idle_timeout
1011 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
1012 /// will still apply. A value of 0 will completely disable the route's idle timeout, even if a
1013 /// connection manager stream idle timeout is configured.
1014 ///
1015 /// The idle timeout is distinct to :ref:`timeout
1016 /// <envoy_v3_api_field_config.route.v3.RouteAction.timeout>`, which provides an upper bound
1017 /// on the upstream response time; :ref:`idle_timeout
1018 /// <envoy_v3_api_field_config.route.v3.RouteAction.idle_timeout>` instead bounds the amount
1019 /// of time the request's stream may be idle.
1020 ///
1021 /// After header decoding, the idle timeout will apply on downstream and
1022 /// upstream request events. Each time an encode/decode event for headers or
1023 /// data is processed for the stream, the timer will be reset. If the timeout
1024 /// fires, the stream is terminated with a 408 Request Timeout error code if no
1025 /// upstream response header has been received, otherwise a stream reset
1026 /// occurs.
1027 ///
1028 /// If the :ref:`overload action <config_overload_manager_overload_actions>` "envoy.overload_actions.reduce_timeouts"
1029 /// is configured, this timeout is scaled according to the value for
1030 /// :ref:`HTTP_DOWNSTREAM_STREAM_IDLE <envoy_v3_api_enum_value_config.overload.v3.ScaleTimersOverloadActionConfig.TimerType.HTTP_DOWNSTREAM_STREAM_IDLE>`.
1031 #[prost(message, optional, tag = "24")]
1032 pub idle_timeout: ::core::option::Option<
1033 super::super::super::super::google::protobuf::Duration,
1034 >,
1035 /// Specifies how to send request over TLS early data.
1036 /// If absent, allows `safe HTTP requests <<https://www.rfc-editor.org/rfc/rfc7231#section-4.2.1>`_> to be sent on early data.
1037 /// \[#extension-category: envoy.route.early_data_policy\]
1038 #[prost(message, optional, tag = "40")]
1039 pub early_data_policy: ::core::option::Option<
1040 super::super::core::v3::TypedExtensionConfig,
1041 >,
1042 /// Indicates that the route has a retry policy. Note that if this is set,
1043 /// it'll take precedence over the virtual host level retry policy entirely
1044 /// (e.g.: policies are not merged, most internal one becomes the enforced policy).
1045 #[prost(message, optional, tag = "9")]
1046 pub retry_policy: ::core::option::Option<RetryPolicy>,
1047 /// \[#not-implemented-hide:\]
1048 /// Specifies the configuration for retry policy extension. Note that if this is set, it'll take
1049 /// precedence over the virtual host level retry policy entirely (e.g.: policies are not merged,
1050 /// most internal one becomes the enforced policy). :ref:`Retry policy <envoy_v3_api_field_config.route.v3.VirtualHost.retry_policy>`
1051 /// should not be set if this field is used.
1052 #[prost(message, optional, tag = "33")]
1053 pub retry_policy_typed_config: ::core::option::Option<
1054 super::super::super::super::google::protobuf::Any,
1055 >,
1056 /// Specify a set of route request mirroring policies.
1057 /// It takes precedence over the virtual host and route config mirror policy entirely.
1058 /// That is, policies are not merged, the most specific non-empty one becomes the mirror policies.
1059 #[prost(message, repeated, tag = "30")]
1060 pub request_mirror_policies: ::prost::alloc::vec::Vec<
1061 route_action::RequestMirrorPolicy,
1062 >,
1063 /// Optionally specifies the :ref:`routing priority <arch_overview_http_routing_priority>`.
1064 #[prost(enumeration = "super::super::core::v3::RoutingPriority", tag = "11")]
1065 pub priority: i32,
1066 /// Specifies a set of rate limit configurations that could be applied to the
1067 /// route.
1068 #[prost(message, repeated, tag = "13")]
1069 pub rate_limits: ::prost::alloc::vec::Vec<RateLimit>,
1070 /// Specifies if the rate limit filter should include the virtual host rate
1071 /// limits. By default, if the route configured rate limits, the virtual host
1072 /// :ref:`rate_limits <envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` are not applied to the
1073 /// request.
1074 ///
1075 /// This field is deprecated. Please use :ref:`vh_rate_limits <envoy_v3_api_field_extensions.filters.http.ratelimit.v3.RateLimitPerRoute.vh_rate_limits>`
1076 #[deprecated]
1077 #[prost(message, optional, tag = "14")]
1078 pub include_vh_rate_limits: ::core::option::Option<
1079 super::super::super::super::google::protobuf::BoolValue,
1080 >,
1081 /// Specifies a list of hash policies to use for ring hash load balancing. Each
1082 /// hash policy is evaluated individually and the combined result is used to
1083 /// route the request. The method of combination is deterministic such that
1084 /// identical lists of hash policies will produce the same hash. Since a hash
1085 /// policy examines specific parts of a request, it can fail to produce a hash
1086 /// (i.e. if the hashed header is not present). If (and only if) all configured
1087 /// hash policies fail to generate a hash, no hash will be produced for
1088 /// the route. In this case, the behavior is the same as if no hash policies
1089 /// were specified (i.e. the ring hash load balancer will choose a random
1090 /// backend). If a hash policy has the "terminal" attribute set to true, and
1091 /// there is already a hash generated, the hash is returned immediately,
1092 /// ignoring the rest of the hash policy list.
1093 #[prost(message, repeated, tag = "15")]
1094 pub hash_policy: ::prost::alloc::vec::Vec<route_action::HashPolicy>,
1095 /// Indicates that the route has a CORS policy. This field is ignored if related cors policy is
1096 /// found in the :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>` or
1097 /// :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_v3_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`.
1098 ///
1099 /// .. attention::
1100 ///
1101 /// This option has been deprecated. Please use
1102 /// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>` or
1103 /// :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_v3_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`
1104 /// to configure the CORS HTTP filter.
1105 #[deprecated]
1106 #[prost(message, optional, tag = "17")]
1107 pub cors: ::core::option::Option<CorsPolicy>,
1108 /// Deprecated by :ref:`grpc_timeout_header_max <envoy_v3_api_field_config.route.v3.RouteAction.MaxStreamDuration.grpc_timeout_header_max>`
1109 /// If present, and the request is a gRPC request, use the
1110 /// `grpc-timeout header <<https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_,>
1111 /// or its default value (infinity) instead of
1112 /// :ref:`timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>`, but limit the applied timeout
1113 /// to the maximum value specified here. If configured as 0, the maximum allowed timeout for
1114 /// gRPC requests is infinity. If not configured at all, the ``grpc-timeout`` header is not used
1115 /// and gRPC requests time out like any other requests using
1116 /// :ref:`timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` or its default.
1117 /// This can be used to prevent unexpected upstream request timeouts due to potentially long
1118 /// time gaps between gRPC request and response in gRPC streaming mode.
1119 ///
1120 /// .. note::
1121 ///
1122 /// If a timeout is specified using :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`, it takes
1123 /// precedence over `grpc-timeout header <<https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_,> when
1124 /// both are present. See also
1125 /// :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`,
1126 /// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the
1127 /// :ref:`retry overview <arch_overview_http_routing_retry>`.
1128 #[deprecated]
1129 #[prost(message, optional, tag = "23")]
1130 pub max_grpc_timeout: ::core::option::Option<
1131 super::super::super::super::google::protobuf::Duration,
1132 >,
1133 /// Deprecated by :ref:`grpc_timeout_header_offset <envoy_v3_api_field_config.route.v3.RouteAction.MaxStreamDuration.grpc_timeout_header_offset>`.
1134 /// If present, Envoy will adjust the timeout provided by the ``grpc-timeout`` header by subtracting
1135 /// the provided duration from the header. This is useful in allowing Envoy to set its global
1136 /// timeout to be less than that of the deadline imposed by the calling client, which makes it more
1137 /// likely that Envoy will handle the timeout instead of having the call canceled by the client.
1138 /// The offset will only be applied if the provided grpc_timeout is greater than the offset. This
1139 /// ensures that the offset will only ever decrease the timeout and never set it to 0 (meaning
1140 /// infinity).
1141 #[deprecated]
1142 #[prost(message, optional, tag = "28")]
1143 pub grpc_timeout_offset: ::core::option::Option<
1144 super::super::super::super::google::protobuf::Duration,
1145 >,
1146 #[prost(message, repeated, tag = "25")]
1147 pub upgrade_configs: ::prost::alloc::vec::Vec<route_action::UpgradeConfig>,
1148 /// If present, Envoy will try to follow an upstream redirect response instead of proxying the
1149 /// response back to the downstream. An upstream redirect response is defined
1150 /// by :ref:`redirect_response_codes
1151 /// <envoy_v3_api_field_config.route.v3.InternalRedirectPolicy.redirect_response_codes>`.
1152 #[prost(message, optional, tag = "34")]
1153 pub internal_redirect_policy: ::core::option::Option<InternalRedirectPolicy>,
1154 #[deprecated]
1155 #[prost(enumeration = "route_action::InternalRedirectAction", tag = "26")]
1156 pub internal_redirect_action: i32,
1157 /// An internal redirect is handled, iff the number of previous internal redirects that a
1158 /// downstream request has encountered is lower than this value, and
1159 /// :ref:`internal_redirect_action <envoy_v3_api_field_config.route.v3.RouteAction.internal_redirect_action>`
1160 /// is set to :ref:`HANDLE_INTERNAL_REDIRECT
1161 /// <envoy_v3_api_enum_value_config.route.v3.RouteAction.InternalRedirectAction.HANDLE_INTERNAL_REDIRECT>`
1162 /// In the case where a downstream request is bounced among multiple routes by internal redirect,
1163 /// the first route that hits this threshold, or has
1164 /// :ref:`internal_redirect_action <envoy_v3_api_field_config.route.v3.RouteAction.internal_redirect_action>`
1165 /// set to
1166 /// :ref:`PASS_THROUGH_INTERNAL_REDIRECT
1167 /// <envoy_v3_api_enum_value_config.route.v3.RouteAction.InternalRedirectAction.PASS_THROUGH_INTERNAL_REDIRECT>`
1168 /// will pass the redirect back to downstream.
1169 ///
1170 /// If not specified, at most one redirect will be followed.
1171 #[deprecated]
1172 #[prost(message, optional, tag = "31")]
1173 pub max_internal_redirects: ::core::option::Option<
1174 super::super::super::super::google::protobuf::UInt32Value,
1175 >,
1176 /// Indicates that the route has a hedge policy. Note that if this is set,
1177 /// it'll take precedence over the virtual host level hedge policy entirely
1178 /// (e.g.: policies are not merged, most internal one becomes the enforced policy).
1179 #[prost(message, optional, tag = "27")]
1180 pub hedge_policy: ::core::option::Option<HedgePolicy>,
1181 /// Specifies the maximum stream duration for this route.
1182 #[prost(message, optional, tag = "36")]
1183 pub max_stream_duration: ::core::option::Option<route_action::MaxStreamDuration>,
1184 #[prost(oneof = "route_action::ClusterSpecifier", tags = "1, 2, 3, 37, 39")]
1185 pub cluster_specifier: ::core::option::Option<route_action::ClusterSpecifier>,
1186 #[prost(oneof = "route_action::HostRewriteSpecifier", tags = "6, 7, 29, 35")]
1187 pub host_rewrite_specifier: ::core::option::Option<
1188 route_action::HostRewriteSpecifier,
1189 >,
1190}
1191/// Nested message and enum types in `RouteAction`.
1192pub mod route_action {
1193 /// The router is capable of shadowing traffic from one cluster to another. The current
1194 /// implementation is "fire and forget," meaning Envoy will not wait for the shadow cluster to
1195 /// respond before returning the response from the primary cluster. All normal statistics are
1196 /// collected for the shadow cluster making this feature useful for testing.
1197 ///
1198 /// During shadowing, the host/authority header is altered such that ``-shadow`` is appended. This is
1199 /// useful for logging. For example, ``cluster1`` becomes ``cluster1-shadow``. This behavior can be
1200 /// disabled by setting ``disable_shadow_host_suffix_append`` to ``true``.
1201 ///
1202 /// .. note::
1203 ///
1204 /// Shadowing will not be triggered if the primary cluster does not exist.
1205 ///
1206 /// .. note::
1207 ///
1208 /// Shadowing doesn't support Http CONNECT and upgrades.
1209 /// \[#next-free-field: 7\]
1210 #[derive(Clone, PartialEq, ::prost::Message)]
1211 pub struct RequestMirrorPolicy {
1212 /// Only one of ``cluster`` and ``cluster_header`` can be specified.
1213 /// \[#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}\]
1214 /// Specifies the cluster that requests will be mirrored to. The cluster must
1215 /// exist in the cluster manager configuration.
1216 #[prost(string, tag = "1")]
1217 pub cluster: ::prost::alloc::string::String,
1218 /// Only one of ``cluster`` and ``cluster_header`` can be specified.
1219 /// Envoy will determine the cluster to route to by reading the value of the
1220 /// HTTP header named by cluster_header from the request headers. Only the first value in header is used,
1221 /// and no shadow request will happen if the value is not found in headers. Envoy will not wait for
1222 /// the shadow cluster to respond before returning the response from the primary cluster.
1223 ///
1224 /// .. attention::
1225 ///
1226 /// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
1227 /// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
1228 ///
1229 /// .. note::
1230 ///
1231 /// If the header appears multiple times only the first value is used.
1232 #[prost(string, tag = "5")]
1233 pub cluster_header: ::prost::alloc::string::String,
1234 /// If not specified, all requests to the target cluster will be mirrored.
1235 ///
1236 /// If specified, this field takes precedence over the ``runtime_key`` field and requests must also
1237 /// fall under the percentage of matches indicated by this field.
1238 ///
1239 /// For some fraction N/D, a random number in the range [0,D) is selected. If the
1240 /// number is <= the value of the numerator N, or if the key is not present, the default
1241 /// value, the request will be mirrored.
1242 #[prost(message, optional, tag = "3")]
1243 pub runtime_fraction: ::core::option::Option<
1244 super::super::super::core::v3::RuntimeFractionalPercent,
1245 >,
1246 /// Determines if the trace span should be sampled. Defaults to true.
1247 #[prost(message, optional, tag = "4")]
1248 pub trace_sampled: ::core::option::Option<
1249 super::super::super::super::super::google::protobuf::BoolValue,
1250 >,
1251 /// Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
1252 #[prost(bool, tag = "6")]
1253 pub disable_shadow_host_suffix_append: bool,
1254 }
1255 impl ::prost::Name for RequestMirrorPolicy {
1256 const NAME: &'static str = "RequestMirrorPolicy";
1257 const PACKAGE: &'static str = "envoy.config.route.v3";
1258 fn full_name() -> ::prost::alloc::string::String {
1259 "envoy.config.route.v3.RouteAction.RequestMirrorPolicy".into()
1260 }
1261 fn type_url() -> ::prost::alloc::string::String {
1262 "type.googleapis.com/envoy.config.route.v3.RouteAction.RequestMirrorPolicy"
1263 .into()
1264 }
1265 }
1266 /// Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
1267 /// <arch_overview_load_balancing_types>`.
1268 /// \[#next-free-field: 7\]
1269 #[derive(Clone, PartialEq, ::prost::Message)]
1270 pub struct HashPolicy {
1271 /// The flag that short-circuits the hash computing. This field provides a
1272 /// 'fallback' style of configuration: "if a terminal policy doesn't work,
1273 /// fallback to rest of the policy list", it saves time when the terminal
1274 /// policy works.
1275 ///
1276 /// If true, and there is already a hash computed, ignore rest of the
1277 /// list of hash polices.
1278 /// For example, if the following hash methods are configured:
1279 ///
1280 /// ========= ========
1281 /// specifier terminal
1282 /// ========= ========
1283 /// Header A true
1284 /// Header B false
1285 /// Header C false
1286 /// ========= ========
1287 ///
1288 /// The generateHash process ends if policy "header A" generates a hash, as
1289 /// it's a terminal policy.
1290 #[prost(bool, tag = "4")]
1291 pub terminal: bool,
1292 #[prost(oneof = "hash_policy::PolicySpecifier", tags = "1, 2, 3, 5, 6")]
1293 pub policy_specifier: ::core::option::Option<hash_policy::PolicySpecifier>,
1294 }
1295 /// Nested message and enum types in `HashPolicy`.
1296 pub mod hash_policy {
1297 #[derive(Clone, PartialEq, ::prost::Message)]
1298 pub struct Header {
1299 /// The name of the request header that will be used to obtain the hash
1300 /// key. If the request header is not present, no hash will be produced.
1301 #[prost(string, tag = "1")]
1302 pub header_name: ::prost::alloc::string::String,
1303 /// If specified, the request header value will be rewritten and used
1304 /// to produce the hash key.
1305 #[prost(message, optional, tag = "2")]
1306 pub regex_rewrite: ::core::option::Option<
1307 super::super::super::super::super::r#type::matcher::v3::RegexMatchAndSubstitute,
1308 >,
1309 }
1310 impl ::prost::Name for Header {
1311 const NAME: &'static str = "Header";
1312 const PACKAGE: &'static str = "envoy.config.route.v3";
1313 fn full_name() -> ::prost::alloc::string::String {
1314 "envoy.config.route.v3.RouteAction.HashPolicy.Header".into()
1315 }
1316 fn type_url() -> ::prost::alloc::string::String {
1317 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy.Header"
1318 .into()
1319 }
1320 }
1321 /// CookieAttribute defines an API for adding additional attributes for a HTTP cookie.
1322 #[derive(Clone, PartialEq, ::prost::Message)]
1323 pub struct CookieAttribute {
1324 /// The name of the cookie attribute.
1325 #[prost(string, tag = "1")]
1326 pub name: ::prost::alloc::string::String,
1327 /// The optional value of the cookie attribute.
1328 #[prost(string, tag = "2")]
1329 pub value: ::prost::alloc::string::String,
1330 }
1331 impl ::prost::Name for CookieAttribute {
1332 const NAME: &'static str = "CookieAttribute";
1333 const PACKAGE: &'static str = "envoy.config.route.v3";
1334 fn full_name() -> ::prost::alloc::string::String {
1335 "envoy.config.route.v3.RouteAction.HashPolicy.CookieAttribute".into()
1336 }
1337 fn type_url() -> ::prost::alloc::string::String {
1338 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy.CookieAttribute"
1339 .into()
1340 }
1341 }
1342 /// Envoy supports two types of cookie affinity:
1343 ///
1344 /// 1. Passive. Envoy takes a cookie that's present in the cookies header and
1345 /// hashes on its value.
1346 ///
1347 /// 2. Generated. Envoy generates and sets a cookie with an expiration (TTL)
1348 /// on the first request from the client in its response to the client,
1349 /// based on the endpoint the request gets sent to. The client then
1350 /// presents this on the next and all subsequent requests. The hash of
1351 /// this is sufficient to ensure these requests get sent to the same
1352 /// endpoint. The cookie is generated by hashing the source and
1353 /// destination ports and addresses so that multiple independent HTTP2
1354 /// streams on the same connection will independently receive the same
1355 /// cookie, even if they arrive at the Envoy simultaneously.
1356 #[derive(Clone, PartialEq, ::prost::Message)]
1357 pub struct Cookie {
1358 /// The name of the cookie that will be used to obtain the hash key. If the
1359 /// cookie is not present and ttl below is not set, no hash will be
1360 /// produced.
1361 #[prost(string, tag = "1")]
1362 pub name: ::prost::alloc::string::String,
1363 /// If specified, a cookie with the TTL will be generated if the cookie is
1364 /// not present. If the TTL is present and zero, the generated cookie will
1365 /// be a session cookie.
1366 #[prost(message, optional, tag = "2")]
1367 pub ttl: ::core::option::Option<
1368 super::super::super::super::super::super::google::protobuf::Duration,
1369 >,
1370 /// The name of the path for the cookie. If no path is specified here, no path
1371 /// will be set for the cookie.
1372 #[prost(string, tag = "3")]
1373 pub path: ::prost::alloc::string::String,
1374 /// Additional attributes for the cookie. They will be used when generating a new cookie.
1375 #[prost(message, repeated, tag = "4")]
1376 pub attributes: ::prost::alloc::vec::Vec<CookieAttribute>,
1377 }
1378 impl ::prost::Name for Cookie {
1379 const NAME: &'static str = "Cookie";
1380 const PACKAGE: &'static str = "envoy.config.route.v3";
1381 fn full_name() -> ::prost::alloc::string::String {
1382 "envoy.config.route.v3.RouteAction.HashPolicy.Cookie".into()
1383 }
1384 fn type_url() -> ::prost::alloc::string::String {
1385 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy.Cookie"
1386 .into()
1387 }
1388 }
1389 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1390 pub struct ConnectionProperties {
1391 /// Hash on source IP address.
1392 #[prost(bool, tag = "1")]
1393 pub source_ip: bool,
1394 }
1395 impl ::prost::Name for ConnectionProperties {
1396 const NAME: &'static str = "ConnectionProperties";
1397 const PACKAGE: &'static str = "envoy.config.route.v3";
1398 fn full_name() -> ::prost::alloc::string::String {
1399 "envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties"
1400 .into()
1401 }
1402 fn type_url() -> ::prost::alloc::string::String {
1403 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties"
1404 .into()
1405 }
1406 }
1407 #[derive(Clone, PartialEq, ::prost::Message)]
1408 pub struct QueryParameter {
1409 /// The name of the URL query parameter that will be used to obtain the hash
1410 /// key. If the parameter is not present, no hash will be produced. Query
1411 /// parameter names are case-sensitive. If query parameters are repeated, only
1412 /// the first value will be considered.
1413 #[prost(string, tag = "1")]
1414 pub name: ::prost::alloc::string::String,
1415 }
1416 impl ::prost::Name for QueryParameter {
1417 const NAME: &'static str = "QueryParameter";
1418 const PACKAGE: &'static str = "envoy.config.route.v3";
1419 fn full_name() -> ::prost::alloc::string::String {
1420 "envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter".into()
1421 }
1422 fn type_url() -> ::prost::alloc::string::String {
1423 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter"
1424 .into()
1425 }
1426 }
1427 #[derive(Clone, PartialEq, ::prost::Message)]
1428 pub struct FilterState {
1429 /// The name of the Object in the per-request filterState, which is an
1430 /// Envoy::Hashable object. If there is no data associated with the key,
1431 /// or the stored object is not Envoy::Hashable, no hash will be produced.
1432 #[prost(string, tag = "1")]
1433 pub key: ::prost::alloc::string::String,
1434 }
1435 impl ::prost::Name for FilterState {
1436 const NAME: &'static str = "FilterState";
1437 const PACKAGE: &'static str = "envoy.config.route.v3";
1438 fn full_name() -> ::prost::alloc::string::String {
1439 "envoy.config.route.v3.RouteAction.HashPolicy.FilterState".into()
1440 }
1441 fn type_url() -> ::prost::alloc::string::String {
1442 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy.FilterState"
1443 .into()
1444 }
1445 }
1446 #[derive(Clone, PartialEq, ::prost::Oneof)]
1447 pub enum PolicySpecifier {
1448 /// Header hash policy.
1449 #[prost(message, tag = "1")]
1450 Header(Header),
1451 /// Cookie hash policy.
1452 #[prost(message, tag = "2")]
1453 Cookie(Cookie),
1454 /// Connection properties hash policy.
1455 #[prost(message, tag = "3")]
1456 ConnectionProperties(ConnectionProperties),
1457 /// Query parameter hash policy.
1458 #[prost(message, tag = "5")]
1459 QueryParameter(QueryParameter),
1460 /// Filter state hash policy.
1461 #[prost(message, tag = "6")]
1462 FilterState(FilterState),
1463 }
1464 }
1465 impl ::prost::Name for HashPolicy {
1466 const NAME: &'static str = "HashPolicy";
1467 const PACKAGE: &'static str = "envoy.config.route.v3";
1468 fn full_name() -> ::prost::alloc::string::String {
1469 "envoy.config.route.v3.RouteAction.HashPolicy".into()
1470 }
1471 fn type_url() -> ::prost::alloc::string::String {
1472 "type.googleapis.com/envoy.config.route.v3.RouteAction.HashPolicy".into()
1473 }
1474 }
1475 /// Allows enabling and disabling upgrades on a per-route basis.
1476 /// This overrides any enabled/disabled upgrade filter chain specified in the
1477 /// HttpConnectionManager
1478 /// :ref:`upgrade_configs
1479 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.upgrade_configs>`
1480 /// but does not affect any custom filter chain specified there.
1481 #[derive(Clone, PartialEq, ::prost::Message)]
1482 pub struct UpgradeConfig {
1483 /// The case-insensitive name of this upgrade, e.g. "websocket".
1484 /// For each upgrade type present in upgrade_configs, requests with
1485 /// Upgrade: \[upgrade_type\] will be proxied upstream.
1486 #[prost(string, tag = "1")]
1487 pub upgrade_type: ::prost::alloc::string::String,
1488 /// Determines if upgrades are available on this route. Defaults to true.
1489 #[prost(message, optional, tag = "2")]
1490 pub enabled: ::core::option::Option<
1491 super::super::super::super::super::google::protobuf::BoolValue,
1492 >,
1493 /// Configuration for sending data upstream as a raw data payload. This is used for
1494 /// CONNECT requests, when forwarding CONNECT payload as raw TCP.
1495 /// Note that CONNECT support is currently considered alpha in Envoy.
1496 /// \[#comment: TODO(htuch): Replace the above comment with an alpha tag.\]
1497 #[prost(message, optional, tag = "3")]
1498 pub connect_config: ::core::option::Option<upgrade_config::ConnectConfig>,
1499 }
1500 /// Nested message and enum types in `UpgradeConfig`.
1501 pub mod upgrade_config {
1502 /// Configuration for sending data upstream as a raw data payload. This is used for
1503 /// CONNECT or POST requests, when forwarding request payload as raw TCP.
1504 #[derive(Clone, PartialEq, ::prost::Message)]
1505 pub struct ConnectConfig {
1506 /// If present, the proxy protocol header will be prepended to the CONNECT payload sent upstream.
1507 #[prost(message, optional, tag = "1")]
1508 pub proxy_protocol_config: ::core::option::Option<
1509 super::super::super::super::core::v3::ProxyProtocolConfig,
1510 >,
1511 /// If set, the route will also allow forwarding POST payload as raw TCP.
1512 #[prost(bool, tag = "2")]
1513 pub allow_post: bool,
1514 }
1515 impl ::prost::Name for ConnectConfig {
1516 const NAME: &'static str = "ConnectConfig";
1517 const PACKAGE: &'static str = "envoy.config.route.v3";
1518 fn full_name() -> ::prost::alloc::string::String {
1519 "envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig".into()
1520 }
1521 fn type_url() -> ::prost::alloc::string::String {
1522 "type.googleapis.com/envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig"
1523 .into()
1524 }
1525 }
1526 }
1527 impl ::prost::Name for UpgradeConfig {
1528 const NAME: &'static str = "UpgradeConfig";
1529 const PACKAGE: &'static str = "envoy.config.route.v3";
1530 fn full_name() -> ::prost::alloc::string::String {
1531 "envoy.config.route.v3.RouteAction.UpgradeConfig".into()
1532 }
1533 fn type_url() -> ::prost::alloc::string::String {
1534 "type.googleapis.com/envoy.config.route.v3.RouteAction.UpgradeConfig".into()
1535 }
1536 }
1537 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1538 pub struct MaxStreamDuration {
1539 /// Specifies the maximum duration allowed for streams on the route. If not specified, the value
1540 /// from the :ref:`max_stream_duration
1541 /// <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.max_stream_duration>` field in
1542 /// :ref:`HttpConnectionManager.common_http_protocol_options
1543 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.common_http_protocol_options>`
1544 /// is used. If this field is set explicitly to zero, any
1545 /// HttpConnectionManager max_stream_duration timeout will be disabled for
1546 /// this route.
1547 #[prost(message, optional, tag = "1")]
1548 pub max_stream_duration: ::core::option::Option<
1549 super::super::super::super::super::google::protobuf::Duration,
1550 >,
1551 /// If present, and the request contains a `grpc-timeout header
1552 /// <<https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md>`_,> use that value as the
1553 /// ``max_stream_duration``, but limit the applied timeout to the maximum value specified here.
1554 /// If set to 0, the ``grpc-timeout`` header is used without modification.
1555 #[prost(message, optional, tag = "2")]
1556 pub grpc_timeout_header_max: ::core::option::Option<
1557 super::super::super::super::super::google::protobuf::Duration,
1558 >,
1559 /// If present, Envoy will adjust the timeout provided by the ``grpc-timeout`` header by
1560 /// subtracting the provided duration from the header. This is useful for allowing Envoy to set
1561 /// its global timeout to be less than that of the deadline imposed by the calling client, which
1562 /// makes it more likely that Envoy will handle the timeout instead of having the call canceled
1563 /// by the client. If, after applying the offset, the resulting timeout is zero or negative,
1564 /// the stream will timeout immediately.
1565 #[prost(message, optional, tag = "3")]
1566 pub grpc_timeout_header_offset: ::core::option::Option<
1567 super::super::super::super::super::google::protobuf::Duration,
1568 >,
1569 }
1570 impl ::prost::Name for MaxStreamDuration {
1571 const NAME: &'static str = "MaxStreamDuration";
1572 const PACKAGE: &'static str = "envoy.config.route.v3";
1573 fn full_name() -> ::prost::alloc::string::String {
1574 "envoy.config.route.v3.RouteAction.MaxStreamDuration".into()
1575 }
1576 fn type_url() -> ::prost::alloc::string::String {
1577 "type.googleapis.com/envoy.config.route.v3.RouteAction.MaxStreamDuration"
1578 .into()
1579 }
1580 }
1581 #[derive(
1582 Clone,
1583 Copy,
1584 Debug,
1585 PartialEq,
1586 Eq,
1587 Hash,
1588 PartialOrd,
1589 Ord,
1590 ::prost::Enumeration
1591 )]
1592 #[repr(i32)]
1593 pub enum ClusterNotFoundResponseCode {
1594 /// HTTP status code - 503 Service Unavailable.
1595 ServiceUnavailable = 0,
1596 /// HTTP status code - 404 Not Found.
1597 NotFound = 1,
1598 /// HTTP status code - 500 Internal Server Error.
1599 InternalServerError = 2,
1600 }
1601 impl ClusterNotFoundResponseCode {
1602 /// String value of the enum field names used in the ProtoBuf definition.
1603 ///
1604 /// The values are not transformed in any way and thus are considered stable
1605 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1606 pub fn as_str_name(&self) -> &'static str {
1607 match self {
1608 Self::ServiceUnavailable => "SERVICE_UNAVAILABLE",
1609 Self::NotFound => "NOT_FOUND",
1610 Self::InternalServerError => "INTERNAL_SERVER_ERROR",
1611 }
1612 }
1613 /// Creates an enum from field names used in the ProtoBuf definition.
1614 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1615 match value {
1616 "SERVICE_UNAVAILABLE" => Some(Self::ServiceUnavailable),
1617 "NOT_FOUND" => Some(Self::NotFound),
1618 "INTERNAL_SERVER_ERROR" => Some(Self::InternalServerError),
1619 _ => None,
1620 }
1621 }
1622 }
1623 /// Configures :ref:`internal redirect <arch_overview_internal_redirects>` behavior.
1624 /// \[#next-major-version: remove this definition - it's defined in the InternalRedirectPolicy message.\]
1625 #[derive(
1626 Clone,
1627 Copy,
1628 Debug,
1629 PartialEq,
1630 Eq,
1631 Hash,
1632 PartialOrd,
1633 Ord,
1634 ::prost::Enumeration
1635 )]
1636 #[repr(i32)]
1637 pub enum InternalRedirectAction {
1638 PassThroughInternalRedirect = 0,
1639 HandleInternalRedirect = 1,
1640 }
1641 impl InternalRedirectAction {
1642 /// String value of the enum field names used in the ProtoBuf definition.
1643 ///
1644 /// The values are not transformed in any way and thus are considered stable
1645 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1646 pub fn as_str_name(&self) -> &'static str {
1647 match self {
1648 Self::PassThroughInternalRedirect => "PASS_THROUGH_INTERNAL_REDIRECT",
1649 Self::HandleInternalRedirect => "HANDLE_INTERNAL_REDIRECT",
1650 }
1651 }
1652 /// Creates an enum from field names used in the ProtoBuf definition.
1653 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1654 match value {
1655 "PASS_THROUGH_INTERNAL_REDIRECT" => {
1656 Some(Self::PassThroughInternalRedirect)
1657 }
1658 "HANDLE_INTERNAL_REDIRECT" => Some(Self::HandleInternalRedirect),
1659 _ => None,
1660 }
1661 }
1662 }
1663 #[derive(Clone, PartialEq, ::prost::Oneof)]
1664 pub enum ClusterSpecifier {
1665 /// Indicates the upstream cluster to which the request should be routed
1666 /// to.
1667 #[prost(string, tag = "1")]
1668 Cluster(::prost::alloc::string::String),
1669 /// Envoy will determine the cluster to route to by reading the value of the
1670 /// HTTP header named by cluster_header from the request headers. If the
1671 /// header is not found or the referenced cluster does not exist, Envoy will
1672 /// return a 404 response.
1673 ///
1674 /// .. attention::
1675 ///
1676 /// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
1677 /// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
1678 ///
1679 /// .. note::
1680 ///
1681 /// If the header appears multiple times only the first value is used.
1682 #[prost(string, tag = "2")]
1683 ClusterHeader(::prost::alloc::string::String),
1684 /// Multiple upstream clusters can be specified for a given route. The
1685 /// request is routed to one of the upstream clusters based on weights
1686 /// assigned to each cluster. See
1687 /// :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
1688 /// for additional documentation.
1689 #[prost(message, tag = "3")]
1690 WeightedClusters(super::WeightedCluster),
1691 /// Name of the cluster specifier plugin to use to determine the cluster for requests on this route.
1692 /// The cluster specifier plugin name must be defined in the associated
1693 /// :ref:`cluster specifier plugins <envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins>`
1694 /// in the :ref:`name <envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name>` field.
1695 #[prost(string, tag = "37")]
1696 ClusterSpecifierPlugin(::prost::alloc::string::String),
1697 /// Custom cluster specifier plugin configuration to use to determine the cluster for requests
1698 /// on this route.
1699 #[prost(message, tag = "39")]
1700 InlineClusterSpecifierPlugin(super::ClusterSpecifierPlugin),
1701 }
1702 #[derive(Clone, PartialEq, ::prost::Oneof)]
1703 pub enum HostRewriteSpecifier {
1704 /// Indicates that during forwarding, the host header will be swapped with
1705 /// this value. Using this option will append the
1706 /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if
1707 /// :ref:`append_x_forwarded_host <envoy_v3_api_field_config.route.v3.RouteAction.append_x_forwarded_host>`
1708 /// is set.
1709 #[prost(string, tag = "6")]
1710 HostRewriteLiteral(::prost::alloc::string::String),
1711 /// Indicates that during forwarding, the host header will be swapped with
1712 /// the hostname of the upstream host chosen by the cluster manager. This
1713 /// option is applicable only when the destination cluster for a route is of
1714 /// type ``strict_dns`` or ``logical_dns``,
1715 /// or when :ref:`hostname <envoy_v3_api_field_config.endpoint.v3.Endpoint.hostname>`
1716 /// field is not empty. Setting this to true with other cluster types
1717 /// has no effect. Using this option will append the
1718 /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if
1719 /// :ref:`append_x_forwarded_host <envoy_v3_api_field_config.route.v3.RouteAction.append_x_forwarded_host>`
1720 /// is set.
1721 #[prost(message, tag = "7")]
1722 AutoHostRewrite(super::super::super::super::super::google::protobuf::BoolValue),
1723 /// Indicates that during forwarding, the host header will be swapped with the content of given
1724 /// downstream or :ref:`custom <config_http_conn_man_headers_custom_request_headers>` header.
1725 /// If header value is empty, host header is left intact. Using this option will append the
1726 /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if
1727 /// :ref:`append_x_forwarded_host <envoy_v3_api_field_config.route.v3.RouteAction.append_x_forwarded_host>`
1728 /// is set.
1729 ///
1730 /// .. attention::
1731 ///
1732 /// Pay attention to the potential security implications of using this option. Provided header
1733 /// must come from trusted source.
1734 ///
1735 /// .. note::
1736 ///
1737 /// If the header appears multiple times only the first value is used.
1738 #[prost(string, tag = "29")]
1739 HostRewriteHeader(::prost::alloc::string::String),
1740 /// Indicates that during forwarding, the host header will be swapped with
1741 /// the result of the regex substitution executed on path value with query and fragment removed.
1742 /// This is useful for transitioning variable content between path segment and subdomain.
1743 /// Using this option will append the
1744 /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if
1745 /// :ref:`append_x_forwarded_host <envoy_v3_api_field_config.route.v3.RouteAction.append_x_forwarded_host>`
1746 /// is set.
1747 ///
1748 /// For example with the following config:
1749 ///
1750 /// .. code-block:: yaml
1751 ///
1752 /// host_rewrite_path_regex:
1753 /// pattern:
1754 /// google_re2: {}
1755 /// regex: "^/(.+)/.+$"
1756 /// substitution: \1
1757 ///
1758 /// Would rewrite the host header to ``envoyproxy.io`` given the path ``/envoyproxy.io/some/path``.
1759 #[prost(message, tag = "35")]
1760 HostRewritePathRegex(
1761 super::super::super::super::r#type::matcher::v3::RegexMatchAndSubstitute,
1762 ),
1763 }
1764}
1765impl ::prost::Name for RouteAction {
1766 const NAME: &'static str = "RouteAction";
1767 const PACKAGE: &'static str = "envoy.config.route.v3";
1768 fn full_name() -> ::prost::alloc::string::String {
1769 "envoy.config.route.v3.RouteAction".into()
1770 }
1771 fn type_url() -> ::prost::alloc::string::String {
1772 "type.googleapis.com/envoy.config.route.v3.RouteAction".into()
1773 }
1774}
1775/// HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`.
1776/// \[#next-free-field: 14\]
1777#[derive(Clone, PartialEq, ::prost::Message)]
1778pub struct RetryPolicy {
1779 /// Specifies the conditions under which retry takes place. These are the same
1780 /// conditions documented for :ref:`config_http_filters_router_x-envoy-retry-on` and
1781 /// :ref:`config_http_filters_router_x-envoy-retry-grpc-on`.
1782 #[prost(string, tag = "1")]
1783 pub retry_on: ::prost::alloc::string::String,
1784 /// Specifies the allowed number of retries. This parameter is optional and
1785 /// defaults to 1. These are the same conditions documented for
1786 /// :ref:`config_http_filters_router_x-envoy-max-retries`.
1787 #[prost(message, optional, tag = "2")]
1788 pub num_retries: ::core::option::Option<
1789 super::super::super::super::google::protobuf::UInt32Value,
1790 >,
1791 /// Specifies a non-zero upstream timeout per retry attempt (including the initial attempt). This
1792 /// parameter is optional. The same conditions documented for
1793 /// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` apply.
1794 ///
1795 /// .. note::
1796 ///
1797 /// If left unspecified, Envoy will use the global
1798 /// :ref:`route timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` for the request.
1799 /// Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
1800 /// retry policy, a request that times out will not be retried as the total timeout budget
1801 /// would have been exhausted.
1802 #[prost(message, optional, tag = "3")]
1803 pub per_try_timeout: ::core::option::Option<
1804 super::super::super::super::google::protobuf::Duration,
1805 >,
1806 /// Specifies an upstream idle timeout per retry attempt (including the initial attempt). This
1807 /// parameter is optional and if absent there is no per try idle timeout. The semantics of the per
1808 /// try idle timeout are similar to the
1809 /// :ref:`route idle timeout <envoy_v3_api_field_config.route.v3.RouteAction.timeout>` and
1810 /// :ref:`stream idle timeout
1811 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
1812 /// both enforced by the HTTP connection manager. The difference is that this idle timeout
1813 /// is enforced by the router for each individual attempt and thus after all previous filters have
1814 /// run, as opposed to *before* all previous filters run for the other idle timeouts. This timeout
1815 /// is useful in cases in which total request timeout is bounded by a number of retries and a
1816 /// :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`, but
1817 /// there is a desire to ensure each try is making incremental progress. Note also that similar
1818 /// to :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`,
1819 /// this idle timeout does not start until after both the entire request has been received by the
1820 /// router *and* a connection pool connection has been obtained. Unlike
1821 /// :ref:`per_try_timeout <envoy_v3_api_field_config.route.v3.RetryPolicy.per_try_timeout>`,
1822 /// the idle timer continues once the response starts streaming back to the downstream client.
1823 /// This ensures that response data continues to make progress without using one of the HTTP
1824 /// connection manager idle timeouts.
1825 #[prost(message, optional, tag = "13")]
1826 pub per_try_idle_timeout: ::core::option::Option<
1827 super::super::super::super::google::protobuf::Duration,
1828 >,
1829 /// Specifies an implementation of a RetryPriority which is used to determine the
1830 /// distribution of load across priorities used for retries. Refer to
1831 /// :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more details.
1832 #[prost(message, optional, tag = "4")]
1833 pub retry_priority: ::core::option::Option<retry_policy::RetryPriority>,
1834 /// Specifies a collection of RetryHostPredicates that will be consulted when selecting a host
1835 /// for retries. If any of the predicates reject the host, host selection will be reattempted.
1836 /// Refer to :ref:`retry plugin configuration <arch_overview_http_retry_plugins>` for more
1837 /// details.
1838 #[prost(message, repeated, tag = "5")]
1839 pub retry_host_predicate: ::prost::alloc::vec::Vec<retry_policy::RetryHostPredicate>,
1840 /// Retry options predicates that will be applied prior to retrying a request. These predicates
1841 /// allow customizing request behavior between retries.
1842 /// \[#comment: add [#extension-category: envoy.retry_options_predicates\] when there are built-in extensions]
1843 #[prost(message, repeated, tag = "12")]
1844 pub retry_options_predicates: ::prost::alloc::vec::Vec<
1845 super::super::core::v3::TypedExtensionConfig,
1846 >,
1847 /// The maximum number of times host selection will be reattempted before giving up, at which
1848 /// point the host that was last selected will be routed to. If unspecified, this will default to
1849 /// retrying once.
1850 #[prost(int64, tag = "6")]
1851 pub host_selection_retry_max_attempts: i64,
1852 /// HTTP status codes that should trigger a retry in addition to those specified by retry_on.
1853 #[prost(uint32, repeated, tag = "7")]
1854 pub retriable_status_codes: ::prost::alloc::vec::Vec<u32>,
1855 /// Specifies parameters that control exponential retry back off. This parameter is optional, in which case the
1856 /// default base interval is 25 milliseconds or, if set, the current value of the
1857 /// ``upstream.base_retry_backoff_ms`` runtime parameter. The default maximum interval is 10 times
1858 /// the base interval. The documentation for :ref:`config_http_filters_router_x-envoy-max-retries`
1859 /// describes Envoy's back-off algorithm.
1860 #[prost(message, optional, tag = "8")]
1861 pub retry_back_off: ::core::option::Option<retry_policy::RetryBackOff>,
1862 /// Specifies parameters that control a retry back-off strategy that is used
1863 /// when the request is rate limited by the upstream server. The server may
1864 /// return a response header like ``Retry-After`` or ``X-RateLimit-Reset`` to
1865 /// provide feedback to the client on how long to wait before retrying. If
1866 /// configured, this back-off strategy will be used instead of the
1867 /// default exponential back off strategy (configured using ``retry_back_off``)
1868 /// whenever a response includes the matching headers.
1869 #[prost(message, optional, tag = "11")]
1870 pub rate_limited_retry_back_off: ::core::option::Option<
1871 retry_policy::RateLimitedRetryBackOff,
1872 >,
1873 /// HTTP response headers that trigger a retry if present in the response. A retry will be
1874 /// triggered if any of the header matches match the upstream response headers.
1875 /// The field is only consulted if 'retriable-headers' retry policy is active.
1876 #[prost(message, repeated, tag = "9")]
1877 pub retriable_headers: ::prost::alloc::vec::Vec<HeaderMatcher>,
1878 /// HTTP headers which must be present in the request for retries to be attempted.
1879 #[prost(message, repeated, tag = "10")]
1880 pub retriable_request_headers: ::prost::alloc::vec::Vec<HeaderMatcher>,
1881}
1882/// Nested message and enum types in `RetryPolicy`.
1883pub mod retry_policy {
1884 #[derive(Clone, PartialEq, ::prost::Message)]
1885 pub struct RetryPriority {
1886 #[prost(string, tag = "1")]
1887 pub name: ::prost::alloc::string::String,
1888 /// \[#extension-category: envoy.retry_priorities\]
1889 #[prost(oneof = "retry_priority::ConfigType", tags = "3")]
1890 pub config_type: ::core::option::Option<retry_priority::ConfigType>,
1891 }
1892 /// Nested message and enum types in `RetryPriority`.
1893 pub mod retry_priority {
1894 /// \[#extension-category: envoy.retry_priorities\]
1895 #[derive(Clone, PartialEq, ::prost::Oneof)]
1896 pub enum ConfigType {
1897 #[prost(message, tag = "3")]
1898 TypedConfig(super::super::super::super::super::super::google::protobuf::Any),
1899 }
1900 }
1901 impl ::prost::Name for RetryPriority {
1902 const NAME: &'static str = "RetryPriority";
1903 const PACKAGE: &'static str = "envoy.config.route.v3";
1904 fn full_name() -> ::prost::alloc::string::String {
1905 "envoy.config.route.v3.RetryPolicy.RetryPriority".into()
1906 }
1907 fn type_url() -> ::prost::alloc::string::String {
1908 "type.googleapis.com/envoy.config.route.v3.RetryPolicy.RetryPriority".into()
1909 }
1910 }
1911 #[derive(Clone, PartialEq, ::prost::Message)]
1912 pub struct RetryHostPredicate {
1913 #[prost(string, tag = "1")]
1914 pub name: ::prost::alloc::string::String,
1915 /// \[#extension-category: envoy.retry_host_predicates\]
1916 #[prost(oneof = "retry_host_predicate::ConfigType", tags = "3")]
1917 pub config_type: ::core::option::Option<retry_host_predicate::ConfigType>,
1918 }
1919 /// Nested message and enum types in `RetryHostPredicate`.
1920 pub mod retry_host_predicate {
1921 /// \[#extension-category: envoy.retry_host_predicates\]
1922 #[derive(Clone, PartialEq, ::prost::Oneof)]
1923 pub enum ConfigType {
1924 #[prost(message, tag = "3")]
1925 TypedConfig(super::super::super::super::super::super::google::protobuf::Any),
1926 }
1927 }
1928 impl ::prost::Name for RetryHostPredicate {
1929 const NAME: &'static str = "RetryHostPredicate";
1930 const PACKAGE: &'static str = "envoy.config.route.v3";
1931 fn full_name() -> ::prost::alloc::string::String {
1932 "envoy.config.route.v3.RetryPolicy.RetryHostPredicate".into()
1933 }
1934 fn type_url() -> ::prost::alloc::string::String {
1935 "type.googleapis.com/envoy.config.route.v3.RetryPolicy.RetryHostPredicate"
1936 .into()
1937 }
1938 }
1939 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1940 pub struct RetryBackOff {
1941 /// Specifies the base interval between retries. This parameter is required and must be greater
1942 /// than zero. Values less than 1 ms are rounded up to 1 ms.
1943 /// See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion of Envoy's
1944 /// back-off algorithm.
1945 #[prost(message, optional, tag = "1")]
1946 pub base_interval: ::core::option::Option<
1947 super::super::super::super::super::google::protobuf::Duration,
1948 >,
1949 /// Specifies the maximum interval between retries. This parameter is optional, but must be
1950 /// greater than or equal to the ``base_interval`` if set. The default is 10 times the
1951 /// ``base_interval``. See :ref:`config_http_filters_router_x-envoy-max-retries` for a discussion
1952 /// of Envoy's back-off algorithm.
1953 #[prost(message, optional, tag = "2")]
1954 pub max_interval: ::core::option::Option<
1955 super::super::super::super::super::google::protobuf::Duration,
1956 >,
1957 }
1958 impl ::prost::Name for RetryBackOff {
1959 const NAME: &'static str = "RetryBackOff";
1960 const PACKAGE: &'static str = "envoy.config.route.v3";
1961 fn full_name() -> ::prost::alloc::string::String {
1962 "envoy.config.route.v3.RetryPolicy.RetryBackOff".into()
1963 }
1964 fn type_url() -> ::prost::alloc::string::String {
1965 "type.googleapis.com/envoy.config.route.v3.RetryPolicy.RetryBackOff".into()
1966 }
1967 }
1968 #[derive(Clone, PartialEq, ::prost::Message)]
1969 pub struct ResetHeader {
1970 /// The name of the reset header.
1971 ///
1972 /// .. note::
1973 ///
1974 /// If the header appears multiple times only the first value is used.
1975 #[prost(string, tag = "1")]
1976 pub name: ::prost::alloc::string::String,
1977 /// The format of the reset header.
1978 #[prost(enumeration = "ResetHeaderFormat", tag = "2")]
1979 pub format: i32,
1980 }
1981 impl ::prost::Name for ResetHeader {
1982 const NAME: &'static str = "ResetHeader";
1983 const PACKAGE: &'static str = "envoy.config.route.v3";
1984 fn full_name() -> ::prost::alloc::string::String {
1985 "envoy.config.route.v3.RetryPolicy.ResetHeader".into()
1986 }
1987 fn type_url() -> ::prost::alloc::string::String {
1988 "type.googleapis.com/envoy.config.route.v3.RetryPolicy.ResetHeader".into()
1989 }
1990 }
1991 /// A retry back-off strategy that applies when the upstream server rate limits
1992 /// the request.
1993 ///
1994 /// Given this configuration:
1995 ///
1996 /// .. code-block:: yaml
1997 ///
1998 /// rate_limited_retry_back_off:
1999 /// reset_headers:
2000 /// - name: Retry-After
2001 /// format: SECONDS
2002 /// - name: X-RateLimit-Reset
2003 /// format: UNIX_TIMESTAMP
2004 /// max_interval: "300s"
2005 ///
2006 /// The following algorithm will apply:
2007 ///
2008 /// 1. If the response contains the header ``Retry-After`` its value must be on
2009 /// the form ``120`` (an integer that represents the number of seconds to
2010 /// wait before retrying). If so, this value is used as the back-off interval.
2011 /// 2. Otherwise, if the response contains the header ``X-RateLimit-Reset`` its
2012 /// value must be on the form ``1595320702`` (an integer that represents the
2013 /// point in time at which to retry, as a Unix timestamp in seconds). If so,
2014 /// the current time is subtracted from this value and the result is used as
2015 /// the back-off interval.
2016 /// 3. Otherwise, Envoy will use the default
2017 /// :ref:`exponential back-off <envoy_v3_api_field_config.route.v3.RetryPolicy.retry_back_off>`
2018 /// strategy.
2019 ///
2020 /// No matter which format is used, if the resulting back-off interval exceeds
2021 /// ``max_interval`` it is discarded and the next header in ``reset_headers``
2022 /// is tried. If a request timeout is configured for the route it will further
2023 /// limit how long the request will be allowed to run.
2024 ///
2025 /// To prevent many clients retrying at the same point in time jitter is added
2026 /// to the back-off interval, so the resulting interval is decided by taking:
2027 /// ``random(interval, interval * 1.5)``.
2028 ///
2029 /// .. attention::
2030 ///
2031 /// Configuring ``rate_limited_retry_back_off`` will not by itself cause a request
2032 /// to be retried. You will still need to configure the right retry policy to match
2033 /// the responses from the upstream server.
2034 #[derive(Clone, PartialEq, ::prost::Message)]
2035 pub struct RateLimitedRetryBackOff {
2036 /// Specifies the reset headers (like ``Retry-After`` or ``X-RateLimit-Reset``)
2037 /// to match against the response. Headers are tried in order, and matched case
2038 /// insensitive. The first header to be parsed successfully is used. If no headers
2039 /// match the default exponential back-off is used instead.
2040 #[prost(message, repeated, tag = "1")]
2041 pub reset_headers: ::prost::alloc::vec::Vec<ResetHeader>,
2042 /// Specifies the maximum back off interval that Envoy will allow. If a reset
2043 /// header contains an interval longer than this then it will be discarded and
2044 /// the next header will be tried. Defaults to 300 seconds.
2045 #[prost(message, optional, tag = "2")]
2046 pub max_interval: ::core::option::Option<
2047 super::super::super::super::super::google::protobuf::Duration,
2048 >,
2049 }
2050 impl ::prost::Name for RateLimitedRetryBackOff {
2051 const NAME: &'static str = "RateLimitedRetryBackOff";
2052 const PACKAGE: &'static str = "envoy.config.route.v3";
2053 fn full_name() -> ::prost::alloc::string::String {
2054 "envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff".into()
2055 }
2056 fn type_url() -> ::prost::alloc::string::String {
2057 "type.googleapis.com/envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff"
2058 .into()
2059 }
2060 }
2061 #[derive(
2062 Clone,
2063 Copy,
2064 Debug,
2065 PartialEq,
2066 Eq,
2067 Hash,
2068 PartialOrd,
2069 Ord,
2070 ::prost::Enumeration
2071 )]
2072 #[repr(i32)]
2073 pub enum ResetHeaderFormat {
2074 Seconds = 0,
2075 UnixTimestamp = 1,
2076 }
2077 impl ResetHeaderFormat {
2078 /// String value of the enum field names used in the ProtoBuf definition.
2079 ///
2080 /// The values are not transformed in any way and thus are considered stable
2081 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2082 pub fn as_str_name(&self) -> &'static str {
2083 match self {
2084 Self::Seconds => "SECONDS",
2085 Self::UnixTimestamp => "UNIX_TIMESTAMP",
2086 }
2087 }
2088 /// Creates an enum from field names used in the ProtoBuf definition.
2089 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2090 match value {
2091 "SECONDS" => Some(Self::Seconds),
2092 "UNIX_TIMESTAMP" => Some(Self::UnixTimestamp),
2093 _ => None,
2094 }
2095 }
2096 }
2097}
2098impl ::prost::Name for RetryPolicy {
2099 const NAME: &'static str = "RetryPolicy";
2100 const PACKAGE: &'static str = "envoy.config.route.v3";
2101 fn full_name() -> ::prost::alloc::string::String {
2102 "envoy.config.route.v3.RetryPolicy".into()
2103 }
2104 fn type_url() -> ::prost::alloc::string::String {
2105 "type.googleapis.com/envoy.config.route.v3.RetryPolicy".into()
2106 }
2107}
2108/// HTTP request hedging :ref:`architecture overview <arch_overview_http_routing_hedging>`.
2109#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2110pub struct HedgePolicy {
2111 /// Specifies the number of initial requests that should be sent upstream.
2112 /// Must be at least 1.
2113 /// Defaults to 1.
2114 /// \[#not-implemented-hide:\]
2115 #[prost(message, optional, tag = "1")]
2116 pub initial_requests: ::core::option::Option<
2117 super::super::super::super::google::protobuf::UInt32Value,
2118 >,
2119 /// Specifies a probability that an additional upstream request should be sent
2120 /// on top of what is specified by initial_requests.
2121 /// Defaults to 0.
2122 /// \[#not-implemented-hide:\]
2123 #[prost(message, optional, tag = "2")]
2124 pub additional_request_chance: ::core::option::Option<
2125 super::super::super::r#type::v3::FractionalPercent,
2126 >,
2127 /// Indicates that a hedged request should be sent when the per-try timeout is hit.
2128 /// This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
2129 /// The first request to complete successfully will be the one returned to the caller.
2130 ///
2131 /// * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
2132 /// * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client
2133 /// if there are no more retries left.
2134 /// * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
2135 ///
2136 /// Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_v3_api_msg_config.route.v3.RetryPolicy>` that retries at least
2137 /// one error code and specifies a maximum number of retries.
2138 ///
2139 /// Defaults to false.
2140 #[prost(bool, tag = "3")]
2141 pub hedge_on_per_try_timeout: bool,
2142}
2143impl ::prost::Name for HedgePolicy {
2144 const NAME: &'static str = "HedgePolicy";
2145 const PACKAGE: &'static str = "envoy.config.route.v3";
2146 fn full_name() -> ::prost::alloc::string::String {
2147 "envoy.config.route.v3.HedgePolicy".into()
2148 }
2149 fn type_url() -> ::prost::alloc::string::String {
2150 "type.googleapis.com/envoy.config.route.v3.HedgePolicy".into()
2151 }
2152}
2153/// \[#next-free-field: 10\]
2154#[derive(Clone, PartialEq, ::prost::Message)]
2155pub struct RedirectAction {
2156 /// The host portion of the URL will be swapped with this value.
2157 #[prost(string, tag = "1")]
2158 pub host_redirect: ::prost::alloc::string::String,
2159 /// The port value of the URL will be swapped with this value.
2160 #[prost(uint32, tag = "8")]
2161 pub port_redirect: u32,
2162 /// The HTTP status code to use in the redirect response. The default response
2163 /// code is MOVED_PERMANENTLY (301).
2164 #[prost(enumeration = "redirect_action::RedirectResponseCode", tag = "3")]
2165 pub response_code: i32,
2166 /// Indicates that during redirection, the query portion of the URL will
2167 /// be removed. Default value is false.
2168 #[prost(bool, tag = "6")]
2169 pub strip_query: bool,
2170 /// When the scheme redirection take place, the following rules apply:
2171 /// 1. If the source URI scheme is ``http`` and the port is explicitly
2172 /// set to ``:80``, the port will be removed after the redirection
2173 /// 2. If the source URI scheme is ``https`` and the port is explicitly
2174 /// set to ``:443``, the port will be removed after the redirection
2175 #[prost(oneof = "redirect_action::SchemeRewriteSpecifier", tags = "4, 7")]
2176 pub scheme_rewrite_specifier: ::core::option::Option<
2177 redirect_action::SchemeRewriteSpecifier,
2178 >,
2179 #[prost(oneof = "redirect_action::PathRewriteSpecifier", tags = "2, 5, 9")]
2180 pub path_rewrite_specifier: ::core::option::Option<
2181 redirect_action::PathRewriteSpecifier,
2182 >,
2183}
2184/// Nested message and enum types in `RedirectAction`.
2185pub mod redirect_action {
2186 #[derive(
2187 Clone,
2188 Copy,
2189 Debug,
2190 PartialEq,
2191 Eq,
2192 Hash,
2193 PartialOrd,
2194 Ord,
2195 ::prost::Enumeration
2196 )]
2197 #[repr(i32)]
2198 pub enum RedirectResponseCode {
2199 /// Moved Permanently HTTP Status Code - 301.
2200 MovedPermanently = 0,
2201 /// Found HTTP Status Code - 302.
2202 Found = 1,
2203 /// See Other HTTP Status Code - 303.
2204 SeeOther = 2,
2205 /// Temporary Redirect HTTP Status Code - 307.
2206 TemporaryRedirect = 3,
2207 /// Permanent Redirect HTTP Status Code - 308.
2208 PermanentRedirect = 4,
2209 }
2210 impl RedirectResponseCode {
2211 /// String value of the enum field names used in the ProtoBuf definition.
2212 ///
2213 /// The values are not transformed in any way and thus are considered stable
2214 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2215 pub fn as_str_name(&self) -> &'static str {
2216 match self {
2217 Self::MovedPermanently => "MOVED_PERMANENTLY",
2218 Self::Found => "FOUND",
2219 Self::SeeOther => "SEE_OTHER",
2220 Self::TemporaryRedirect => "TEMPORARY_REDIRECT",
2221 Self::PermanentRedirect => "PERMANENT_REDIRECT",
2222 }
2223 }
2224 /// Creates an enum from field names used in the ProtoBuf definition.
2225 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2226 match value {
2227 "MOVED_PERMANENTLY" => Some(Self::MovedPermanently),
2228 "FOUND" => Some(Self::Found),
2229 "SEE_OTHER" => Some(Self::SeeOther),
2230 "TEMPORARY_REDIRECT" => Some(Self::TemporaryRedirect),
2231 "PERMANENT_REDIRECT" => Some(Self::PermanentRedirect),
2232 _ => None,
2233 }
2234 }
2235 }
2236 /// When the scheme redirection take place, the following rules apply:
2237 /// 1. If the source URI scheme is ``http`` and the port is explicitly
2238 /// set to ``:80``, the port will be removed after the redirection
2239 /// 2. If the source URI scheme is ``https`` and the port is explicitly
2240 /// set to ``:443``, the port will be removed after the redirection
2241 #[derive(Clone, PartialEq, ::prost::Oneof)]
2242 pub enum SchemeRewriteSpecifier {
2243 /// The scheme portion of the URL will be swapped with "https".
2244 #[prost(bool, tag = "4")]
2245 HttpsRedirect(bool),
2246 /// The scheme portion of the URL will be swapped with this value.
2247 #[prost(string, tag = "7")]
2248 SchemeRedirect(::prost::alloc::string::String),
2249 }
2250 #[derive(Clone, PartialEq, ::prost::Oneof)]
2251 pub enum PathRewriteSpecifier {
2252 /// The path portion of the URL will be swapped with this value.
2253 /// Please note that query string in path_redirect will override the
2254 /// request's query string and will not be stripped.
2255 ///
2256 /// For example, let's say we have the following routes:
2257 ///
2258 /// - match: { path: "/old-path-1" }
2259 /// redirect: { path_redirect: "/new-path-1" }
2260 /// - match: { path: "/old-path-2" }
2261 /// redirect: { path_redirect: "/new-path-2", strip-query: "true" }
2262 /// - match: { path: "/old-path-3" }
2263 /// redirect: { path_redirect: "/new-path-3?foo=1", strip_query: "true" }
2264 ///
2265 /// 1. if request uri is "/old-path-1?bar=1", users will be redirected to "/new-path-1?bar=1"
2266 /// 2. if request uri is "/old-path-2?bar=1", users will be redirected to "/new-path-2"
2267 /// 3. if request uri is "/old-path-3?bar=1", users will be redirected to "/new-path-3?foo=1"
2268 #[prost(string, tag = "2")]
2269 PathRedirect(::prost::alloc::string::String),
2270 /// Indicates that during redirection, the matched prefix (or path)
2271 /// should be swapped with this value. This option allows redirect URLs be dynamically created
2272 /// based on the request.
2273 ///
2274 /// .. attention::
2275 ///
2276 /// Pay attention to the use of trailing slashes as mentioned in
2277 /// :ref:`RouteAction's prefix_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.prefix_rewrite>`.
2278 #[prost(string, tag = "5")]
2279 PrefixRewrite(::prost::alloc::string::String),
2280 /// Indicates that during redirect, portions of the path that match the
2281 /// pattern should be rewritten, even allowing the substitution of capture
2282 /// groups from the pattern into the new path as specified by the rewrite
2283 /// substitution string. This is useful to allow application paths to be
2284 /// rewritten in a way that is aware of segments with variable content like
2285 /// identifiers.
2286 ///
2287 /// Examples using Google's `RE2 <<https://github.com/google/re2>`_> engine:
2288 ///
2289 /// * The path pattern ``^/service/(\[^/\]+)(/.*)$`` paired with a substitution
2290 /// string of ``\2/instance/\1`` would transform ``/service/foo/v1/api``
2291 /// into ``/v1/api/instance/foo``.
2292 ///
2293 /// * The pattern ``one`` paired with a substitution string of ``two`` would
2294 /// transform ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/two/zzz``.
2295 ///
2296 /// * The pattern ``^(.*?)one(.*)$`` paired with a substitution string of
2297 /// ``\1two\2`` would replace only the first occurrence of ``one``,
2298 /// transforming path ``/xxx/one/yyy/one/zzz`` into ``/xxx/two/yyy/one/zzz``.
2299 ///
2300 /// * The pattern ``(?i)/xxx/`` paired with a substitution string of ``/yyy/``
2301 /// would do a case-insensitive match and transform path ``/aaa/XxX/bbb`` to
2302 /// ``/aaa/yyy/bbb``.
2303 #[prost(message, tag = "9")]
2304 RegexRewrite(
2305 super::super::super::super::r#type::matcher::v3::RegexMatchAndSubstitute,
2306 ),
2307 }
2308}
2309impl ::prost::Name for RedirectAction {
2310 const NAME: &'static str = "RedirectAction";
2311 const PACKAGE: &'static str = "envoy.config.route.v3";
2312 fn full_name() -> ::prost::alloc::string::String {
2313 "envoy.config.route.v3.RedirectAction".into()
2314 }
2315 fn type_url() -> ::prost::alloc::string::String {
2316 "type.googleapis.com/envoy.config.route.v3.RedirectAction".into()
2317 }
2318}
2319#[derive(Clone, PartialEq, ::prost::Message)]
2320pub struct DirectResponseAction {
2321 /// Specifies the HTTP response status to be returned.
2322 #[prost(uint32, tag = "1")]
2323 pub status: u32,
2324 /// Specifies the content of the response body. If this setting is omitted,
2325 /// no body is included in the generated response.
2326 ///
2327 /// .. note::
2328 ///
2329 /// Headers can be specified using ``response_headers_to_add`` in the enclosing
2330 /// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` or
2331 /// :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`.
2332 #[prost(message, optional, tag = "2")]
2333 pub body: ::core::option::Option<super::super::core::v3::DataSource>,
2334}
2335impl ::prost::Name for DirectResponseAction {
2336 const NAME: &'static str = "DirectResponseAction";
2337 const PACKAGE: &'static str = "envoy.config.route.v3";
2338 fn full_name() -> ::prost::alloc::string::String {
2339 "envoy.config.route.v3.DirectResponseAction".into()
2340 }
2341 fn type_url() -> ::prost::alloc::string::String {
2342 "type.googleapis.com/envoy.config.route.v3.DirectResponseAction".into()
2343 }
2344}
2345/// \[#not-implemented-hide:\]
2346#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2347pub struct NonForwardingAction {}
2348impl ::prost::Name for NonForwardingAction {
2349 const NAME: &'static str = "NonForwardingAction";
2350 const PACKAGE: &'static str = "envoy.config.route.v3";
2351 fn full_name() -> ::prost::alloc::string::String {
2352 "envoy.config.route.v3.NonForwardingAction".into()
2353 }
2354 fn type_url() -> ::prost::alloc::string::String {
2355 "type.googleapis.com/envoy.config.route.v3.NonForwardingAction".into()
2356 }
2357}
2358#[derive(Clone, PartialEq, ::prost::Message)]
2359pub struct Decorator {
2360 /// The operation name associated with the request matched to this route. If tracing is
2361 /// enabled, this information will be used as the span name reported for this request.
2362 ///
2363 /// .. note::
2364 ///
2365 /// For ingress (inbound) requests, or egress (outbound) responses, this value may be overridden
2366 /// by the :ref:`x-envoy-decorator-operation
2367 /// <config_http_filters_router_x-envoy-decorator-operation>` header.
2368 #[prost(string, tag = "1")]
2369 pub operation: ::prost::alloc::string::String,
2370 /// Whether the decorated details should be propagated to the other party. The default is true.
2371 #[prost(message, optional, tag = "2")]
2372 pub propagate: ::core::option::Option<
2373 super::super::super::super::google::protobuf::BoolValue,
2374 >,
2375}
2376impl ::prost::Name for Decorator {
2377 const NAME: &'static str = "Decorator";
2378 const PACKAGE: &'static str = "envoy.config.route.v3";
2379 fn full_name() -> ::prost::alloc::string::String {
2380 "envoy.config.route.v3.Decorator".into()
2381 }
2382 fn type_url() -> ::prost::alloc::string::String {
2383 "type.googleapis.com/envoy.config.route.v3.Decorator".into()
2384 }
2385}
2386#[derive(Clone, PartialEq, ::prost::Message)]
2387pub struct Tracing {
2388 /// Target percentage of requests managed by this HTTP connection manager that will be force
2389 /// traced if the :ref:`x-client-trace-id <config_http_conn_man_headers_x-client-trace-id>`
2390 /// header is set. This field is a direct analog for the runtime variable
2391 /// 'tracing.client_enabled' in the :ref:`HTTP Connection Manager
2392 /// <config_http_conn_man_runtime>`.
2393 /// Default: 100%
2394 #[prost(message, optional, tag = "1")]
2395 pub client_sampling: ::core::option::Option<
2396 super::super::super::r#type::v3::FractionalPercent,
2397 >,
2398 /// Target percentage of requests managed by this HTTP connection manager that will be randomly
2399 /// selected for trace generation, if not requested by the client or not forced. This field is
2400 /// a direct analog for the runtime variable 'tracing.random_sampling' in the
2401 /// :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`.
2402 /// Default: 100%
2403 #[prost(message, optional, tag = "2")]
2404 pub random_sampling: ::core::option::Option<
2405 super::super::super::r#type::v3::FractionalPercent,
2406 >,
2407 /// Target percentage of requests managed by this HTTP connection manager that will be traced
2408 /// after all other sampling checks have been applied (client-directed, force tracing, random
2409 /// sampling). This field functions as an upper limit on the total configured sampling rate. For
2410 /// instance, setting client_sampling to 100% but overall_sampling to 1% will result in only 1%
2411 /// of client requests with the appropriate headers to be force traced. This field is a direct
2412 /// analog for the runtime variable 'tracing.global_enabled' in the
2413 /// :ref:`HTTP Connection Manager <config_http_conn_man_runtime>`.
2414 /// Default: 100%
2415 #[prost(message, optional, tag = "3")]
2416 pub overall_sampling: ::core::option::Option<
2417 super::super::super::r#type::v3::FractionalPercent,
2418 >,
2419 /// A list of custom tags with unique tag name to create tags for the active span.
2420 /// It will take effect after merging with the :ref:`corresponding configuration
2421 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing.custom_tags>`
2422 /// configured in the HTTP connection manager. If two tags with the same name are configured
2423 /// each in the HTTP connection manager and the route level, the one configured here takes
2424 /// priority.
2425 #[prost(message, repeated, tag = "4")]
2426 pub custom_tags: ::prost::alloc::vec::Vec<
2427 super::super::super::r#type::tracing::v3::CustomTag,
2428 >,
2429}
2430impl ::prost::Name for Tracing {
2431 const NAME: &'static str = "Tracing";
2432 const PACKAGE: &'static str = "envoy.config.route.v3";
2433 fn full_name() -> ::prost::alloc::string::String {
2434 "envoy.config.route.v3.Tracing".into()
2435 }
2436 fn type_url() -> ::prost::alloc::string::String {
2437 "type.googleapis.com/envoy.config.route.v3.Tracing".into()
2438 }
2439}
2440/// A virtual cluster is a way of specifying a regex matching rule against
2441/// certain important endpoints such that statistics are generated explicitly for
2442/// the matched requests. The reason this is useful is that when doing
2443/// prefix/path matching Envoy does not always know what the application
2444/// considers to be an endpoint. Thus, it’s impossible for Envoy to generically
2445/// emit per endpoint statistics. However, often systems have highly critical
2446/// endpoints that they wish to get “perfect” statistics on. Virtual cluster
2447/// statistics are perfect in the sense that they are emitted on the downstream
2448/// side such that they include network level failures.
2449///
2450/// Documentation for :ref:`virtual cluster statistics <config_http_filters_router_vcluster_stats>`.
2451///
2452/// .. note::
2453///
2454/// Virtual clusters are a useful tool, but we do not recommend setting up a virtual cluster for
2455/// every application endpoint. This is both not easily maintainable and as well the matching and
2456/// statistics output are not free.
2457#[derive(Clone, PartialEq, ::prost::Message)]
2458pub struct VirtualCluster {
2459 /// Specifies a list of header matchers to use for matching requests. Each specified header must
2460 /// match. The pseudo-headers ``:path`` and ``:method`` can be used to match the request path and
2461 /// method, respectively.
2462 #[prost(message, repeated, tag = "4")]
2463 pub headers: ::prost::alloc::vec::Vec<HeaderMatcher>,
2464 /// Specifies the name of the virtual cluster. The virtual cluster name as well
2465 /// as the virtual host name are used when emitting statistics. The statistics are emitted by the
2466 /// router filter and are documented :ref:`here <config_http_filters_router_stats>`.
2467 #[prost(string, tag = "2")]
2468 pub name: ::prost::alloc::string::String,
2469}
2470impl ::prost::Name for VirtualCluster {
2471 const NAME: &'static str = "VirtualCluster";
2472 const PACKAGE: &'static str = "envoy.config.route.v3";
2473 fn full_name() -> ::prost::alloc::string::String {
2474 "envoy.config.route.v3.VirtualCluster".into()
2475 }
2476 fn type_url() -> ::prost::alloc::string::String {
2477 "type.googleapis.com/envoy.config.route.v3.VirtualCluster".into()
2478 }
2479}
2480/// Global rate limiting :ref:`architecture overview <arch_overview_global_rate_limit>`.
2481/// Also applies to Local rate limiting :ref:`using descriptors <config_http_filters_local_rate_limit_descriptors>`.
2482#[derive(Clone, PartialEq, ::prost::Message)]
2483pub struct RateLimit {
2484 /// Refers to the stage set in the filter. The rate limit configuration only
2485 /// applies to filters with the same stage number. The default stage number is
2486 /// 0.
2487 ///
2488 /// .. note::
2489 ///
2490 /// The filter supports a range of 0 - 10 inclusively for stage numbers.
2491 #[prost(message, optional, tag = "1")]
2492 pub stage: ::core::option::Option<
2493 super::super::super::super::google::protobuf::UInt32Value,
2494 >,
2495 /// The key to be set in runtime to disable this rate limit configuration.
2496 #[prost(string, tag = "2")]
2497 pub disable_key: ::prost::alloc::string::String,
2498 /// A list of actions that are to be applied for this rate limit configuration.
2499 /// Order matters as the actions are processed sequentially and the descriptor
2500 /// is composed by appending descriptor entries in that sequence. If an action
2501 /// cannot append a descriptor entry, no descriptor is generated for the
2502 /// configuration. See :ref:`composing actions
2503 /// <config_http_filters_rate_limit_composing_actions>` for additional documentation.
2504 #[prost(message, repeated, tag = "3")]
2505 pub actions: ::prost::alloc::vec::Vec<rate_limit::Action>,
2506 /// An optional limit override to be appended to the descriptor produced by this
2507 /// rate limit configuration. If the override value is invalid or cannot be resolved
2508 /// from metadata, no override is provided. See :ref:`rate limit override
2509 /// <config_http_filters_rate_limit_rate_limit_override>` for more information.
2510 #[prost(message, optional, tag = "4")]
2511 pub limit: ::core::option::Option<rate_limit::Override>,
2512}
2513/// Nested message and enum types in `RateLimit`.
2514pub mod rate_limit {
2515 /// \[#next-free-field: 12\]
2516 #[derive(Clone, PartialEq, ::prost::Message)]
2517 pub struct Action {
2518 #[prost(
2519 oneof = "action::ActionSpecifier",
2520 tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11"
2521 )]
2522 pub action_specifier: ::core::option::Option<action::ActionSpecifier>,
2523 }
2524 /// Nested message and enum types in `Action`.
2525 pub mod action {
2526 /// The following descriptor entry is appended to the descriptor:
2527 ///
2528 /// .. code-block:: cpp
2529 ///
2530 /// ("source_cluster", "<local service cluster>")
2531 ///
2532 /// <local service cluster> is derived from the :option:`--service-cluster` option.
2533 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2534 pub struct SourceCluster {}
2535 impl ::prost::Name for SourceCluster {
2536 const NAME: &'static str = "SourceCluster";
2537 const PACKAGE: &'static str = "envoy.config.route.v3";
2538 fn full_name() -> ::prost::alloc::string::String {
2539 "envoy.config.route.v3.RateLimit.Action.SourceCluster".into()
2540 }
2541 fn type_url() -> ::prost::alloc::string::String {
2542 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.SourceCluster"
2543 .into()
2544 }
2545 }
2546 /// The following descriptor entry is appended to the descriptor:
2547 ///
2548 /// .. code-block:: cpp
2549 ///
2550 /// ("destination_cluster", "<routed target cluster>")
2551 ///
2552 /// Once a request matches against a route table rule, a routed cluster is determined by one of
2553 /// the following :ref:`route table configuration <envoy_v3_api_msg_config.route.v3.RouteConfiguration>`
2554 /// settings:
2555 ///
2556 /// * :ref:`cluster <envoy_v3_api_field_config.route.v3.RouteAction.cluster>` indicates the upstream cluster
2557 /// to route to.
2558 /// * :ref:`weighted_clusters <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>`
2559 /// chooses a cluster randomly from a set of clusters with attributed weight.
2560 /// * :ref:`cluster_header <envoy_v3_api_field_config.route.v3.RouteAction.cluster_header>` indicates which
2561 /// header in the request contains the target cluster.
2562 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2563 pub struct DestinationCluster {}
2564 impl ::prost::Name for DestinationCluster {
2565 const NAME: &'static str = "DestinationCluster";
2566 const PACKAGE: &'static str = "envoy.config.route.v3";
2567 fn full_name() -> ::prost::alloc::string::String {
2568 "envoy.config.route.v3.RateLimit.Action.DestinationCluster".into()
2569 }
2570 fn type_url() -> ::prost::alloc::string::String {
2571 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.DestinationCluster"
2572 .into()
2573 }
2574 }
2575 /// The following descriptor entry is appended when a header contains a key that matches the
2576 /// ``header_name``:
2577 ///
2578 /// .. code-block:: cpp
2579 ///
2580 /// ("<descriptor_key>", "<header_value_queried_from_header>")
2581 #[derive(Clone, PartialEq, ::prost::Message)]
2582 pub struct RequestHeaders {
2583 /// The header name to be queried from the request headers. The header’s
2584 /// value is used to populate the value of the descriptor entry for the
2585 /// descriptor_key.
2586 #[prost(string, tag = "1")]
2587 pub header_name: ::prost::alloc::string::String,
2588 /// The key to use in the descriptor entry.
2589 #[prost(string, tag = "2")]
2590 pub descriptor_key: ::prost::alloc::string::String,
2591 /// If set to true, Envoy skips the descriptor while calling rate limiting service
2592 /// when header is not present in the request. By default it skips calling the
2593 /// rate limiting service if this header is not present in the request.
2594 #[prost(bool, tag = "3")]
2595 pub skip_if_absent: bool,
2596 }
2597 impl ::prost::Name for RequestHeaders {
2598 const NAME: &'static str = "RequestHeaders";
2599 const PACKAGE: &'static str = "envoy.config.route.v3";
2600 fn full_name() -> ::prost::alloc::string::String {
2601 "envoy.config.route.v3.RateLimit.Action.RequestHeaders".into()
2602 }
2603 fn type_url() -> ::prost::alloc::string::String {
2604 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.RequestHeaders"
2605 .into()
2606 }
2607 }
2608 /// The following descriptor entry is appended to the descriptor and is populated using the
2609 /// trusted address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`:
2610 ///
2611 /// .. code-block:: cpp
2612 ///
2613 /// ("remote_address", "<trusted address from x-forwarded-for>")
2614 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2615 pub struct RemoteAddress {}
2616 impl ::prost::Name for RemoteAddress {
2617 const NAME: &'static str = "RemoteAddress";
2618 const PACKAGE: &'static str = "envoy.config.route.v3";
2619 fn full_name() -> ::prost::alloc::string::String {
2620 "envoy.config.route.v3.RateLimit.Action.RemoteAddress".into()
2621 }
2622 fn type_url() -> ::prost::alloc::string::String {
2623 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.RemoteAddress"
2624 .into()
2625 }
2626 }
2627 /// The following descriptor entry is appended to the descriptor and is populated using the
2628 /// masked address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`:
2629 ///
2630 /// .. code-block:: cpp
2631 ///
2632 /// ("masked_remote_address", "<masked address from x-forwarded-for>")
2633 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2634 pub struct MaskedRemoteAddress {
2635 /// Length of prefix mask len for IPv4 (e.g. 0, 32).
2636 /// Defaults to 32 when unset.
2637 /// For example, trusted address from x-forwarded-for is ``192.168.1.1``,
2638 /// the descriptor entry is ("masked_remote_address", "192.168.1.1/32");
2639 /// if mask len is 24, the descriptor entry is ("masked_remote_address", "192.168.1.0/24").
2640 #[prost(message, optional, tag = "1")]
2641 pub v4_prefix_mask_len: ::core::option::Option<
2642 super::super::super::super::super::super::google::protobuf::UInt32Value,
2643 >,
2644 /// Length of prefix mask len for IPv6 (e.g. 0, 128).
2645 /// Defaults to 128 when unset.
2646 /// For example, trusted address from x-forwarded-for is ``2001:abcd:ef01:2345:6789:abcd:ef01:234``,
2647 /// the descriptor entry is ("masked_remote_address", "2001:abcd:ef01:2345:6789:abcd:ef01:234/128");
2648 /// if mask len is 64, the descriptor entry is ("masked_remote_address", "2001:abcd:ef01:2345::/64").
2649 #[prost(message, optional, tag = "2")]
2650 pub v6_prefix_mask_len: ::core::option::Option<
2651 super::super::super::super::super::super::google::protobuf::UInt32Value,
2652 >,
2653 }
2654 impl ::prost::Name for MaskedRemoteAddress {
2655 const NAME: &'static str = "MaskedRemoteAddress";
2656 const PACKAGE: &'static str = "envoy.config.route.v3";
2657 fn full_name() -> ::prost::alloc::string::String {
2658 "envoy.config.route.v3.RateLimit.Action.MaskedRemoteAddress".into()
2659 }
2660 fn type_url() -> ::prost::alloc::string::String {
2661 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.MaskedRemoteAddress"
2662 .into()
2663 }
2664 }
2665 /// The following descriptor entry is appended to the descriptor:
2666 ///
2667 /// .. code-block:: cpp
2668 ///
2669 /// ("generic_key", "<descriptor_value>")
2670 #[derive(Clone, PartialEq, ::prost::Message)]
2671 pub struct GenericKey {
2672 /// The value to use in the descriptor entry.
2673 #[prost(string, tag = "1")]
2674 pub descriptor_value: ::prost::alloc::string::String,
2675 /// An optional key to use in the descriptor entry. If not set it defaults
2676 /// to 'generic_key' as the descriptor key.
2677 #[prost(string, tag = "2")]
2678 pub descriptor_key: ::prost::alloc::string::String,
2679 }
2680 impl ::prost::Name for GenericKey {
2681 const NAME: &'static str = "GenericKey";
2682 const PACKAGE: &'static str = "envoy.config.route.v3";
2683 fn full_name() -> ::prost::alloc::string::String {
2684 "envoy.config.route.v3.RateLimit.Action.GenericKey".into()
2685 }
2686 fn type_url() -> ::prost::alloc::string::String {
2687 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.GenericKey"
2688 .into()
2689 }
2690 }
2691 /// The following descriptor entry is appended to the descriptor:
2692 ///
2693 /// .. code-block:: cpp
2694 ///
2695 /// ("header_match", "<descriptor_value>")
2696 #[derive(Clone, PartialEq, ::prost::Message)]
2697 pub struct HeaderValueMatch {
2698 /// The key to use in the descriptor entry. Defaults to ``header_match``.
2699 #[prost(string, tag = "4")]
2700 pub descriptor_key: ::prost::alloc::string::String,
2701 /// The value to use in the descriptor entry.
2702 #[prost(string, tag = "1")]
2703 pub descriptor_value: ::prost::alloc::string::String,
2704 /// If set to true, the action will append a descriptor entry when the
2705 /// request matches the headers. If set to false, the action will append a
2706 /// descriptor entry when the request does not match the headers. The
2707 /// default value is true.
2708 #[prost(message, optional, tag = "2")]
2709 pub expect_match: ::core::option::Option<
2710 super::super::super::super::super::super::google::protobuf::BoolValue,
2711 >,
2712 /// Specifies a set of headers that the rate limit action should match
2713 /// on. The action will check the request’s headers against all the
2714 /// specified headers in the config. A match will happen if all the
2715 /// headers in the config are present in the request with the same values
2716 /// (or based on presence if the value field is not in the config).
2717 #[prost(message, repeated, tag = "3")]
2718 pub headers: ::prost::alloc::vec::Vec<super::super::HeaderMatcher>,
2719 }
2720 impl ::prost::Name for HeaderValueMatch {
2721 const NAME: &'static str = "HeaderValueMatch";
2722 const PACKAGE: &'static str = "envoy.config.route.v3";
2723 fn full_name() -> ::prost::alloc::string::String {
2724 "envoy.config.route.v3.RateLimit.Action.HeaderValueMatch".into()
2725 }
2726 fn type_url() -> ::prost::alloc::string::String {
2727 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.HeaderValueMatch"
2728 .into()
2729 }
2730 }
2731 /// The following descriptor entry is appended when the
2732 /// :ref:`dynamic metadata <well_known_dynamic_metadata>` contains a key value:
2733 ///
2734 /// .. code-block:: cpp
2735 ///
2736 /// ("<descriptor_key>", "<value_queried_from_dynamic_metadata>")
2737 ///
2738 /// .. attention::
2739 /// This action has been deprecated in favor of the :ref:`metadata <envoy_v3_api_msg_config.route.v3.RateLimit.Action.MetaData>` action
2740 #[derive(Clone, PartialEq, ::prost::Message)]
2741 pub struct DynamicMetaData {
2742 /// The key to use in the descriptor entry.
2743 #[prost(string, tag = "1")]
2744 pub descriptor_key: ::prost::alloc::string::String,
2745 /// Metadata struct that defines the key and path to retrieve the string value. A match will
2746 /// only happen if the value in the dynamic metadata is of type string.
2747 #[prost(message, optional, tag = "2")]
2748 pub metadata_key: ::core::option::Option<
2749 super::super::super::super::super::r#type::metadata::v3::MetadataKey,
2750 >,
2751 /// An optional value to use if ``metadata_key`` is empty. If not set and
2752 /// no value is present under the metadata_key then no descriptor is generated.
2753 #[prost(string, tag = "3")]
2754 pub default_value: ::prost::alloc::string::String,
2755 }
2756 impl ::prost::Name for DynamicMetaData {
2757 const NAME: &'static str = "DynamicMetaData";
2758 const PACKAGE: &'static str = "envoy.config.route.v3";
2759 fn full_name() -> ::prost::alloc::string::String {
2760 "envoy.config.route.v3.RateLimit.Action.DynamicMetaData".into()
2761 }
2762 fn type_url() -> ::prost::alloc::string::String {
2763 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.DynamicMetaData"
2764 .into()
2765 }
2766 }
2767 /// The following descriptor entry is appended when the metadata contains a key value:
2768 ///
2769 /// .. code-block:: cpp
2770 ///
2771 /// ("<descriptor_key>", "<value_queried_from_metadata>")
2772 /// \[#next-free-field: 6\]
2773 #[derive(Clone, PartialEq, ::prost::Message)]
2774 pub struct MetaData {
2775 /// The key to use in the descriptor entry.
2776 #[prost(string, tag = "1")]
2777 pub descriptor_key: ::prost::alloc::string::String,
2778 /// Metadata struct that defines the key and path to retrieve the string value. A match will
2779 /// only happen if the value in the metadata is of type string.
2780 #[prost(message, optional, tag = "2")]
2781 pub metadata_key: ::core::option::Option<
2782 super::super::super::super::super::r#type::metadata::v3::MetadataKey,
2783 >,
2784 /// An optional value to use if ``metadata_key`` is empty. If not set and
2785 /// no value is present under the metadata_key then ``skip_if_absent`` is followed to
2786 /// skip calling the rate limiting service or skip the descriptor.
2787 #[prost(string, tag = "3")]
2788 pub default_value: ::prost::alloc::string::String,
2789 /// Source of metadata
2790 #[prost(enumeration = "meta_data::Source", tag = "4")]
2791 pub source: i32,
2792 /// If set to true, Envoy skips the descriptor while calling rate limiting service
2793 /// when ``metadata_key`` is empty and ``default_value`` is not set. By default it skips calling the
2794 /// rate limiting service in that case.
2795 #[prost(bool, tag = "5")]
2796 pub skip_if_absent: bool,
2797 }
2798 /// Nested message and enum types in `MetaData`.
2799 pub mod meta_data {
2800 #[derive(
2801 Clone,
2802 Copy,
2803 Debug,
2804 PartialEq,
2805 Eq,
2806 Hash,
2807 PartialOrd,
2808 Ord,
2809 ::prost::Enumeration
2810 )]
2811 #[repr(i32)]
2812 pub enum Source {
2813 /// Query :ref:`dynamic metadata <well_known_dynamic_metadata>`
2814 Dynamic = 0,
2815 /// Query :ref:`route entry metadata <envoy_v3_api_field_config.route.v3.Route.metadata>`
2816 RouteEntry = 1,
2817 }
2818 impl Source {
2819 /// String value of the enum field names used in the ProtoBuf definition.
2820 ///
2821 /// The values are not transformed in any way and thus are considered stable
2822 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2823 pub fn as_str_name(&self) -> &'static str {
2824 match self {
2825 Self::Dynamic => "DYNAMIC",
2826 Self::RouteEntry => "ROUTE_ENTRY",
2827 }
2828 }
2829 /// Creates an enum from field names used in the ProtoBuf definition.
2830 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2831 match value {
2832 "DYNAMIC" => Some(Self::Dynamic),
2833 "ROUTE_ENTRY" => Some(Self::RouteEntry),
2834 _ => None,
2835 }
2836 }
2837 }
2838 }
2839 impl ::prost::Name for MetaData {
2840 const NAME: &'static str = "MetaData";
2841 const PACKAGE: &'static str = "envoy.config.route.v3";
2842 fn full_name() -> ::prost::alloc::string::String {
2843 "envoy.config.route.v3.RateLimit.Action.MetaData".into()
2844 }
2845 fn type_url() -> ::prost::alloc::string::String {
2846 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.MetaData"
2847 .into()
2848 }
2849 }
2850 /// The following descriptor entry is appended to the descriptor:
2851 ///
2852 /// .. code-block:: cpp
2853 ///
2854 /// ("query_match", "<descriptor_value>")
2855 #[derive(Clone, PartialEq, ::prost::Message)]
2856 pub struct QueryParameterValueMatch {
2857 /// The key to use in the descriptor entry. Defaults to ``query_match``.
2858 #[prost(string, tag = "4")]
2859 pub descriptor_key: ::prost::alloc::string::String,
2860 /// The value to use in the descriptor entry.
2861 #[prost(string, tag = "1")]
2862 pub descriptor_value: ::prost::alloc::string::String,
2863 /// If set to true, the action will append a descriptor entry when the
2864 /// request matches the headers. If set to false, the action will append a
2865 /// descriptor entry when the request does not match the headers. The
2866 /// default value is true.
2867 #[prost(message, optional, tag = "2")]
2868 pub expect_match: ::core::option::Option<
2869 super::super::super::super::super::super::google::protobuf::BoolValue,
2870 >,
2871 /// Specifies a set of query parameters that the rate limit action should match
2872 /// on. The action will check the request’s query parameters against all the
2873 /// specified query parameters in the config. A match will happen if all the
2874 /// query parameters in the config are present in the request with the same values
2875 /// (or based on presence if the value field is not in the config).
2876 #[prost(message, repeated, tag = "3")]
2877 pub query_parameters: ::prost::alloc::vec::Vec<
2878 super::super::QueryParameterMatcher,
2879 >,
2880 }
2881 impl ::prost::Name for QueryParameterValueMatch {
2882 const NAME: &'static str = "QueryParameterValueMatch";
2883 const PACKAGE: &'static str = "envoy.config.route.v3";
2884 fn full_name() -> ::prost::alloc::string::String {
2885 "envoy.config.route.v3.RateLimit.Action.QueryParameterValueMatch".into()
2886 }
2887 fn type_url() -> ::prost::alloc::string::String {
2888 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.QueryParameterValueMatch"
2889 .into()
2890 }
2891 }
2892 #[derive(Clone, PartialEq, ::prost::Oneof)]
2893 pub enum ActionSpecifier {
2894 /// Rate limit on source cluster.
2895 #[prost(message, tag = "1")]
2896 SourceCluster(SourceCluster),
2897 /// Rate limit on destination cluster.
2898 #[prost(message, tag = "2")]
2899 DestinationCluster(DestinationCluster),
2900 /// Rate limit on request headers.
2901 #[prost(message, tag = "3")]
2902 RequestHeaders(RequestHeaders),
2903 /// Rate limit on remote address.
2904 #[prost(message, tag = "4")]
2905 RemoteAddress(RemoteAddress),
2906 /// Rate limit on a generic key.
2907 #[prost(message, tag = "5")]
2908 GenericKey(GenericKey),
2909 /// Rate limit on the existence of request headers.
2910 #[prost(message, tag = "6")]
2911 HeaderValueMatch(HeaderValueMatch),
2912 /// Rate limit on dynamic metadata.
2913 ///
2914 /// .. attention::
2915 /// This field has been deprecated in favor of the :ref:`metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.metadata>` field
2916 #[prost(message, tag = "7")]
2917 DynamicMetadata(DynamicMetaData),
2918 /// Rate limit on metadata.
2919 #[prost(message, tag = "8")]
2920 Metadata(MetaData),
2921 /// Rate limit descriptor extension. See the rate limit descriptor extensions documentation.
2922 ///
2923 /// :ref:`HTTP matching input functions <arch_overview_matching_api>` are
2924 /// permitted as descriptor extensions. The input functions are only
2925 /// looked up if there is no rate limit descriptor extension matching
2926 /// the type URL.
2927 ///
2928 /// \[#extension-category: envoy.rate_limit_descriptors\]
2929 #[prost(message, tag = "9")]
2930 Extension(super::super::super::super::core::v3::TypedExtensionConfig),
2931 /// Rate limit on masked remote address.
2932 #[prost(message, tag = "10")]
2933 MaskedRemoteAddress(MaskedRemoteAddress),
2934 /// Rate limit on the existence of query parameters.
2935 #[prost(message, tag = "11")]
2936 QueryParameterValueMatch(QueryParameterValueMatch),
2937 }
2938 }
2939 impl ::prost::Name for Action {
2940 const NAME: &'static str = "Action";
2941 const PACKAGE: &'static str = "envoy.config.route.v3";
2942 fn full_name() -> ::prost::alloc::string::String {
2943 "envoy.config.route.v3.RateLimit.Action".into()
2944 }
2945 fn type_url() -> ::prost::alloc::string::String {
2946 "type.googleapis.com/envoy.config.route.v3.RateLimit.Action".into()
2947 }
2948 }
2949 #[derive(Clone, PartialEq, ::prost::Message)]
2950 pub struct Override {
2951 #[prost(oneof = "r#override::OverrideSpecifier", tags = "1")]
2952 pub override_specifier: ::core::option::Option<r#override::OverrideSpecifier>,
2953 }
2954 /// Nested message and enum types in `Override`.
2955 pub mod r#override {
2956 /// Fetches the override from the dynamic metadata.
2957 #[derive(Clone, PartialEq, ::prost::Message)]
2958 pub struct DynamicMetadata {
2959 /// Metadata struct that defines the key and path to retrieve the struct value.
2960 /// The value must be a struct containing an integer "requests_per_unit" property
2961 /// and a "unit" property with a value parseable to :ref:`RateLimitUnit
2962 /// enum <envoy_v3_api_enum_type.v3.RateLimitUnit>`
2963 #[prost(message, optional, tag = "1")]
2964 pub metadata_key: ::core::option::Option<
2965 super::super::super::super::super::r#type::metadata::v3::MetadataKey,
2966 >,
2967 }
2968 impl ::prost::Name for DynamicMetadata {
2969 const NAME: &'static str = "DynamicMetadata";
2970 const PACKAGE: &'static str = "envoy.config.route.v3";
2971 fn full_name() -> ::prost::alloc::string::String {
2972 "envoy.config.route.v3.RateLimit.Override.DynamicMetadata".into()
2973 }
2974 fn type_url() -> ::prost::alloc::string::String {
2975 "type.googleapis.com/envoy.config.route.v3.RateLimit.Override.DynamicMetadata"
2976 .into()
2977 }
2978 }
2979 #[derive(Clone, PartialEq, ::prost::Oneof)]
2980 pub enum OverrideSpecifier {
2981 /// Limit override from dynamic metadata.
2982 #[prost(message, tag = "1")]
2983 DynamicMetadata(DynamicMetadata),
2984 }
2985 }
2986 impl ::prost::Name for Override {
2987 const NAME: &'static str = "Override";
2988 const PACKAGE: &'static str = "envoy.config.route.v3";
2989 fn full_name() -> ::prost::alloc::string::String {
2990 "envoy.config.route.v3.RateLimit.Override".into()
2991 }
2992 fn type_url() -> ::prost::alloc::string::String {
2993 "type.googleapis.com/envoy.config.route.v3.RateLimit.Override".into()
2994 }
2995 }
2996}
2997impl ::prost::Name for RateLimit {
2998 const NAME: &'static str = "RateLimit";
2999 const PACKAGE: &'static str = "envoy.config.route.v3";
3000 fn full_name() -> ::prost::alloc::string::String {
3001 "envoy.config.route.v3.RateLimit".into()
3002 }
3003 fn type_url() -> ::prost::alloc::string::String {
3004 "type.googleapis.com/envoy.config.route.v3.RateLimit".into()
3005 }
3006}
3007/// .. attention::
3008///
3009/// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1 ``Host``
3010/// header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
3011///
3012/// .. attention::
3013///
3014/// To route on HTTP method, use the special HTTP/2 ``:method`` header. This works for both
3015/// HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
3016///
3017/// .. code-block:: json
3018///
3019/// {
3020/// "name": ":method",
3021/// "string_match": {
3022/// "exact": "POST"
3023/// }
3024/// }
3025///
3026/// .. attention::
3027/// In the absence of any header match specifier, match will default to :ref:`present_match
3028/// <envoy_v3_api_field_config.route.v3.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
3029/// <envoy_v3_api_field_config.route.v3.HeaderMatcher.name>` header will match, regardless of the header's
3030/// value.
3031///
3032/// \[#next-major-version: HeaderMatcher should be refactored to use StringMatcher.\]
3033/// \[#next-free-field: 15\]
3034#[derive(Clone, PartialEq, ::prost::Message)]
3035pub struct HeaderMatcher {
3036 /// Specifies the name of the header in the request.
3037 #[prost(string, tag = "1")]
3038 pub name: ::prost::alloc::string::String,
3039 /// If specified, the match result will be inverted before checking. Defaults to false.
3040 ///
3041 /// Examples:
3042 ///
3043 /// * The regex ``\d{3}`` does not match the value ``1234``, so it will match when inverted.
3044 /// * The range [-10,0) will match the value -1, so it will not match when inverted.
3045 #[prost(bool, tag = "8")]
3046 pub invert_match: bool,
3047 /// If specified, for any header match rule, if the header match rule specified header
3048 /// does not exist, this header value will be treated as empty. Defaults to false.
3049 ///
3050 /// Examples:
3051 ///
3052 /// * The header match rule specified header "header1" to range match of \[0, 10\],
3053 /// :ref:`invert_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.invert_match>`
3054 /// is set to true and :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
3055 /// is set to true; The "header1" header is not present. The match rule will
3056 /// treat the "header1" as an empty header. The empty header does not match the range,
3057 /// so it will match when inverted.
3058 /// * The header match rule specified header "header2" to range match of \[0, 10\],
3059 /// :ref:`invert_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.invert_match>`
3060 /// is set to true and :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
3061 /// is set to false; The "header2" header is not present and the header
3062 /// matcher rule for "header2" will be ignored so it will not match.
3063 /// * The header match rule specified header "header3" to a string regex match
3064 /// ``^$`` which means an empty string, and
3065 /// :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
3066 /// is set to true; The "header3" header is not present.
3067 /// The match rule will treat the "header3" header as an empty header so it will match.
3068 /// * The header match rule specified header "header4" to a string regex match
3069 /// ``^$`` which means an empty string, and
3070 /// :ref:`treat_missing_header_as_empty <envoy_v3_api_field_config.route.v3.HeaderMatcher.treat_missing_header_as_empty>`
3071 /// is set to false; The "header4" header is not present.
3072 /// The match rule for "header4" will be ignored so it will not match.
3073 #[prost(bool, tag = "14")]
3074 pub treat_missing_header_as_empty: bool,
3075 /// Specifies how the header match will be performed to route the request.
3076 #[prost(
3077 oneof = "header_matcher::HeaderMatchSpecifier",
3078 tags = "4, 11, 6, 7, 9, 10, 12, 13"
3079 )]
3080 pub header_match_specifier: ::core::option::Option<
3081 header_matcher::HeaderMatchSpecifier,
3082 >,
3083}
3084/// Nested message and enum types in `HeaderMatcher`.
3085pub mod header_matcher {
3086 /// Specifies how the header match will be performed to route the request.
3087 #[derive(Clone, PartialEq, ::prost::Oneof)]
3088 pub enum HeaderMatchSpecifier {
3089 /// If specified, header match will be performed based on the value of the header.
3090 /// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
3091 #[prost(string, tag = "4")]
3092 ExactMatch(::prost::alloc::string::String),
3093 /// If specified, this regex string is a regular expression rule which implies the entire request
3094 /// header value must match the regex. The rule will not match if only a subsequence of the
3095 /// request header value matches the regex.
3096 /// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
3097 #[prost(message, tag = "11")]
3098 SafeRegexMatch(super::super::super::super::r#type::matcher::v3::RegexMatcher),
3099 /// If specified, header match will be performed based on range.
3100 /// The rule will match if the request header value is within this range.
3101 /// The entire request header value must represent an integer in base 10 notation: consisting of
3102 /// an optional plus or minus sign followed by a sequence of digits. The rule will not match if
3103 /// the header value does not represent an integer. Match will fail for empty values, floating
3104 /// point numbers or if only a subsequence of the header value is an integer.
3105 ///
3106 /// Examples:
3107 ///
3108 /// * For range [-10,0), route will match for header value -1, but not for 0, ``somestring``, 10.9,
3109 /// ``-1somestring``
3110 #[prost(message, tag = "6")]
3111 RangeMatch(super::super::super::super::r#type::v3::Int64Range),
3112 /// If specified as true, header match will be performed based on whether the header is in the
3113 /// request. If specified as false, header match will be performed based on whether the header is absent.
3114 #[prost(bool, tag = "7")]
3115 PresentMatch(bool),
3116 /// If specified, header match will be performed based on the prefix of the header value.
3117 /// Note: empty prefix is not allowed, please use present_match instead.
3118 /// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
3119 ///
3120 /// Examples:
3121 ///
3122 /// * The prefix ``abcd`` matches the value ``abcdxyz``, but not for ``abcxyz``.
3123 #[prost(string, tag = "9")]
3124 PrefixMatch(::prost::alloc::string::String),
3125 /// If specified, header match will be performed based on the suffix of the header value.
3126 /// Note: empty suffix is not allowed, please use present_match instead.
3127 /// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
3128 ///
3129 /// Examples:
3130 ///
3131 /// * The suffix ``abcd`` matches the value ``xyzabcd``, but not for ``xyzbcd``.
3132 #[prost(string, tag = "10")]
3133 SuffixMatch(::prost::alloc::string::String),
3134 /// If specified, header match will be performed based on whether the header value contains
3135 /// the given value or not.
3136 /// Note: empty contains match is not allowed, please use present_match instead.
3137 /// This field is deprecated. Please use :ref:`string_match <envoy_v3_api_field_config.route.v3.HeaderMatcher.string_match>`.
3138 ///
3139 /// Examples:
3140 ///
3141 /// * The value ``abcd`` matches the value ``xyzabcdpqr``, but not for ``xyzbcdpqr``.
3142 #[prost(string, tag = "12")]
3143 ContainsMatch(::prost::alloc::string::String),
3144 /// If specified, header match will be performed based on the string match of the header value.
3145 #[prost(message, tag = "13")]
3146 StringMatch(super::super::super::super::r#type::matcher::v3::StringMatcher),
3147 }
3148}
3149impl ::prost::Name for HeaderMatcher {
3150 const NAME: &'static str = "HeaderMatcher";
3151 const PACKAGE: &'static str = "envoy.config.route.v3";
3152 fn full_name() -> ::prost::alloc::string::String {
3153 "envoy.config.route.v3.HeaderMatcher".into()
3154 }
3155 fn type_url() -> ::prost::alloc::string::String {
3156 "type.googleapis.com/envoy.config.route.v3.HeaderMatcher".into()
3157 }
3158}
3159/// Query parameter matching treats the query string of a request's :path header
3160/// as an ampersand-separated list of keys and/or key=value elements.
3161/// \[#next-free-field: 7\]
3162#[derive(Clone, PartialEq, ::prost::Message)]
3163pub struct QueryParameterMatcher {
3164 /// Specifies the name of a key that must be present in the requested
3165 /// ``path``'s query string.
3166 #[prost(string, tag = "1")]
3167 pub name: ::prost::alloc::string::String,
3168 #[prost(
3169 oneof = "query_parameter_matcher::QueryParameterMatchSpecifier",
3170 tags = "5, 6"
3171 )]
3172 pub query_parameter_match_specifier: ::core::option::Option<
3173 query_parameter_matcher::QueryParameterMatchSpecifier,
3174 >,
3175}
3176/// Nested message and enum types in `QueryParameterMatcher`.
3177pub mod query_parameter_matcher {
3178 #[derive(Clone, PartialEq, ::prost::Oneof)]
3179 pub enum QueryParameterMatchSpecifier {
3180 /// Specifies whether a query parameter value should match against a string.
3181 #[prost(message, tag = "5")]
3182 StringMatch(super::super::super::super::r#type::matcher::v3::StringMatcher),
3183 /// Specifies whether a query parameter should be present.
3184 #[prost(bool, tag = "6")]
3185 PresentMatch(bool),
3186 }
3187}
3188impl ::prost::Name for QueryParameterMatcher {
3189 const NAME: &'static str = "QueryParameterMatcher";
3190 const PACKAGE: &'static str = "envoy.config.route.v3";
3191 fn full_name() -> ::prost::alloc::string::String {
3192 "envoy.config.route.v3.QueryParameterMatcher".into()
3193 }
3194 fn type_url() -> ::prost::alloc::string::String {
3195 "type.googleapis.com/envoy.config.route.v3.QueryParameterMatcher".into()
3196 }
3197}
3198/// HTTP Internal Redirect :ref:`architecture overview <arch_overview_internal_redirects>`.
3199/// \[#next-free-field: 6\]
3200#[derive(Clone, PartialEq, ::prost::Message)]
3201pub struct InternalRedirectPolicy {
3202 /// An internal redirect is not handled, unless the number of previous internal redirects that a
3203 /// downstream request has encountered is lower than this value.
3204 /// In the case where a downstream request is bounced among multiple routes by internal redirect,
3205 /// the first route that hits this threshold, or does not set :ref:`internal_redirect_policy
3206 /// <envoy_v3_api_field_config.route.v3.RouteAction.internal_redirect_policy>`
3207 /// will pass the redirect back to downstream.
3208 ///
3209 /// If not specified, at most one redirect will be followed.
3210 #[prost(message, optional, tag = "1")]
3211 pub max_internal_redirects: ::core::option::Option<
3212 super::super::super::super::google::protobuf::UInt32Value,
3213 >,
3214 /// Defines what upstream response codes are allowed to trigger internal redirect. If unspecified,
3215 /// only 302 will be treated as internal redirect.
3216 /// Only 301, 302, 303, 307 and 308 are valid values. Any other codes will be ignored.
3217 #[prost(uint32, repeated, packed = "false", tag = "2")]
3218 pub redirect_response_codes: ::prost::alloc::vec::Vec<u32>,
3219 /// Specifies a list of predicates that are queried when an upstream response is deemed
3220 /// to trigger an internal redirect by all other criteria. Any predicate in the list can reject
3221 /// the redirect, causing the response to be proxied to downstream.
3222 /// \[#extension-category: envoy.internal_redirect_predicates\]
3223 #[prost(message, repeated, tag = "3")]
3224 pub predicates: ::prost::alloc::vec::Vec<
3225 super::super::core::v3::TypedExtensionConfig,
3226 >,
3227 /// Allow internal redirect to follow a target URI with a different scheme than the value of
3228 /// x-forwarded-proto. The default is false.
3229 #[prost(bool, tag = "4")]
3230 pub allow_cross_scheme_redirect: bool,
3231 /// Specifies a list of headers, by name, to copy from the internal redirect into the subsequent
3232 /// request. If a header is specified here but not present in the redirect, it will be cleared in
3233 /// the subsequent request.
3234 #[prost(string, repeated, tag = "5")]
3235 pub response_headers_to_copy: ::prost::alloc::vec::Vec<
3236 ::prost::alloc::string::String,
3237 >,
3238}
3239impl ::prost::Name for InternalRedirectPolicy {
3240 const NAME: &'static str = "InternalRedirectPolicy";
3241 const PACKAGE: &'static str = "envoy.config.route.v3";
3242 fn full_name() -> ::prost::alloc::string::String {
3243 "envoy.config.route.v3.InternalRedirectPolicy".into()
3244 }
3245 fn type_url() -> ::prost::alloc::string::String {
3246 "type.googleapis.com/envoy.config.route.v3.InternalRedirectPolicy".into()
3247 }
3248}
3249/// A simple wrapper for an HTTP filter config. This is intended to be used as a wrapper for the
3250/// map value in
3251/// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`,
3252/// :ref:`Route.typed_per_filter_config<envoy_v3_api_field_config.route.v3.Route.typed_per_filter_config>`,
3253/// or :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_v3_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`
3254/// to add additional flags to the filter.
3255#[derive(Clone, PartialEq, ::prost::Message)]
3256pub struct FilterConfig {
3257 /// The filter config.
3258 #[prost(message, optional, tag = "1")]
3259 pub config: ::core::option::Option<
3260 super::super::super::super::google::protobuf::Any,
3261 >,
3262 /// If true, the filter is optional, meaning that if the client does
3263 /// not support the specified filter, it may ignore the map entry rather
3264 /// than rejecting the config.
3265 #[prost(bool, tag = "2")]
3266 pub is_optional: bool,
3267 /// If true, the filter is disabled in the route or virtual host and the ``config`` field is ignored.
3268 /// See :ref:`route based filter chain <arch_overview_http_filters_route_based_filter_chain>`
3269 /// for more details.
3270 ///
3271 /// .. note::
3272 ///
3273 /// This field will take effect when the request arrive and filter chain is created for the request.
3274 /// If initial route is selected for the request and a filter is disabled in the initial route, then
3275 /// the filter will not be added to the filter chain.
3276 /// And if the request is mutated later and re-match to another route, the disabled filter by the
3277 /// initial route will not be added back to the filter chain because the filter chain is already
3278 /// created and it is too late to change the chain.
3279 ///
3280 /// This field only make sense for the downstream HTTP filters for now.
3281 #[prost(bool, tag = "3")]
3282 pub disabled: bool,
3283}
3284impl ::prost::Name for FilterConfig {
3285 const NAME: &'static str = "FilterConfig";
3286 const PACKAGE: &'static str = "envoy.config.route.v3";
3287 fn full_name() -> ::prost::alloc::string::String {
3288 "envoy.config.route.v3.FilterConfig".into()
3289 }
3290 fn type_url() -> ::prost::alloc::string::String {
3291 "type.googleapis.com/envoy.config.route.v3.FilterConfig".into()
3292 }
3293}
3294/// \[#next-free-field: 18\]
3295#[derive(Clone, PartialEq, ::prost::Message)]
3296pub struct RouteConfiguration {
3297 /// The name of the route configuration. For example, it might match
3298 /// :ref:`route_config_name
3299 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.Rds.route_config_name>` in
3300 /// :ref:`envoy_v3_api_msg_extensions.filters.network.http_connection_manager.v3.Rds`.
3301 #[prost(string, tag = "1")]
3302 pub name: ::prost::alloc::string::String,
3303 /// An array of virtual hosts that make up the route table.
3304 #[prost(message, repeated, tag = "2")]
3305 pub virtual_hosts: ::prost::alloc::vec::Vec<VirtualHost>,
3306 /// An array of virtual hosts will be dynamically loaded via the VHDS API.
3307 /// Both ``virtual_hosts`` and ``vhds`` fields will be used when present. ``virtual_hosts`` can be used
3308 /// for a base routing table or for infrequently changing virtual hosts. ``vhds`` is used for
3309 /// on-demand discovery of virtual hosts. The contents of these two fields will be merged to
3310 /// generate a routing table for a given RouteConfiguration, with ``vhds`` derived configuration
3311 /// taking precedence.
3312 #[prost(message, optional, tag = "9")]
3313 pub vhds: ::core::option::Option<Vhds>,
3314 /// Optionally specifies a list of HTTP headers that the connection manager
3315 /// will consider to be internal only. If they are found on external requests they will be cleaned
3316 /// prior to filter invocation. See :ref:`config_http_conn_man_headers_x-envoy-internal` for more
3317 /// information.
3318 #[prost(string, repeated, tag = "3")]
3319 pub internal_only_headers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3320 /// Specifies a list of HTTP headers that should be added to each response that
3321 /// the connection manager encodes. Headers specified at this level are applied
3322 /// after headers from any enclosed :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` or
3323 /// :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`. For more information, including details on
3324 /// header value syntax, see the documentation on :ref:`custom request headers
3325 /// <config_http_conn_man_headers_custom_request_headers>`.
3326 #[prost(message, repeated, tag = "4")]
3327 pub response_headers_to_add: ::prost::alloc::vec::Vec<
3328 super::super::core::v3::HeaderValueOption,
3329 >,
3330 /// Specifies a list of HTTP headers that should be removed from each response
3331 /// that the connection manager encodes.
3332 #[prost(string, repeated, tag = "5")]
3333 pub response_headers_to_remove: ::prost::alloc::vec::Vec<
3334 ::prost::alloc::string::String,
3335 >,
3336 /// Specifies a list of HTTP headers that should be added to each request
3337 /// routed by the HTTP connection manager. Headers specified at this level are
3338 /// applied after headers from any enclosed :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` or
3339 /// :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`. For more information, including details on
3340 /// header value syntax, see the documentation on :ref:`custom request headers
3341 /// <config_http_conn_man_headers_custom_request_headers>`.
3342 #[prost(message, repeated, tag = "6")]
3343 pub request_headers_to_add: ::prost::alloc::vec::Vec<
3344 super::super::core::v3::HeaderValueOption,
3345 >,
3346 /// Specifies a list of HTTP headers that should be removed from each request
3347 /// routed by the HTTP connection manager.
3348 #[prost(string, repeated, tag = "8")]
3349 pub request_headers_to_remove: ::prost::alloc::vec::Vec<
3350 ::prost::alloc::string::String,
3351 >,
3352 /// Headers mutations at all levels are evaluated, if specified. By default, the order is from most
3353 /// specific (i.e. route entry level) to least specific (i.e. route configuration level). Later header
3354 /// mutations may override earlier mutations.
3355 /// This order can be reversed by setting this field to true. In other words, most specific level mutation
3356 /// is evaluated last.
3357 ///
3358 #[prost(bool, tag = "10")]
3359 pub most_specific_header_mutations_wins: bool,
3360 /// An optional boolean that specifies whether the clusters that the route
3361 /// table refers to will be validated by the cluster manager. If set to true
3362 /// and a route refers to a non-existent cluster, the route table will not
3363 /// load. If set to false and a route refers to a non-existent cluster, the
3364 /// route table will load and the router filter will return a 404 if the route
3365 /// is selected at runtime. This setting defaults to true if the route table
3366 /// is statically defined via the :ref:`route_config
3367 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.route_config>`
3368 /// option. This setting default to false if the route table is loaded dynamically via the
3369 /// :ref:`rds
3370 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.rds>`
3371 /// option. Users may wish to override the default behavior in certain cases (for example when
3372 /// using CDS with a static route table).
3373 #[prost(message, optional, tag = "7")]
3374 pub validate_clusters: ::core::option::Option<
3375 super::super::super::super::google::protobuf::BoolValue,
3376 >,
3377 /// The maximum bytes of the response :ref:`direct response body
3378 /// <envoy_v3_api_field_config.route.v3.DirectResponseAction.body>` size. If not specified the default
3379 /// is 4096.
3380 ///
3381 /// .. warning::
3382 ///
3383 /// Envoy currently holds the content of :ref:`direct response body
3384 /// <envoy_v3_api_field_config.route.v3.DirectResponseAction.body>` in memory. Be careful setting
3385 /// this to be larger than the default 4KB, since the allocated memory for direct response body
3386 /// is not subject to data plane buffering controls.
3387 ///
3388 #[prost(message, optional, tag = "11")]
3389 pub max_direct_response_body_size_bytes: ::core::option::Option<
3390 super::super::super::super::google::protobuf::UInt32Value,
3391 >,
3392 /// A list of plugins and their configurations which may be used by a
3393 /// :ref:`cluster specifier plugin name <envoy_v3_api_field_config.route.v3.RouteAction.cluster_specifier_plugin>`
3394 /// within the route. All ``extension.name`` fields in this list must be unique.
3395 #[prost(message, repeated, tag = "12")]
3396 pub cluster_specifier_plugins: ::prost::alloc::vec::Vec<ClusterSpecifierPlugin>,
3397 /// Specify a set of default request mirroring policies which apply to all routes under its virtual hosts.
3398 /// Note that policies are not merged, the most specific non-empty one becomes the mirror policies.
3399 #[prost(message, repeated, tag = "13")]
3400 pub request_mirror_policies: ::prost::alloc::vec::Vec<
3401 route_action::RequestMirrorPolicy,
3402 >,
3403 /// By default, port in :authority header (if any) is used in host matching.
3404 /// With this option enabled, Envoy will ignore the port number in the :authority header (if any) when picking VirtualHost.
3405 /// NOTE: this option will not strip the port number (if any) contained in route config
3406 /// :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`.domains field.
3407 #[prost(bool, tag = "14")]
3408 pub ignore_port_in_host_matching: bool,
3409 /// Ignore path-parameters in path-matching.
3410 /// Before RFC3986, URI were like(RFC1808): <scheme>://<net_loc>/<path>;<params>?<query>#<fragment>
3411 /// Envoy by default takes ":path" as "<path>;<params>".
3412 /// For users who want to only match path on the "<path>" portion, this option should be true.
3413 #[prost(bool, tag = "15")]
3414 pub ignore_path_parameters_in_path_matching: bool,
3415 /// This field can be used to provide RouteConfiguration level per filter config. The key should match the
3416 /// :ref:`filter config name
3417 /// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
3418 /// See :ref:`Http filter route specific config <arch_overview_http_filters_per_filter_config>`
3419 /// for details.
3420 /// [#comment: An entry's value may be wrapped in a
3421 /// :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
3422 /// message to specify additional options.]
3423 #[prost(map = "string, message", tag = "16")]
3424 pub typed_per_filter_config: ::std::collections::HashMap<
3425 ::prost::alloc::string::String,
3426 super::super::super::super::google::protobuf::Any,
3427 >,
3428 /// The metadata field can be used to provide additional information
3429 /// about the route configuration. It can be used for configuration, stats, and logging.
3430 /// The metadata should go under the filter namespace that will need it.
3431 /// For instance, if the metadata is intended for the Router filter,
3432 /// the filter name should be specified as ``envoy.filters.http.router``.
3433 #[prost(message, optional, tag = "17")]
3434 pub metadata: ::core::option::Option<super::super::core::v3::Metadata>,
3435}
3436impl ::prost::Name for RouteConfiguration {
3437 const NAME: &'static str = "RouteConfiguration";
3438 const PACKAGE: &'static str = "envoy.config.route.v3";
3439 fn full_name() -> ::prost::alloc::string::String {
3440 "envoy.config.route.v3.RouteConfiguration".into()
3441 }
3442 fn type_url() -> ::prost::alloc::string::String {
3443 "type.googleapis.com/envoy.config.route.v3.RouteConfiguration".into()
3444 }
3445}
3446#[derive(Clone, PartialEq, ::prost::Message)]
3447pub struct Vhds {
3448 /// Configuration source specifier for VHDS.
3449 #[prost(message, optional, tag = "1")]
3450 pub config_source: ::core::option::Option<super::super::core::v3::ConfigSource>,
3451}
3452impl ::prost::Name for Vhds {
3453 const NAME: &'static str = "Vhds";
3454 const PACKAGE: &'static str = "envoy.config.route.v3";
3455 fn full_name() -> ::prost::alloc::string::String {
3456 "envoy.config.route.v3.Vhds".into()
3457 }
3458 fn type_url() -> ::prost::alloc::string::String {
3459 "type.googleapis.com/envoy.config.route.v3.Vhds".into()
3460 }
3461}
3462/// Specifies a routing scope, which associates a
3463/// :ref:`Key<envoy_v3_api_msg_config.route.v3.ScopedRouteConfiguration.Key>` to a
3464/// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`.
3465/// The :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` can be obtained dynamically
3466/// via RDS (:ref:`route_configuration_name<envoy_v3_api_field_config.route.v3.ScopedRouteConfiguration.route_configuration_name>`)
3467/// or specified inline (:ref:`route_configuration<envoy_v3_api_field_config.route.v3.ScopedRouteConfiguration.route_configuration>`).
3468///
3469/// The HTTP connection manager builds up a table consisting of these Key to
3470/// RouteConfiguration mappings, and looks up the RouteConfiguration to use per
3471/// request according to the algorithm specified in the
3472/// :ref:`scope_key_builder<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder>`
3473/// assigned to the HttpConnectionManager.
3474///
3475/// For example, with the following configurations (in YAML):
3476///
3477/// HttpConnectionManager config:
3478///
3479/// .. code::
3480///
3481/// ...
3482/// scoped_routes:
3483/// name: foo-scoped-routes
3484/// scope_key_builder:
3485/// fragments:
3486/// - header_value_extractor:
3487/// name: X-Route-Selector
3488/// element_separator: ","
3489/// element:
3490/// separator: =
3491/// key: vip
3492///
3493/// ScopedRouteConfiguration resources (specified statically via
3494/// :ref:`scoped_route_configurations_list<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scoped_route_configurations_list>`
3495/// or obtained dynamically via SRDS):
3496///
3497/// .. code::
3498///
3499/// (1)
3500/// name: route-scope1
3501/// route_configuration_name: route-config1
3502/// key:
3503/// fragments:
3504/// - string_key: 172.10.10.20
3505///
3506/// (2)
3507/// name: route-scope2
3508/// route_configuration_name: route-config2
3509/// key:
3510/// fragments:
3511/// - string_key: 172.20.20.30
3512///
3513/// A request from a client such as:
3514///
3515/// .. code::
3516///
3517/// GET / HTTP/1.1
3518/// Host: foo.com
3519/// X-Route-Selector: vip=172.10.10.20
3520///
3521/// would result in the routing table defined by the ``route-config1``
3522/// RouteConfiguration being assigned to the HTTP request/stream.
3523///
3524/// \[#next-free-field: 6\]
3525#[derive(Clone, PartialEq, ::prost::Message)]
3526pub struct ScopedRouteConfiguration {
3527 /// Whether the RouteConfiguration should be loaded on demand.
3528 #[prost(bool, tag = "4")]
3529 pub on_demand: bool,
3530 /// The name assigned to the routing scope.
3531 #[prost(string, tag = "1")]
3532 pub name: ::prost::alloc::string::String,
3533 /// The resource name to use for a :ref:`envoy_v3_api_msg_service.discovery.v3.DiscoveryRequest` to an
3534 /// RDS server to fetch the :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` associated
3535 /// with this scope.
3536 #[prost(string, tag = "2")]
3537 pub route_configuration_name: ::prost::alloc::string::String,
3538 /// The :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` associated with the scope.
3539 #[prost(message, optional, tag = "5")]
3540 pub route_configuration: ::core::option::Option<RouteConfiguration>,
3541 /// The key to match against.
3542 #[prost(message, optional, tag = "3")]
3543 pub key: ::core::option::Option<scoped_route_configuration::Key>,
3544}
3545/// Nested message and enum types in `ScopedRouteConfiguration`.
3546pub mod scoped_route_configuration {
3547 /// Specifies a key which is matched against the output of the
3548 /// :ref:`scope_key_builder<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder>`
3549 /// specified in the HttpConnectionManager. The matching is done per HTTP
3550 /// request and is dependent on the order of the fragments contained in the
3551 /// Key.
3552 #[derive(Clone, PartialEq, ::prost::Message)]
3553 pub struct Key {
3554 /// The ordered set of fragments to match against. The order must match the
3555 /// fragments in the corresponding
3556 /// :ref:`scope_key_builder<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder>`.
3557 #[prost(message, repeated, tag = "1")]
3558 pub fragments: ::prost::alloc::vec::Vec<key::Fragment>,
3559 }
3560 /// Nested message and enum types in `Key`.
3561 pub mod key {
3562 #[derive(Clone, PartialEq, ::prost::Message)]
3563 pub struct Fragment {
3564 #[prost(oneof = "fragment::Type", tags = "1")]
3565 pub r#type: ::core::option::Option<fragment::Type>,
3566 }
3567 /// Nested message and enum types in `Fragment`.
3568 pub mod fragment {
3569 #[derive(Clone, PartialEq, ::prost::Oneof)]
3570 pub enum Type {
3571 /// A string to match against.
3572 #[prost(string, tag = "1")]
3573 StringKey(::prost::alloc::string::String),
3574 }
3575 }
3576 impl ::prost::Name for Fragment {
3577 const NAME: &'static str = "Fragment";
3578 const PACKAGE: &'static str = "envoy.config.route.v3";
3579 fn full_name() -> ::prost::alloc::string::String {
3580 "envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment".into()
3581 }
3582 fn type_url() -> ::prost::alloc::string::String {
3583 "type.googleapis.com/envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment"
3584 .into()
3585 }
3586 }
3587 }
3588 impl ::prost::Name for Key {
3589 const NAME: &'static str = "Key";
3590 const PACKAGE: &'static str = "envoy.config.route.v3";
3591 fn full_name() -> ::prost::alloc::string::String {
3592 "envoy.config.route.v3.ScopedRouteConfiguration.Key".into()
3593 }
3594 fn type_url() -> ::prost::alloc::string::String {
3595 "type.googleapis.com/envoy.config.route.v3.ScopedRouteConfiguration.Key"
3596 .into()
3597 }
3598 }
3599}
3600impl ::prost::Name for ScopedRouteConfiguration {
3601 const NAME: &'static str = "ScopedRouteConfiguration";
3602 const PACKAGE: &'static str = "envoy.config.route.v3";
3603 fn full_name() -> ::prost::alloc::string::String {
3604 "envoy.config.route.v3.ScopedRouteConfiguration".into()
3605 }
3606 fn type_url() -> ::prost::alloc::string::String {
3607 "type.googleapis.com/envoy.config.route.v3.ScopedRouteConfiguration".into()
3608 }
3609}