envoy_types/generated/envoy.extensions.filters.http.custom_response.v3.rs
1// This file is @generated by prost-build.
2/// The filter configuration is a collection of custom response
3/// policies in a matcher tree. The configuration can be defined at the filter,
4/// virtual host or route level. The response will be matched against the most
5/// specific to the least specific config, till a match is found.
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct CustomResponse {
8 ///
9 /// Matcher to match against the original response to select a
10 /// : ref:`Custom Response Policy <extension_category_envoy.http.custom_response>`
11 /// that will override the original response. The matching is done by matching
12 /// against :ref:`response header values<extension_category_envoy.matching.http.input>`
13 /// Example:
14 ///
15 /// .. validated-code-block:: yaml
16 /// : type-name: xds.type.matcher.v3.Matcher
17 ///
18 ///
19 /// matcher_list:
20 /// matchers:
21 /// \# Apply a locally stored custom response to any 4xx response.
22 /// - predicate:
23 /// single_predicate:
24 /// input:
25 /// name: 4xx_response
26 /// typed_config:
27 /// "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput
28 /// value_match:
29 /// exact: "4xx"
30 /// on_match:
31 /// action:
32 /// name: action
33 /// typed_config:
34 /// "@type": type.googleapis.com/envoy.extensions.http.custom_response.local_response_policy.v3.LocalResponsePolicy
35 /// status_code: 499
36 /// body:
37 /// inline_string: "not allowed"
38 /// body_format:
39 /// json_format:
40 /// status: "%RESPONSE_CODE%"
41 /// message: "%LOCAL_REPLY_BODY%"
42 /// response_headers_to_add:
43 /// - header:
44 /// key: "foo"
45 /// value: "x-bar"
46 /// \# Redirect to different upstream if the status code is one of 502, 503 or 504.
47 /// - predicate:
48 /// or_matcher:
49 /// predicate:
50 /// - single_predicate:
51 /// input:
52 /// name: "502_response"
53 /// typed_config:
54 /// "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput
55 /// value_match:
56 /// exact: "502"
57 /// - single_predicate:
58 /// input:
59 /// name: "503_response"
60 /// typed_config:
61 /// "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput
62 /// value_match:
63 /// exact: "503"
64 /// - single_predicate:
65 /// input:
66 /// name: "504_response"
67 /// typed_config:
68 /// "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput
69 /// value_match:
70 /// exact: "504"
71 /// on_match:
72 /// action:
73 /// name: action
74 /// typed_config:
75 /// "@type": type.googleapis.com/envoy.extensions.http.custom_response.redirect_policy.v3.RedirectPolicy
76 /// status_code: 299
77 /// uri: "<https://foo.example/gateway_error">
78 /// response_headers_to_add:
79 /// - header:
80 /// key: "foo2"
81 /// value: "x-bar2"
82 ///
83 /// -- attention::
84 /// The first matched policy wins. Once the response is matched, matcher
85 /// evaluations end.
86 ///
87 /// Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>`
88 /// documentation for more information on the matcher trees.
89 /// \[\#extension-category: envoy.http.custom_response\]
90 #[prost(message, optional, tag = "1")]
91 pub custom_response_matcher: ::core::option::Option<
92 super::super::super::super::super::super::xds::r#type::matcher::v3::Matcher,
93 >,
94}