summaryrefslogtreecommitdiff
path: root/src/rpc/envoy.service.network_ext_proc.v3.rs
blob: 18575facd7d253db95477e2fc2a759f593cad70b (plain)
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
150
151
152
153
154
155
156
// @generated
// This file is @generated by prost-build.
/// The payload data from network layer
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Data {
    /// The raw payload data
    #[prost(bytes="vec", tag="1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// Indicates whether this is the last data frame in the current direction.
    /// The external processor should still respond to this message even
    /// if there is no more data expected in this direction.
    #[prost(bool, tag="2")]
    pub end_of_stream: bool,
}
/// ProcessingRequest contains data sent from Envoy to the external processing server.
/// Each request contains either read data (from client) or write data (to client)
/// along with optional metadata.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessingRequest {
    /// ReadData contains the network data intercepted in the request path (client to server).
    /// This is sent to the external processor when data arrives from the downstream client.
    /// If this is set, write_data should not be set.
    #[prost(message, optional, tag="1")]
    pub read_data: ::core::option::Option<Data>,
    /// WriteData contains the network data intercepted in the response path (server to client).
    /// This is sent to the external processor when data arrives from the upstream server.
    /// If this is set, read_data should not be set.
    #[prost(message, optional, tag="2")]
    pub write_data: ::core::option::Option<Data>,
    /// Optional metadata associated with the request.
    /// This can include connection properties, filter configuration, and any other
    /// contextual information that might be useful for processing decisions.
    ///
    /// The metadata is not automatically propagated from request to response.
    /// The external processor must include any needed metadata in its response.
    #[prost(message, optional, tag="3")]
    pub metadata: ::core::option::Option<super::super::super::config::core::v3::Metadata>,
}
/// ProcessingResponse contains the response from the external processing server to Envoy.
/// Each response corresponds to a ProcessingRequest and indicates how the network
/// traffic should be handled.
/// \[#next-free-field: 6\]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessingResponse {
    /// The processed ReadData containing potentially modified data for the request path.
    /// This should be sent in response to a ProcessingRequest with read_data, and the
    /// previous data in ProcessingRequest will be replaced by the new data in Envoy's data plane.
    /// If this is set, write_data should not be set.
    #[prost(message, optional, tag="1")]
    pub read_data: ::core::option::Option<Data>,
    /// The processed WriteData containing potentially modified data for the response path.
    /// This should be sent in response to a ProcessingRequest with write_data, and the
    /// previous data in ProcessingRequest will be replaced by the new data in Envoy's data plane.
    /// If this is set, read_data should not be set.
    #[prost(message, optional, tag="2")]
    pub write_data: ::core::option::Option<Data>,
    /// Indicates whether the data was modified or not.
    /// This is mandatory and tells Envoy whether to use the original or modified data.
    #[prost(enumeration="processing_response::DataProcessedStatus", tag="3")]
    pub data_processing_status: i32,
    /// Optional: Determines the connection behavior after processing.
    /// If not specified, CONTINUE is assumed, and the connection proceeds normally.
    /// Use CLOSE or CLOSE_RST to terminate the connection based on processing results.
    #[prost(enumeration="processing_response::ConnectionStatus", tag="4")]
    pub connection_status: i32,
    /// Optional metadata associated with the request.
    /// This can include connection properties, filter configuration, and any other
    /// contextual information that might be useful for processing decisions.
    ///
    /// The metadata is not automatically propagated from request to response.
    /// The external processor must include any needed metadata in its response.
    #[prost(message, optional, tag="5")]
    pub dynamic_metadata: ::core::option::Option<super::super::super::super::google::protobuf::Struct>,
}
/// Nested message and enum types in `ProcessingResponse`.
pub mod processing_response {
    /// DataProcessedStatus indicates whether the data was modified by the external processor.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum DataProcessedStatus {
        /// The data processed status is unknown.
        Unknown = 0,
        /// The data remains unchanged. Envoy will use the original data.
        /// This is useful when the processor only wants to inspect but not modify the traffic.
        Unmodified = 1,
        /// The data has been modified. Envoy will use the modified data provided in the response.
        /// This allows the processor to transform the network traffic as needed.
        Modified = 2,
    }
    impl DataProcessedStatus {
        /// 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 {
                DataProcessedStatus::Unknown => "UNKNOWN",
                DataProcessedStatus::Unmodified => "UNMODIFIED",
                DataProcessedStatus::Modified => "MODIFIED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNKNOWN" => Some(Self::Unknown),
                "UNMODIFIED" => Some(Self::Unmodified),
                "MODIFIED" => Some(Self::Modified),
                _ => None,
            }
        }
    }
    /// ConnectionStatus determines what happens to the connection after processing.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum ConnectionStatus {
        /// Continue normal processing of the connection.
        /// This is the default behavior and allows traffic to flow normally.
        Continue = 0,
        /// Close the connection with normal TCP FIN.
        /// This allows for clean connection termination with a normal close sequence.
        /// Any buffered data will be sent before closing.
        Close = 1,
        /// Immediately reset the connection with TCP RST.
        /// This forcibly terminates the connection without a clean shutdown,
        /// discarding any buffered data. Use this for security-critical situations
        /// or when immediate termination is required.
        CloseRst = 2,
    }
    impl ConnectionStatus {
        /// 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 {
                ConnectionStatus::Continue => "CONTINUE",
                ConnectionStatus::Close => "CLOSE",
                ConnectionStatus::CloseRst => "CLOSE_RST",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CONTINUE" => Some(Self::Continue),
                "CLOSE" => Some(Self::Close),
                "CLOSE_RST" => Some(Self::CloseRst),
                _ => None,
            }
        }
    }
}
include!("envoy.service.network_ext_proc.v3.tonic.rs");
// @@protoc_insertion_point(module)