xds_api/generated/
envoy.config.common.matcher.v3.rs

1// This file is @generated by prost-build.
2/// A matcher, which may traverse a matching tree in order to result in a match action.
3/// During matching, the tree will be traversed until a match is found, or if no match
4/// is found the action specified by the most specific on_no_match will be evaluated.
5/// As an on_no_match might result in another matching tree being evaluated, this process
6/// might repeat several times until the final OnMatch (or no match) is decided.
7///
8/// .. note::
9///    Please use the syntactically equivalent :ref:`matching API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>`
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct Matcher {
12    /// Optional OnMatch to use if the matcher failed.
13    /// If specified, the OnMatch is used, and the matcher is considered
14    /// to have matched.
15    /// If not specified, the matcher is considered not to have matched.
16    #[prost(message, optional, boxed, tag = "3")]
17    pub on_no_match: ::core::option::Option<
18        ::prost::alloc::boxed::Box<matcher::OnMatch>,
19    >,
20    #[prost(oneof = "matcher::MatcherType", tags = "1, 2")]
21    pub matcher_type: ::core::option::Option<matcher::MatcherType>,
22}
23/// Nested message and enum types in `Matcher`.
24pub mod matcher {
25    /// What to do if a match is successful.
26    #[derive(Clone, PartialEq, ::prost::Message)]
27    pub struct OnMatch {
28        #[prost(oneof = "on_match::OnMatch", tags = "1, 2")]
29        pub on_match: ::core::option::Option<on_match::OnMatch>,
30    }
31    /// Nested message and enum types in `OnMatch`.
32    pub mod on_match {
33        #[derive(Clone, PartialEq, ::prost::Oneof)]
34        pub enum OnMatch {
35            /// Nested matcher to evaluate.
36            /// If the nested matcher does not match and does not specify
37            /// on_no_match, then this matcher is considered not to have
38            /// matched, even if a predicate at this level or above returned
39            /// true.
40            #[prost(message, tag = "1")]
41            Matcher(::prost::alloc::boxed::Box<super::super::Matcher>),
42            /// Protocol-specific action to take.
43            #[prost(message, tag = "2")]
44            Action(super::super::super::super::super::core::v3::TypedExtensionConfig),
45        }
46    }
47    impl ::prost::Name for OnMatch {
48        const NAME: &'static str = "OnMatch";
49        const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
50        fn full_name() -> ::prost::alloc::string::String {
51            "envoy.config.common.matcher.v3.Matcher.OnMatch".into()
52        }
53        fn type_url() -> ::prost::alloc::string::String {
54            "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.OnMatch".into()
55        }
56    }
57    /// A linear list of field matchers.
58    /// The field matchers are evaluated in order, and the first match
59    /// wins.
60    #[derive(Clone, PartialEq, ::prost::Message)]
61    pub struct MatcherList {
62        /// A list of matchers. First match wins.
63        #[prost(message, repeated, tag = "1")]
64        pub matchers: ::prost::alloc::vec::Vec<matcher_list::FieldMatcher>,
65    }
66    /// Nested message and enum types in `MatcherList`.
67    pub mod matcher_list {
68        /// Predicate to determine if a match is successful.
69        #[derive(Clone, PartialEq, ::prost::Message)]
70        pub struct Predicate {
71            #[prost(oneof = "predicate::MatchType", tags = "1, 2, 3, 4")]
72            pub match_type: ::core::option::Option<predicate::MatchType>,
73        }
74        /// Nested message and enum types in `Predicate`.
75        pub mod predicate {
76            /// Predicate for a single input field.
77            #[derive(Clone, PartialEq, ::prost::Message)]
78            pub struct SinglePredicate {
79                /// Protocol-specific specification of input field to match on.
80                /// \[#extension-category: envoy.matching.common_inputs\]
81                #[prost(message, optional, tag = "1")]
82                pub input: ::core::option::Option<
83                    super::super::super::super::super::super::core::v3::TypedExtensionConfig,
84                >,
85                #[prost(oneof = "single_predicate::Matcher", tags = "2, 3")]
86                pub matcher: ::core::option::Option<single_predicate::Matcher>,
87            }
88            /// Nested message and enum types in `SinglePredicate`.
89            pub mod single_predicate {
90                #[derive(Clone, PartialEq, ::prost::Oneof)]
91                pub enum Matcher {
92                    /// Built-in string matcher.
93                    #[prost(message, tag = "2")]
94                    ValueMatch(
95                        super::super::super::super::super::super::super::super::r#type::matcher::v3::StringMatcher,
96                    ),
97                    /// Extension for custom matching logic.
98                    /// \[#extension-category: envoy.matching.input_matchers\]
99                    #[prost(message, tag = "3")]
100                    CustomMatch(
101                        super::super::super::super::super::super::super::core::v3::TypedExtensionConfig,
102                    ),
103                }
104            }
105            impl ::prost::Name for SinglePredicate {
106                const NAME: &'static str = "SinglePredicate";
107                const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
108                fn full_name() -> ::prost::alloc::string::String {
109                    "envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate"
110                        .into()
111                }
112                fn type_url() -> ::prost::alloc::string::String {
113                    "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate"
114                        .into()
115                }
116            }
117            /// A list of two or more matchers. Used to allow using a list within a oneof.
118            #[derive(Clone, PartialEq, ::prost::Message)]
119            pub struct PredicateList {
120                #[prost(message, repeated, tag = "1")]
121                pub predicate: ::prost::alloc::vec::Vec<super::Predicate>,
122            }
123            impl ::prost::Name for PredicateList {
124                const NAME: &'static str = "PredicateList";
125                const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
126                fn full_name() -> ::prost::alloc::string::String {
127                    "envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.PredicateList"
128                        .into()
129                }
130                fn type_url() -> ::prost::alloc::string::String {
131                    "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.PredicateList"
132                        .into()
133                }
134            }
135            #[derive(Clone, PartialEq, ::prost::Oneof)]
136            pub enum MatchType {
137                /// A single predicate to evaluate.
138                #[prost(message, tag = "1")]
139                SinglePredicate(SinglePredicate),
140                /// A list of predicates to be OR-ed together.
141                #[prost(message, tag = "2")]
142                OrMatcher(PredicateList),
143                /// A list of predicates to be AND-ed together.
144                #[prost(message, tag = "3")]
145                AndMatcher(PredicateList),
146                /// The invert of a predicate
147                #[prost(message, tag = "4")]
148                NotMatcher(::prost::alloc::boxed::Box<super::Predicate>),
149            }
150        }
151        impl ::prost::Name for Predicate {
152            const NAME: &'static str = "Predicate";
153            const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
154            fn full_name() -> ::prost::alloc::string::String {
155                "envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate".into()
156            }
157            fn type_url() -> ::prost::alloc::string::String {
158                "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate"
159                    .into()
160            }
161        }
162        /// An individual matcher.
163        #[derive(Clone, PartialEq, ::prost::Message)]
164        pub struct FieldMatcher {
165            /// Determines if the match succeeds.
166            #[prost(message, optional, tag = "1")]
167            pub predicate: ::core::option::Option<Predicate>,
168            /// What to do if the match succeeds.
169            #[prost(message, optional, tag = "2")]
170            pub on_match: ::core::option::Option<super::OnMatch>,
171        }
172        impl ::prost::Name for FieldMatcher {
173            const NAME: &'static str = "FieldMatcher";
174            const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
175            fn full_name() -> ::prost::alloc::string::String {
176                "envoy.config.common.matcher.v3.Matcher.MatcherList.FieldMatcher".into()
177            }
178            fn type_url() -> ::prost::alloc::string::String {
179                "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherList.FieldMatcher"
180                    .into()
181            }
182        }
183    }
184    impl ::prost::Name for MatcherList {
185        const NAME: &'static str = "MatcherList";
186        const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
187        fn full_name() -> ::prost::alloc::string::String {
188            "envoy.config.common.matcher.v3.Matcher.MatcherList".into()
189        }
190        fn type_url() -> ::prost::alloc::string::String {
191            "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherList"
192                .into()
193        }
194    }
195    #[derive(Clone, PartialEq, ::prost::Message)]
196    pub struct MatcherTree {
197        /// Protocol-specific specification of input field to match on.
198        #[prost(message, optional, tag = "1")]
199        pub input: ::core::option::Option<
200            super::super::super::super::core::v3::TypedExtensionConfig,
201        >,
202        /// Exact or prefix match maps in which to look up the input value.
203        /// If the lookup succeeds, the match is considered successful, and
204        /// the corresponding OnMatch is used.
205        #[prost(oneof = "matcher_tree::TreeType", tags = "2, 3, 4")]
206        pub tree_type: ::core::option::Option<matcher_tree::TreeType>,
207    }
208    /// Nested message and enum types in `MatcherTree`.
209    pub mod matcher_tree {
210        /// A map of configured matchers. Used to allow using a map within a oneof.
211        #[derive(Clone, PartialEq, ::prost::Message)]
212        pub struct MatchMap {
213            #[prost(map = "string, message", tag = "1")]
214            pub map: ::std::collections::HashMap<
215                ::prost::alloc::string::String,
216                super::OnMatch,
217            >,
218        }
219        impl ::prost::Name for MatchMap {
220            const NAME: &'static str = "MatchMap";
221            const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
222            fn full_name() -> ::prost::alloc::string::String {
223                "envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap".into()
224            }
225            fn type_url() -> ::prost::alloc::string::String {
226                "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap"
227                    .into()
228            }
229        }
230        /// Exact or prefix match maps in which to look up the input value.
231        /// If the lookup succeeds, the match is considered successful, and
232        /// the corresponding OnMatch is used.
233        #[derive(Clone, PartialEq, ::prost::Oneof)]
234        pub enum TreeType {
235            #[prost(message, tag = "2")]
236            ExactMatchMap(MatchMap),
237            /// Longest matching prefix wins.
238            #[prost(message, tag = "3")]
239            PrefixMatchMap(MatchMap),
240            /// Extension for custom matching logic.
241            #[prost(message, tag = "4")]
242            CustomMatch(
243                super::super::super::super::super::core::v3::TypedExtensionConfig,
244            ),
245        }
246    }
247    impl ::prost::Name for MatcherTree {
248        const NAME: &'static str = "MatcherTree";
249        const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
250        fn full_name() -> ::prost::alloc::string::String {
251            "envoy.config.common.matcher.v3.Matcher.MatcherTree".into()
252        }
253        fn type_url() -> ::prost::alloc::string::String {
254            "type.googleapis.com/envoy.config.common.matcher.v3.Matcher.MatcherTree"
255                .into()
256        }
257    }
258    #[derive(Clone, PartialEq, ::prost::Oneof)]
259    pub enum MatcherType {
260        /// A linear list of matchers to evaluate.
261        #[prost(message, tag = "1")]
262        MatcherList(MatcherList),
263        /// A match tree to evaluate.
264        #[prost(message, tag = "2")]
265        MatcherTree(MatcherTree),
266    }
267}
268impl ::prost::Name for Matcher {
269    const NAME: &'static str = "Matcher";
270    const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
271    fn full_name() -> ::prost::alloc::string::String {
272        "envoy.config.common.matcher.v3.Matcher".into()
273    }
274    fn type_url() -> ::prost::alloc::string::String {
275        "type.googleapis.com/envoy.config.common.matcher.v3.Matcher".into()
276    }
277}
278/// Match configuration. This is a recursive structure which allows complex nested match
279/// configurations to be built using various logical operators.
280/// \[#next-free-field: 11\]
281#[derive(Clone, PartialEq, ::prost::Message)]
282pub struct MatchPredicate {
283    #[prost(oneof = "match_predicate::Rule", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
284    pub rule: ::core::option::Option<match_predicate::Rule>,
285}
286/// Nested message and enum types in `MatchPredicate`.
287pub mod match_predicate {
288    /// A set of match configurations used for logical operations.
289    #[derive(Clone, PartialEq, ::prost::Message)]
290    pub struct MatchSet {
291        /// The list of rules that make up the set.
292        #[prost(message, repeated, tag = "1")]
293        pub rules: ::prost::alloc::vec::Vec<super::MatchPredicate>,
294    }
295    impl ::prost::Name for MatchSet {
296        const NAME: &'static str = "MatchSet";
297        const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
298        fn full_name() -> ::prost::alloc::string::String {
299            "envoy.config.common.matcher.v3.MatchPredicate.MatchSet".into()
300        }
301        fn type_url() -> ::prost::alloc::string::String {
302            "type.googleapis.com/envoy.config.common.matcher.v3.MatchPredicate.MatchSet"
303                .into()
304        }
305    }
306    #[derive(Clone, PartialEq, ::prost::Oneof)]
307    pub enum Rule {
308        /// A set that describes a logical OR. If any member of the set matches, the match configuration
309        /// matches.
310        #[prost(message, tag = "1")]
311        OrMatch(MatchSet),
312        /// A set that describes a logical AND. If all members of the set match, the match configuration
313        /// matches.
314        #[prost(message, tag = "2")]
315        AndMatch(MatchSet),
316        /// A negation match. The match configuration will match if the negated match condition matches.
317        #[prost(message, tag = "3")]
318        NotMatch(::prost::alloc::boxed::Box<super::MatchPredicate>),
319        /// The match configuration will always match.
320        #[prost(bool, tag = "4")]
321        AnyMatch(bool),
322        /// HTTP request headers match configuration.
323        #[prost(message, tag = "5")]
324        HttpRequestHeadersMatch(super::HttpHeadersMatch),
325        /// HTTP request trailers match configuration.
326        #[prost(message, tag = "6")]
327        HttpRequestTrailersMatch(super::HttpHeadersMatch),
328        /// HTTP response headers match configuration.
329        #[prost(message, tag = "7")]
330        HttpResponseHeadersMatch(super::HttpHeadersMatch),
331        /// HTTP response trailers match configuration.
332        #[prost(message, tag = "8")]
333        HttpResponseTrailersMatch(super::HttpHeadersMatch),
334        /// HTTP request generic body match configuration.
335        #[prost(message, tag = "9")]
336        HttpRequestGenericBodyMatch(super::HttpGenericBodyMatch),
337        /// HTTP response generic body match configuration.
338        #[prost(message, tag = "10")]
339        HttpResponseGenericBodyMatch(super::HttpGenericBodyMatch),
340    }
341}
342impl ::prost::Name for MatchPredicate {
343    const NAME: &'static str = "MatchPredicate";
344    const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
345    fn full_name() -> ::prost::alloc::string::String {
346        "envoy.config.common.matcher.v3.MatchPredicate".into()
347    }
348    fn type_url() -> ::prost::alloc::string::String {
349        "type.googleapis.com/envoy.config.common.matcher.v3.MatchPredicate".into()
350    }
351}
352/// HTTP headers match configuration.
353#[derive(Clone, PartialEq, ::prost::Message)]
354pub struct HttpHeadersMatch {
355    /// HTTP headers to match.
356    #[prost(message, repeated, tag = "1")]
357    pub headers: ::prost::alloc::vec::Vec<super::super::super::route::v3::HeaderMatcher>,
358}
359impl ::prost::Name for HttpHeadersMatch {
360    const NAME: &'static str = "HttpHeadersMatch";
361    const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
362    fn full_name() -> ::prost::alloc::string::String {
363        "envoy.config.common.matcher.v3.HttpHeadersMatch".into()
364    }
365    fn type_url() -> ::prost::alloc::string::String {
366        "type.googleapis.com/envoy.config.common.matcher.v3.HttpHeadersMatch".into()
367    }
368}
369/// HTTP generic body match configuration.
370/// List of text strings and hex strings to be located in HTTP body.
371/// All specified strings must be found in the HTTP body for positive match.
372/// The search may be limited to specified number of bytes from the body start.
373///
374/// .. attention::
375///
376///    Searching for patterns in HTTP body is potentially cpu intensive. For each specified pattern, http body is scanned byte by byte to find a match.
377///    If multiple patterns are specified, the process is repeated for each pattern. If location of a pattern is known, ``bytes_limit`` should be specified
378///    to scan only part of the http body.
379#[derive(Clone, PartialEq, ::prost::Message)]
380pub struct HttpGenericBodyMatch {
381    /// Limits search to specified number of bytes - default zero (no limit - match entire captured buffer).
382    #[prost(uint32, tag = "1")]
383    pub bytes_limit: u32,
384    /// List of patterns to match.
385    #[prost(message, repeated, tag = "2")]
386    pub patterns: ::prost::alloc::vec::Vec<http_generic_body_match::GenericTextMatch>,
387}
388/// Nested message and enum types in `HttpGenericBodyMatch`.
389pub mod http_generic_body_match {
390    #[derive(Clone, PartialEq, ::prost::Message)]
391    pub struct GenericTextMatch {
392        #[prost(oneof = "generic_text_match::Rule", tags = "1, 2")]
393        pub rule: ::core::option::Option<generic_text_match::Rule>,
394    }
395    /// Nested message and enum types in `GenericTextMatch`.
396    pub mod generic_text_match {
397        #[derive(Clone, PartialEq, ::prost::Oneof)]
398        pub enum Rule {
399            /// Text string to be located in HTTP body.
400            #[prost(string, tag = "1")]
401            StringMatch(::prost::alloc::string::String),
402            /// Sequence of bytes to be located in HTTP body.
403            #[prost(bytes, tag = "2")]
404            BinaryMatch(::prost::alloc::vec::Vec<u8>),
405        }
406    }
407    impl ::prost::Name for GenericTextMatch {
408        const NAME: &'static str = "GenericTextMatch";
409        const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
410        fn full_name() -> ::prost::alloc::string::String {
411            "envoy.config.common.matcher.v3.HttpGenericBodyMatch.GenericTextMatch".into()
412        }
413        fn type_url() -> ::prost::alloc::string::String {
414            "type.googleapis.com/envoy.config.common.matcher.v3.HttpGenericBodyMatch.GenericTextMatch"
415                .into()
416        }
417    }
418}
419impl ::prost::Name for HttpGenericBodyMatch {
420    const NAME: &'static str = "HttpGenericBodyMatch";
421    const PACKAGE: &'static str = "envoy.config.common.matcher.v3";
422    fn full_name() -> ::prost::alloc::string::String {
423        "envoy.config.common.matcher.v3.HttpGenericBodyMatch".into()
424    }
425    fn type_url() -> ::prost::alloc::string::String {
426        "type.googleapis.com/envoy.config.common.matcher.v3.HttpGenericBodyMatch".into()
427    }
428}