envoy_types/generated/
envoy.extensions.filters.http.ip_tagging.v3.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// This file is @generated by prost-build.
/// \[\#next-free-field: 6\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IpTagging {
    /// The type of request the filter should apply to.
    #[prost(enumeration = "ip_tagging::RequestType", tag = "1")]
    pub request_type: i32,
    /// \[\#comment:TODO(ccaraman): Extend functionality to load IP tags from file system.
    /// Tracked by issue <https://github.com/envoyproxy/envoy/issues/2695\]>
    /// The set of IP tags for the filter.
    #[prost(message, repeated, tag = "4")]
    pub ip_tags: ::prost::alloc::vec::Vec<ip_tagging::IpTag>,
    /// Specify to which header the tags will be written.
    ///
    /// If left unspecified, the tags will be appended to the `x-envoy-ip-tags` header.
    #[prost(message, optional, tag = "5")]
    pub ip_tag_header: ::core::option::Option<ip_tagging::IpTagHeader>,
}
/// Nested message and enum types in `IPTagging`.
pub mod ip_tagging {
    /// Supplies the IP tag name and the IP address subnets.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IpTag {
        /// Specifies the IP tag name to apply.
        #[prost(string, tag = "1")]
        pub ip_tag_name: ::prost::alloc::string::String,
        /// A list of IP address subnets that will be tagged with
        /// ip_tag_name. Both IPv4 and IPv6 are supported.
        #[prost(message, repeated, tag = "2")]
        pub ip_list: ::prost::alloc::vec::Vec<
            super::super::super::super::super::super::config::core::v3::CidrRange,
        >,
    }
    /// Specify to which header the tags will be written.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IpTagHeader {
        /// Header to use for ip-tagging.
        ///
        ///
        /// This header will be sanitized based on the config in
        /// : ref:`action <envoy_v3_api_field_extensions.filters.http.ip_tagging.v3.IPTagging.IpTagHeader.action>`
        /// rather than the defaults for x-envoy prefixed headers.
        #[prost(string, tag = "1")]
        pub header: ::prost::alloc::string::String,
        /// Control if the :ref:`header <envoy_v3_api_field_extensions.filters.http.ip_tagging.v3.IPTagging.IpTagHeader.header>`
        /// will be sanitized, or be appended to.
        ///
        /// Default: *SANITIZE*.
        #[prost(enumeration = "ip_tag_header::HeaderAction", tag = "2")]
        pub action: i32,
    }
    /// Nested message and enum types in `IpTagHeader`.
    pub mod ip_tag_header {
        /// Describes how to apply the tags to the headers.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum HeaderAction {
            /// (DEFAULT) The header specified in :ref:`ip_tag_header <envoy_v3_api_field_extensions.filters.http.ip_tagging.v3.IPTagging.ip_tag_header>`
            /// will be dropped, before the tags are applied. The incoming header will be "sanitized" regardless of whether the request is internal or external.
            ///
            /// Note that the header will be visible unsanitized to any filters that are invoked before the ip-tag-header filter, unless it has an *x-envoy* prefix.
            Sanitize = 0,
            ///
            /// Tags will be appended to the header specified in
            /// : ref:`ip_tag_header <envoy_v3_api_field_extensions.filters.http.ip_tagging.v3.IPTagging.ip_tag_header>`.
            /// Please note that this could cause the header to retain values set by the http client regardless of whether the request is internal or external.
            AppendIfExistsOrAdd = 1,
        }
        impl HeaderAction {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Self::Sanitize => "SANITIZE",
                    Self::AppendIfExistsOrAdd => "APPEND_IF_EXISTS_OR_ADD",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "SANITIZE" => Some(Self::Sanitize),
                    "APPEND_IF_EXISTS_OR_ADD" => Some(Self::AppendIfExistsOrAdd),
                    _ => None,
                }
            }
        }
    }
    ///
    /// The type of requests the filter should apply to. The supported types
    /// are internal, external or both. The
    /// : ref:`x-forwarded-for<config_http_conn_man_headers_x-forwarded-for_internal_origin>` header is
    /// used to determine if a request is internal and will result in
    /// : ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>`
    /// being set. The filter defaults to both, and it will apply to all request types.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum RequestType {
        /// Both external and internal requests will be tagged. This is the default value.
        Both = 0,
        /// Only internal requests will be tagged.
        Internal = 1,
        /// Only external requests will be tagged.
        External = 2,
    }
    impl RequestType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Both => "BOTH",
                Self::Internal => "INTERNAL",
                Self::External => "EXTERNAL",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "BOTH" => Some(Self::Both),
                "INTERNAL" => Some(Self::Internal),
                "EXTERNAL" => Some(Self::External),
                _ => None,
            }
        }
    }
}