diff --git a/.protoc-version b/.protoc-version index 383283e..5c1a3ae 100644 --- a/.protoc-version +++ b/.protoc-version @@ -1 +1 @@ -27.3 +31.1 diff --git a/Cargo.lock b/Cargo.lock index 977dd3b..17ba112 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -171,12 +171,13 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "getrandom" -version = "0.2.15" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", + "r-efi", "wasi", ] @@ -470,22 +471,27 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" -version = "0.8.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ - "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", "rand_core", @@ -493,9 +499,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom", ] @@ -682,9 +688,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9" dependencies = [ "async-trait", "base64 0.22.1", @@ -703,9 +709,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" +checksum = "eac6f67be712d12f0b41328db3137e0d0757645d8904b4cb7d51cd9c2279e847" dependencies = [ "prettyplease", "proc-macro2", @@ -766,9 +772,12 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] [[package]] name = "windows-sys" @@ -861,6 +870,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + [[package]] name = "xds-api" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 3d2cdf1..42ba980 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ doctest = false [dependencies] enum-map = "2.7" prost = "0.13" -tonic = { version = "0.12", default-features = false, features = [ +tonic = { version = "0.13", default-features = false, features = [ "prost", "codegen", ] } @@ -31,6 +31,7 @@ serde = { version = "1.0", optional = true } [features] pbjson = ["dep:pbjson", "dep:serde"] descriptor = [] +generate_only = [] [dev-dependencies] anyhow = "1" @@ -38,11 +39,9 @@ glob = "0.3" pbjson-build = "0.7" prost-build = "0.13" prost-types = "0.13" -rand = "0.8" +rand = "0.9" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" toml = "0.8" -tonic-build = { version = "0.12", default-features = false, features = [ - "prost", -] } +tonic-build = { version = "0.13", default-features = false, features = ["prost"] } xshell = "0.2" diff --git a/protobufs.toml b/protobufs.toml index cd445e1..14fa3b8 100644 --- a/protobufs.toml +++ b/protobufs.toml @@ -4,9 +4,9 @@ # the other dependencies in this file. The git refs here MUST match the versions # listed in enovyproxy/data-plane-api.git/bazel/repository_locations.bzl. [dependencies] -envoy-data-plane = { repo_url = "https://github.com/envoyproxy/data-plane-api.git", git_ref = "786c93ccaae9891338f098a5aba60e9987d78bd3" } -cncf-xds = { repo_url = "https://github.com/cncf/xds", git_ref = "555b57ec207be86f811fb0c04752db6f85e3d7e2" } +envoy-data-plane = { repo_url = "https://github.com/envoyproxy/data-plane-api.git", git_ref = "09409f495015a2a144d421300458d3ad49e20031" } +cncf-xds = { repo_url = "https://github.com/cncf/xds", git_ref = "2ac532fd44436293585084f8d94c6bdb17835af0" } protoc-gen-validate = { repo_url = "https://github.com/bufbuild/protoc-gen-validate", git_ref = "v1.0.4" } -googleapis = { repo_url = "https://github.com/googleapis/googleapis", git_ref = "114a745b2841a044e98cdbb19358ed29fcf4a5f1" } -opencensus-proto = { repo_url = "https://github.com/census-instrumentation/opencensus-proto", git_ref = "v0.4.1", proto_root = "src" } -prometheus-client-model = { repo_url = "https://github.com/prometheus/client_model", git_ref = "v0.6.1" } +googleapis = { repo_url = "https://github.com/googleapis/googleapis", git_ref = "fd52b5754b2b268bc3a22a10f29844f206abb327" } +opentelemetry-proto = { repo_url = "https://github.com/open-telemetry/opentelemetry-proto", git_ref = "v1.7.0", proto_root = "src" } +prometheus-client-model = { repo_url = "https://github.com/prometheus/client_model", git_ref = "v0.6.2" } diff --git a/src/generated/envoy.admin.v3.rs b/src/generated/envoy.admin.v3.rs index 11518b2..1e7802d 100644 --- a/src/generated/envoy.admin.v3.rs +++ b/src/generated/envoy.admin.v3.rs @@ -647,6 +647,12 @@ pub enum ClientResourceStatus { Acked = 3, /// Client received this resource and replied with NACK. Nacked = 4, + /// Client received an error from the control plane. The attached config + /// dump is the most recent accepted one. If no config is accepted yet, + /// the attached config dump will be empty. + ReceivedError = 5, + /// Client timed out waiting for the resource from the control plane. + Timeout = 6, } impl ClientResourceStatus { /// String value of the enum field names used in the ProtoBuf definition. @@ -660,6 +666,8 @@ impl ClientResourceStatus { Self::DoesNotExist => "DOES_NOT_EXIST", Self::Acked => "ACKED", Self::Nacked => "NACKED", + Self::ReceivedError => "RECEIVED_ERROR", + Self::Timeout => "TIMEOUT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -670,6 +678,8 @@ impl ClientResourceStatus { "DOES_NOT_EXIST" => Some(Self::DoesNotExist), "ACKED" => Some(Self::Acked), "NACKED" => Some(Self::Nacked), + "RECEIVED_ERROR" => Some(Self::ReceivedError), + "TIMEOUT" => Some(Self::Timeout), _ => None, } } diff --git a/src/generated/envoy.admin.v3.serde.rs b/src/generated/envoy.admin.v3.serde.rs index 4ea224f..c372f37 100644 --- a/src/generated/envoy.admin.v3.serde.rs +++ b/src/generated/envoy.admin.v3.serde.rs @@ -10,6 +10,8 @@ impl serde::Serialize for ClientResourceStatus { Self::DoesNotExist => "DOES_NOT_EXIST", Self::Acked => "ACKED", Self::Nacked => "NACKED", + Self::ReceivedError => "RECEIVED_ERROR", + Self::Timeout => "TIMEOUT", }; serializer.serialize_str(variant) } @@ -26,6 +28,8 @@ impl<'de> serde::Deserialize<'de> for ClientResourceStatus { "DOES_NOT_EXIST", "ACKED", "NACKED", + "RECEIVED_ERROR", + "TIMEOUT", ]; struct GeneratedVisitor; @@ -71,6 +75,8 @@ impl<'de> serde::Deserialize<'de> for ClientResourceStatus { "DOES_NOT_EXIST" => Ok(ClientResourceStatus::DoesNotExist), "ACKED" => Ok(ClientResourceStatus::Acked), "NACKED" => Ok(ClientResourceStatus::Nacked), + "RECEIVED_ERROR" => Ok(ClientResourceStatus::ReceivedError), + "TIMEOUT" => Ok(ClientResourceStatus::Timeout), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } diff --git a/src/generated/envoy.config.accesslog.v3.rs b/src/generated/envoy.config.accesslog.v3.rs index 5e6c0b8..744baeb 100644 --- a/src/generated/envoy.config.accesslog.v3.rs +++ b/src/generated/envoy.config.accesslog.v3.rs @@ -227,35 +227,38 @@ impl ::prost::Name for TraceableFilter { "type.googleapis.com/envoy.config.accesslog.v3.TraceableFilter".into() } } -/// Filters for random sampling of requests. +/// Filters requests based on runtime-configurable sampling rates. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RuntimeFilter { - /// Runtime key to get an optional overridden numerator for use in the - /// ``percent_sampled`` field. If found in runtime, this value will replace the - /// default numerator. + /// Specifies a key used to look up a custom sampling rate from the runtime configuration. If a value is found for this + /// key, it will override the default sampling rate specified in ``percent_sampled``. #[prost(string, tag = "1")] pub runtime_key: ::prost::alloc::string::String, - /// The default sampling percentage. If not specified, defaults to 0% with - /// denominator of 100. + /// Defines the default sampling percentage when no runtime override is present. If not specified, the default is + /// **0%** (with a denominator of 100). #[prost(message, optional, tag = "2")] pub percent_sampled: ::core::option::Option< super::super::super::r#type::v3::FractionalPercent, >, - /// By default, sampling pivots on the header - /// :ref:`x-request-id` being - /// present. If :ref:`x-request-id` - /// is present, the filter will consistently sample across multiple hosts based - /// on the runtime key value and the value extracted from - /// :ref:`x-request-id`. If it is - /// missing, or ``use_independent_randomness`` is set to true, the filter will - /// randomly sample based on the runtime key value alone. - /// ``use_independent_randomness`` can be used for logging kill switches within - /// complex nested :ref:`AndFilter - /// ` and :ref:`OrFilter - /// ` blocks that are easier to - /// reason about from a probability perspective (i.e., setting to true will - /// cause the filter to behave like an independent random variable when - /// composed within logical operator filters). + /// Controls how sampling decisions are made. + /// + /// - Default behavior (``false``): + /// + /// * Uses the :ref:`x-request-id` as a consistent sampling pivot. + /// * When :ref:`x-request-id` is present, sampling will be consistent + /// across multiple hosts based on both the ``runtime_key`` and + /// :ref:`x-request-id`. + /// * Useful for tracking related requests across a distributed system. + /// + /// - When set to ``true`` or :ref:`x-request-id` is missing: + /// + /// * Sampling decisions are made randomly based only on the ``runtime_key``. + /// * Useful in complex filter configurations (like nested + /// :ref:`AndFilter`/ + /// :ref:`OrFilter` blocks) where independent probability + /// calculations are desired. + /// * Can be used to implement logging kill switches with predictable probability distributions. + /// #[prost(bool, tag = "3")] pub use_independent_randomness: bool, } diff --git a/src/generated/envoy.config.bootstrap.v3.rs b/src/generated/envoy.config.bootstrap.v3.rs index 2a67118..a85a6f6 100644 --- a/src/generated/envoy.config.bootstrap.v3.rs +++ b/src/generated/envoy.config.bootstrap.v3.rs @@ -299,9 +299,7 @@ pub mod bootstrap { /// If a network based configuration source is specified for :ref:`cds_config /// `, it's necessary /// to have some initial cluster definitions available to allow Envoy to know - /// how to speak to the management server. These cluster definitions may not - /// use :ref:`EDS ` (i.e. they should be static - /// IP or DNS-based). + /// how to speak to the management server. #[prost(message, repeated, tag = "2")] pub clusters: ::prost::alloc::vec::Vec< super::super::super::cluster::v3::Cluster, diff --git a/src/generated/envoy.config.cluster.v3.rs b/src/generated/envoy.config.cluster.v3.rs index 065441c..20a2bd6 100644 --- a/src/generated/envoy.config.cluster.v3.rs +++ b/src/generated/envoy.config.cluster.v3.rs @@ -184,7 +184,7 @@ impl ::prost::Name for Filter { } /// See the :ref:`architecture overview ` for /// more information on outlier detection. -/// \[#next-free-field: 25\] +/// \[#next-free-field: 26\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutlierDetection { /// The number of consecutive server-side error responses (for HTTP traffic, @@ -209,8 +209,8 @@ pub struct OutlierDetection { pub base_ejection_time: ::core::option::Option< super::super::super::super::google::protobuf::Duration, >, - /// The maximum % of an upstream cluster that can be ejected due to outlier - /// detection. Defaults to 10% but will eject at least one host regardless of the value. + /// The maximum % of an upstream cluster that can be ejected due to outlier detection. Defaults to 10% . + /// Will eject at least one host regardless of the value if :ref:`always_eject_one_host` is enabled. #[prost(message, optional, tag = "4")] pub max_ejection_percent: ::core::option::Option< super::super::super::super::google::protobuf::UInt32Value, @@ -373,6 +373,12 @@ pub struct OutlierDetection { /// \[#not-implemented-hide:\] #[prost(message, repeated, tag = "24")] pub monitors: ::prost::alloc::vec::Vec, + /// If enabled, at least one host is ejected regardless of the value of :ref:`max_ejection_percent`. + /// Defaults to false. + #[prost(message, optional, tag = "25")] + pub always_eject_one_host: ::core::option::Option< + super::super::super::super::google::protobuf::BoolValue, + >, } impl ::prost::Name for OutlierDetection { const NAME: &'static str = "OutlierDetection"; @@ -404,15 +410,17 @@ impl ::prost::Name for ClusterCollection { } } /// Configuration for a single upstream cluster. -/// \[#next-free-field: 57\] +/// \[#next-free-field: 59\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Cluster { - /// Configuration to use different transport sockets for different endpoints. - /// The entry of ``envoy.transport_socket_match`` in the - /// :ref:`LbEndpoint.Metadata ` - /// is used to match against the transport sockets as they appear in the list. The first - /// :ref:`match ` is used. - /// For example, with the following match + /// Configuration to use different transport sockets for different endpoints. The entry of + /// ``envoy.transport_socket_match`` in the :ref:`LbEndpoint.Metadata + /// ` is used to match against the + /// transport sockets as they appear in the list. If a match is not found, the search continues in + /// :ref:`LocalityLbEndpoints.Metadata + /// `. The first :ref:`match + /// ` is used. For example, with + /// the following match /// /// .. code-block:: yaml /// @@ -436,8 +444,9 @@ pub struct Cluster { /// socket match in case above. /// /// If an endpoint metadata's value under ``envoy.transport_socket_match`` does not match any - /// ``TransportSocketMatch``, socket configuration fallbacks to use the ``tls_context`` or - /// ``transport_socket`` specified in this cluster. + /// ``TransportSocketMatch``, the locality metadata is then checked for a match. Barring any + /// matches in the endpoint or locality metadata, the socket configuration fallbacks to use the + /// ``tls_context`` or ``transport_socket`` specified in this cluster. /// /// This field allows gradual and flexible transport socket configuration changes. /// @@ -468,12 +477,14 @@ pub struct Cluster { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// An optional alternative to the cluster name to be used for observability. This name is used - /// emitting stats for the cluster and access logging the cluster name. This will appear as + /// for emitting stats for the cluster and access logging the cluster name. This will appear as /// additional information in configuration dumps of a cluster's current status as /// :ref:`observability_name ` - /// and as an additional tag "upstream_cluster.name" while tracing. Note: Any ``:`` in the name - /// will be converted to ``_`` when emitting statistics. This should not be confused with - /// :ref:`Router Filter Header `. + /// and as an additional tag "upstream_cluster.name" while tracing. + /// + /// .. note:: + /// Any ``:`` in the name will be converted to ``_`` when emitting statistics. This should not be confused with + /// :ref:`Router Filter Header `. #[prost(string, tag = "28")] pub alt_stat_name: ::prost::alloc::string::String, /// Configuration to use for EDS updates for the Cluster. @@ -597,6 +608,7 @@ pub struct Cluster { /// "envoy.filters.network.thrift_proxy". See the extension's documentation for details on /// specific options. /// \[#next-major-version: make this a list of typed extensions.\] + /// \[#extension-category: envoy.upstream_options\] #[prost(map = "string, message", tag = "36")] pub typed_extension_protocol_options: ::std::collections::HashMap< ::prost::alloc::string::String, @@ -611,10 +623,33 @@ pub struct Cluster { /// :ref:`STRICT_DNS` /// and :ref:`LOGICAL_DNS` /// this setting is ignored. + /// This field is deprecated in favor of using the :ref:`cluster_type` + /// extension point and configuring it with :ref:`DnsCluster`. + /// If :ref:`cluster_type` is configured with + /// :ref:`DnsCluster`, this field will be ignored. + #[deprecated] #[prost(message, optional, tag = "16")] pub dns_refresh_rate: ::core::option::Option< super::super::super::super::google::protobuf::Duration, >, + /// DNS jitter can be optionally specified if the cluster type is either + /// :ref:`STRICT_DNS`, + /// or :ref:`LOGICAL_DNS`. + /// DNS jitter causes the cluster to refresh DNS entries later by a random amount of time to avoid a + /// stampede of DNS requests. This value sets the upper bound (exclusive) for the random amount. + /// There will be no jitter if this value is omitted. For cluster types other than + /// :ref:`STRICT_DNS` + /// and :ref:`LOGICAL_DNS` + /// this setting is ignored. + /// This field is deprecated in favor of using the :ref:`cluster_type` + /// extension point and configuring it with :ref:`DnsCluster`. + /// If :ref:`cluster_type` is configured with + /// :ref:`DnsCluster`, this field will be ignored. + #[deprecated] + #[prost(message, optional, tag = "58")] + pub dns_jitter: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, /// If the DNS failure refresh rate is specified and the cluster type is either /// :ref:`STRICT_DNS`, /// or :ref:`LOGICAL_DNS`, @@ -623,16 +658,31 @@ pub struct Cluster { /// other than :ref:`STRICT_DNS` and /// :ref:`LOGICAL_DNS` this setting is /// ignored. + /// This field is deprecated in favor of using the :ref:`cluster_type` + /// extension point and configuring it with :ref:`DnsCluster`. + /// If :ref:`cluster_type` is configured with + /// :ref:`DnsCluster`, this field will be ignored. + #[deprecated] #[prost(message, optional, tag = "44")] pub dns_failure_refresh_rate: ::core::option::Option, /// Optional configuration for setting cluster's DNS refresh rate. If the value is set to true, /// cluster's DNS refresh rate will be set to resource record's TTL which comes from DNS /// resolution. + /// This field is deprecated in favor of using the :ref:`cluster_type` + /// extension point and configuring it with :ref:`DnsCluster`. + /// If :ref:`cluster_type` is configured with + /// :ref:`DnsCluster`, this field will be ignored. + #[deprecated] #[prost(bool, tag = "39")] pub respect_dns_ttl: bool, /// The DNS IP address resolution policy. If this setting is not specified, the /// value defaults to /// :ref:`AUTO`. + /// For logical and strict dns cluster, this field is deprecated in favor of using the + /// :ref:`cluster_type` + /// extension point and configuring it with :ref:`DnsCluster`. + /// If :ref:`cluster_type` is configured with + /// :ref:`DnsCluster`, this field will be ignored. #[prost(enumeration = "cluster::DnsLookupFamily", tag = "17")] pub dns_lookup_family: i32, /// If DNS resolvers are specified and the cluster type is either @@ -674,6 +724,9 @@ pub struct Cluster { /// During the transition period when both ``dns_resolution_config`` and ``typed_dns_resolver_config`` exists, /// when ``typed_dns_resolver_config`` is in place, Envoy will use it and ignore ``dns_resolution_config``. /// When ``typed_dns_resolver_config`` is missing, the default behavior is in place. + /// Also note that this field is deprecated for logical dns and strict dns clusters and will be ignored when + /// :ref:`cluster_type` is configured with + /// :ref:`DnsCluster`. /// \[#extension-category: envoy.network.dns_resolver\] #[prost(message, optional, tag = "55")] pub typed_dns_resolver_config: ::core::option::Option< @@ -795,6 +848,25 @@ pub struct Cluster { /// from the LRS stream here.] #[prost(message, optional, tag = "42")] pub lrs_server: ::core::option::Option, + /// A list of metric names from :ref:`ORCA load reports ` to propagate to LRS. + /// + /// If not specified, then ORCA load reports will not be propagated to LRS. + /// + /// For map fields in the ORCA proto, the string will be of the form ``.``. + /// For example, the string ``named_metrics.foo`` will mean to look for the key ``foo`` in the ORCA + /// :ref:`named_metrics ` field. + /// + /// The special map key ``*`` means to report all entries in the map (e.g., ``named_metrics.*`` means to + /// report all entries in the ORCA named_metrics field). Note that this should be used only with trusted + /// backends. + /// + /// The metric names in LRS will follow the same semantics as this field. In other words, if this field + /// contains ``named_metrics.foo``, then the LRS load report will include the data with that same string + /// as the key. + #[prost(string, repeated, tag = "57")] + pub lrs_report_endpoint_metrics: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, /// If track_timeout_budgets is true, the :ref:`timeout budget histograms /// ` will be published for each /// request. These show what percentage of a request's per try and global timeout was used. A value @@ -862,7 +934,7 @@ pub mod cluster { /// The name of the match, used in stats generation. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, - /// Optional endpoint metadata match criteria. + /// Optional metadata match criteria. /// The connection to the endpoint with metadata matching what is set in this field /// will use the transport socket configuration specified here. /// The endpoint's metadata entry in ``envoy.transport_socket_match`` is used to match @@ -1553,9 +1625,10 @@ pub mod cluster { /// If this is not set, we default to a merge window of 1000ms. To disable it, set the merge /// window to 0. /// - /// Note: merging does not apply to cluster membership changes (e.g.: adds/removes); this is - /// because merging those updates isn't currently safe. See - /// + /// .. note:: + /// Merging does not apply to cluster membership changes (e.g.: adds/removes); this is + /// because merging those updates isn't currently safe. See + /// #[prost(message, optional, tag = "4")] pub update_merge_window: ::core::option::Option< super::super::super::super::super::google::protobuf::Duration, @@ -2256,7 +2329,7 @@ pub struct TrackClusterStats { pub timeout_budgets: bool, /// If request_response_sizes is true, then the :ref:`histograms /// ` tracking header and body sizes - /// of requests and responses will be published. + /// of requests and responses will be published. Additionally, number of headers in the requests and responses will be tracked. #[prost(bool, tag = "2")] pub request_response_sizes: bool, /// If true, some stats will be emitted per-endpoint, similar to the stats in admin ``/clusters`` diff --git a/src/generated/envoy.config.cluster.v3.serde.rs b/src/generated/envoy.config.cluster.v3.serde.rs index 595aa2d..0a3c599 100644 --- a/src/generated/envoy.config.cluster.v3.serde.rs +++ b/src/generated/envoy.config.cluster.v3.serde.rs @@ -495,6 +495,9 @@ impl serde::Serialize for Cluster { if self.dns_refresh_rate.is_some() { len += 1; } + if self.dns_jitter.is_some() { + len += 1; + } if self.dns_failure_refresh_rate.is_some() { len += 1; } @@ -561,6 +564,9 @@ impl serde::Serialize for Cluster { if self.lrs_server.is_some() { len += 1; } + if !self.lrs_report_endpoint_metrics.is_empty() { + len += 1; + } if self.track_timeout_budgets { len += 1; } @@ -636,6 +642,9 @@ impl serde::Serialize for Cluster { if let Some(v) = self.dns_refresh_rate.as_ref() { struct_ser.serialize_field("dns_refresh_rate", v)?; } + if let Some(v) = self.dns_jitter.as_ref() { + struct_ser.serialize_field("dns_jitter", v)?; + } if let Some(v) = self.dns_failure_refresh_rate.as_ref() { struct_ser.serialize_field("dns_failure_refresh_rate", v)?; } @@ -706,6 +715,9 @@ impl serde::Serialize for Cluster { if let Some(v) = self.lrs_server.as_ref() { struct_ser.serialize_field("lrs_server", v)?; } + if !self.lrs_report_endpoint_metrics.is_empty() { + struct_ser.serialize_field("lrs_report_endpoint_metrics", &self.lrs_report_endpoint_metrics)?; + } if self.track_timeout_budgets { struct_ser.serialize_field("track_timeout_budgets", &self.track_timeout_budgets)?; } @@ -795,6 +807,8 @@ impl<'de> serde::Deserialize<'de> for Cluster { "typedExtensionProtocolOptions", "dns_refresh_rate", "dnsRefreshRate", + "dns_jitter", + "dnsJitter", "dns_failure_refresh_rate", "dnsFailureRefreshRate", "respect_dns_ttl", @@ -837,6 +851,8 @@ impl<'de> serde::Deserialize<'de> for Cluster { "loadBalancingPolicy", "lrs_server", "lrsServer", + "lrs_report_endpoint_metrics", + "lrsReportEndpointMetrics", "track_timeout_budgets", "trackTimeoutBudgets", "upstream_config", @@ -881,6 +897,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { Http2ProtocolOptions, TypedExtensionProtocolOptions, DnsRefreshRate, + DnsJitter, DnsFailureRefreshRate, RespectDnsTtl, DnsLookupFamily, @@ -903,6 +920,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { Filters, LoadBalancingPolicy, LrsServer, + LrsReportEndpointMetrics, TrackTimeoutBudgets, UpstreamConfig, TrackClusterStats, @@ -953,6 +971,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { "http2ProtocolOptions" | "http2_protocol_options" => Ok(GeneratedField::Http2ProtocolOptions), "typedExtensionProtocolOptions" | "typed_extension_protocol_options" => Ok(GeneratedField::TypedExtensionProtocolOptions), "dnsRefreshRate" | "dns_refresh_rate" => Ok(GeneratedField::DnsRefreshRate), + "dnsJitter" | "dns_jitter" => Ok(GeneratedField::DnsJitter), "dnsFailureRefreshRate" | "dns_failure_refresh_rate" => Ok(GeneratedField::DnsFailureRefreshRate), "respectDnsTtl" | "respect_dns_ttl" => Ok(GeneratedField::RespectDnsTtl), "dnsLookupFamily" | "dns_lookup_family" => Ok(GeneratedField::DnsLookupFamily), @@ -975,6 +994,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { "filters" => Ok(GeneratedField::Filters), "loadBalancingPolicy" | "load_balancing_policy" => Ok(GeneratedField::LoadBalancingPolicy), "lrsServer" | "lrs_server" => Ok(GeneratedField::LrsServer), + "lrsReportEndpointMetrics" | "lrs_report_endpoint_metrics" => Ok(GeneratedField::LrsReportEndpointMetrics), "trackTimeoutBudgets" | "track_timeout_budgets" => Ok(GeneratedField::TrackTimeoutBudgets), "upstreamConfig" | "upstream_config" => Ok(GeneratedField::UpstreamConfig), "trackClusterStats" | "track_cluster_stats" => Ok(GeneratedField::TrackClusterStats), @@ -1023,6 +1043,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { let mut http2_protocol_options__ = None; let mut typed_extension_protocol_options__ = None; let mut dns_refresh_rate__ = None; + let mut dns_jitter__ = None; let mut dns_failure_refresh_rate__ = None; let mut respect_dns_ttl__ = None; let mut dns_lookup_family__ = None; @@ -1045,6 +1066,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { let mut filters__ = None; let mut load_balancing_policy__ = None; let mut lrs_server__ = None; + let mut lrs_report_endpoint_metrics__ = None; let mut track_timeout_budgets__ = None; let mut upstream_config__ = None; let mut track_cluster_stats__ = None; @@ -1158,6 +1180,12 @@ impl<'de> serde::Deserialize<'de> for Cluster { } dns_refresh_rate__ = map_.next_value()?; } + GeneratedField::DnsJitter => { + if dns_jitter__.is_some() { + return Err(serde::de::Error::duplicate_field("dnsJitter")); + } + dns_jitter__ = map_.next_value()?; + } GeneratedField::DnsFailureRefreshRate => { if dns_failure_refresh_rate__.is_some() { return Err(serde::de::Error::duplicate_field("dnsFailureRefreshRate")); @@ -1290,6 +1318,12 @@ impl<'de> serde::Deserialize<'de> for Cluster { } lrs_server__ = map_.next_value()?; } + GeneratedField::LrsReportEndpointMetrics => { + if lrs_report_endpoint_metrics__.is_some() { + return Err(serde::de::Error::duplicate_field("lrsReportEndpointMetrics")); + } + lrs_report_endpoint_metrics__ = Some(map_.next_value()?); + } GeneratedField::TrackTimeoutBudgets => { if track_timeout_budgets__.is_some() { return Err(serde::de::Error::duplicate_field("trackTimeoutBudgets")); @@ -1388,6 +1422,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { http2_protocol_options: http2_protocol_options__, typed_extension_protocol_options: typed_extension_protocol_options__.unwrap_or_default(), dns_refresh_rate: dns_refresh_rate__, + dns_jitter: dns_jitter__, dns_failure_refresh_rate: dns_failure_refresh_rate__, respect_dns_ttl: respect_dns_ttl__.unwrap_or_default(), dns_lookup_family: dns_lookup_family__.unwrap_or_default(), @@ -1410,6 +1445,7 @@ impl<'de> serde::Deserialize<'de> for Cluster { filters: filters__.unwrap_or_default(), load_balancing_policy: load_balancing_policy__, lrs_server: lrs_server__, + lrs_report_endpoint_metrics: lrs_report_endpoint_metrics__.unwrap_or_default(), track_timeout_budgets: track_timeout_budgets__.unwrap_or_default(), upstream_config: upstream_config__, track_cluster_stats: track_cluster_stats__, @@ -4694,6 +4730,9 @@ impl serde::Serialize for OutlierDetection { if !self.monitors.is_empty() { len += 1; } + if self.always_eject_one_host.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.cluster.v3.OutlierDetection", len)?; if let Some(v) = self.consecutive_5xx.as_ref() { struct_ser.serialize_field("consecutive_5xx", v)?; @@ -4767,6 +4806,9 @@ impl serde::Serialize for OutlierDetection { if !self.monitors.is_empty() { struct_ser.serialize_field("monitors", &self.monitors)?; } + if let Some(v) = self.always_eject_one_host.as_ref() { + struct_ser.serialize_field("always_eject_one_host", v)?; + } struct_ser.end() } } @@ -4823,6 +4865,8 @@ impl<'de> serde::Deserialize<'de> for OutlierDetection { "successful_active_health_check_uneject_host", "successfulActiveHealthCheckUnejectHost", "monitors", + "always_eject_one_host", + "alwaysEjectOneHost", ]; #[allow(clippy::enum_variant_names)] @@ -4851,6 +4895,7 @@ impl<'de> serde::Deserialize<'de> for OutlierDetection { MaxEjectionTimeJitter, SuccessfulActiveHealthCheckUnejectHost, Monitors, + AlwaysEjectOneHost, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -4896,6 +4941,7 @@ impl<'de> serde::Deserialize<'de> for OutlierDetection { "maxEjectionTimeJitter" | "max_ejection_time_jitter" => Ok(GeneratedField::MaxEjectionTimeJitter), "successfulActiveHealthCheckUnejectHost" | "successful_active_health_check_uneject_host" => Ok(GeneratedField::SuccessfulActiveHealthCheckUnejectHost), "monitors" => Ok(GeneratedField::Monitors), + "alwaysEjectOneHost" | "always_eject_one_host" => Ok(GeneratedField::AlwaysEjectOneHost), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4939,6 +4985,7 @@ impl<'de> serde::Deserialize<'de> for OutlierDetection { let mut max_ejection_time_jitter__ = None; let mut successful_active_health_check_uneject_host__ = None; let mut monitors__ = None; + let mut always_eject_one_host__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Consecutive5xx => { @@ -5085,6 +5132,12 @@ impl<'de> serde::Deserialize<'de> for OutlierDetection { } monitors__ = Some(map_.next_value()?); } + GeneratedField::AlwaysEjectOneHost => { + if always_eject_one_host__.is_some() { + return Err(serde::de::Error::duplicate_field("alwaysEjectOneHost")); + } + always_eject_one_host__ = map_.next_value()?; + } } } Ok(OutlierDetection { @@ -5112,6 +5165,7 @@ impl<'de> serde::Deserialize<'de> for OutlierDetection { max_ejection_time_jitter: max_ejection_time_jitter__, successful_active_health_check_uneject_host: successful_active_health_check_uneject_host__, monitors: monitors__.unwrap_or_default(), + always_eject_one_host: always_eject_one_host__, }) } } diff --git a/src/generated/envoy.config.common.matcher.v3.rs b/src/generated/envoy.config.common.matcher.v3.rs index 4b0b3b6..47570ab 100644 --- a/src/generated/envoy.config.common.matcher.v3.rs +++ b/src/generated/envoy.config.common.matcher.v3.rs @@ -9,8 +9,8 @@ /// Please use the syntactically equivalent :ref:`matching API ` #[derive(Clone, PartialEq, ::prost::Message)] pub struct Matcher { - /// Optional OnMatch to use if the matcher failed. - /// If specified, the OnMatch is used, and the matcher is considered + /// Optional ``OnMatch`` to use if the matcher failed. + /// If specified, the ``OnMatch`` is used, and the matcher is considered /// to have matched. /// If not specified, the matcher is considered not to have matched. #[prost(message, optional, boxed, tag = "3")] @@ -25,6 +25,17 @@ pub mod matcher { /// What to do if a match is successful. #[derive(Clone, PartialEq, ::prost::Message)] pub struct OnMatch { + /// If true, the action will be taken but the caller will behave as if no + /// match was found. This applies both to actions directly encoded in the + /// action field and to actions returned from a nested matcher tree in the + /// matcher field. A subsequent matcher on_no_match action will be used + /// instead. + /// + /// This field is not supported in all contexts in which the matcher API is + /// used. If this field is set in a context in which it's not supported, + /// the resource will be rejected. + #[prost(bool, tag = "3")] + pub keep_matching: bool, #[prost(oneof = "on_match::OnMatch", tags = "1, 2")] pub on_match: ::core::option::Option, } @@ -143,7 +154,7 @@ pub mod matcher { /// A list of predicates to be AND-ed together. #[prost(message, tag = "3")] AndMatcher(PredicateList), - /// The invert of a predicate + /// The inverse of a predicate #[prost(message, tag = "4")] NotMatcher(::prost::alloc::boxed::Box), } @@ -373,9 +384,9 @@ impl ::prost::Name for HttpHeadersMatch { /// /// .. attention:: /// -/// 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. +/// 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. /// If multiple patterns are specified, the process is repeated for each pattern. If location of a pattern is known, ``bytes_limit`` should be specified -/// to scan only part of the http body. +/// to scan only part of the HTTP body. #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpGenericBodyMatch { /// Limits search to specified number of bytes - default zero (no limit - match entire captured buffer). diff --git a/src/generated/envoy.config.common.matcher.v3.serde.rs b/src/generated/envoy.config.common.matcher.v3.serde.rs index 50e90d2..a9e07ed 100644 --- a/src/generated/envoy.config.common.matcher.v3.serde.rs +++ b/src/generated/envoy.config.common.matcher.v3.serde.rs @@ -1554,10 +1554,16 @@ impl serde::Serialize for matcher::OnMatch { { use serde::ser::SerializeStruct; let mut len = 0; + if self.keep_matching { + len += 1; + } if self.on_match.is_some() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.config.common.matcher.v3.Matcher.OnMatch", len)?; + if self.keep_matching { + struct_ser.serialize_field("keep_matching", &self.keep_matching)?; + } if let Some(v) = self.on_match.as_ref() { match v { matcher::on_match::OnMatch::Matcher(v) => { @@ -1578,12 +1584,15 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "keep_matching", + "keepMatching", "matcher", "action", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + KeepMatching, Matcher, Action, } @@ -1607,6 +1616,7 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { E: serde::de::Error, { match value { + "keepMatching" | "keep_matching" => Ok(GeneratedField::KeepMatching), "matcher" => Ok(GeneratedField::Matcher), "action" => Ok(GeneratedField::Action), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -1628,9 +1638,16 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { where V: serde::de::MapAccess<'de>, { + let mut keep_matching__ = None; let mut on_match__ = None; while let Some(k) = map_.next_key()? { match k { + GeneratedField::KeepMatching => { + if keep_matching__.is_some() { + return Err(serde::de::Error::duplicate_field("keepMatching")); + } + keep_matching__ = Some(map_.next_value()?); + } GeneratedField::Matcher => { if on_match__.is_some() { return Err(serde::de::Error::duplicate_field("matcher")); @@ -1648,6 +1665,7 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { } } Ok(matcher::OnMatch { + keep_matching: keep_matching__.unwrap_or_default(), on_match: on_match__, }) } diff --git a/src/generated/envoy.config.core.v3.rs b/src/generated/envoy.config.core.v3.rs index a58e3cb..1cbdf30 100644 --- a/src/generated/envoy.config.core.v3.rs +++ b/src/generated/envoy.config.core.v3.rs @@ -50,7 +50,7 @@ impl ::prost::Name for TypedExtensionConfig { /// :ref:`admin's ` socket_options etc. /// /// It should be noted that the name or level may have different values on different platforms. -/// \[#next-free-field: 7\] +/// \[#next-free-field: 8\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SocketOption { /// An optional name to give this socket option for debugging, etc. @@ -67,11 +67,72 @@ pub struct SocketOption { /// STATE_PREBIND is currently the only valid value. #[prost(enumeration = "socket_option::SocketState", tag = "6")] pub state: i32, + /// Apply the socket option to the specified `socket type <`_.> + /// If not specified, the socket option will be applied to all socket types. + #[prost(message, optional, tag = "7")] + pub r#type: ::core::option::Option, #[prost(oneof = "socket_option::Value", tags = "4, 5")] pub value: ::core::option::Option, } /// Nested message and enum types in `SocketOption`. pub mod socket_option { + /// The `socket type <`_> to apply the socket option to. + /// Only one field should be set. If multiple fields are set, the precedence order will determine + /// the selected one. If none of the fields is set, the socket option will be applied to all socket types. + /// + /// For example: + /// If :ref:`stream ` is set, + /// it takes precedence over :ref:`datagram `. + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct SocketType { + /// Apply the socket option to the stream socket type. + #[prost(message, optional, tag = "1")] + pub stream: ::core::option::Option, + /// Apply the socket option to the datagram socket type. + #[prost(message, optional, tag = "2")] + pub datagram: ::core::option::Option, + } + /// Nested message and enum types in `SocketType`. + pub mod socket_type { + /// The stream socket type. + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct Stream {} + impl ::prost::Name for Stream { + const NAME: &'static str = "Stream"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.SocketOption.SocketType.Stream".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.SocketOption.SocketType.Stream" + .into() + } + } + /// The datagram socket type. + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct Datagram {} + impl ::prost::Name for Datagram { + const NAME: &'static str = "Datagram"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.SocketOption.SocketType.Datagram".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.SocketOption.SocketType.Datagram" + .into() + } + } + } + impl ::prost::Name for SocketType { + const NAME: &'static str = "SocketType"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.SocketOption.SocketType".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.SocketOption.SocketType".into() + } + } #[derive( Clone, Copy, @@ -205,7 +266,7 @@ impl ::prost::Name for EnvoyInternalAddress { "type.googleapis.com/envoy.config.core.v3.EnvoyInternalAddress".into() } } -/// \[#next-free-field: 7\] +/// \[#next-free-field: 8\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SocketAddress { #[prost(enumeration = "socket_address::Protocol", tag = "1")] @@ -236,6 +297,20 @@ pub struct SocketAddress { /// IPv6 space as ``::FFFF:``. #[prost(bool, tag = "6")] pub ipv4_compat: bool, + /// Filepath that specifies the Linux network namespace this socket will be created in (see ``man 7 + /// network_namespaces``). If this field is set, Envoy will create the socket in the specified + /// network namespace. + /// + /// .. note:: + /// Setting this parameter requires Envoy to run with the ``CAP_NET_ADMIN`` capability. + /// + /// .. note:: + /// Currently only used for Listener sockets. + /// + /// .. attention:: + /// Network namespaces are only configurable on Linux. Otherwise, this field has no effect. + #[prost(string, tag = "7")] + pub network_namespace_filepath: ::prost::alloc::string::String, #[prost(oneof = "socket_address::PortSpecifier", tags = "3, 4")] pub port_specifier: ::core::option::Option, } @@ -882,12 +957,21 @@ impl ::prost::Name for RuntimeFeatureFlag { "type.googleapis.com/envoy.config.core.v3.RuntimeFeatureFlag".into() } } +/// Please use :ref:`KeyValuePair ` instead. +/// \[#not-implemented-hide:\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyValue { /// The key of the key/value pair. + #[deprecated] #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, /// The value of the key/value pair. + /// + /// The ``bytes`` type is used. This means if JSON or YAML is used to to represent the + /// configuration, the value must be base64 encoded. This is unfriendly for users in most + /// use scenarios of this message. + /// + #[deprecated] #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } @@ -901,11 +985,39 @@ impl ::prost::Name for KeyValue { "type.googleapis.com/envoy.config.core.v3.KeyValue".into() } } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct KeyValuePair { + /// The key of the key/value pair. + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + /// The value of the key/value pair. + #[prost(message, optional, tag = "2")] + pub value: ::core::option::Option< + super::super::super::super::google::protobuf::Value, + >, +} +impl ::prost::Name for KeyValuePair { + const NAME: &'static str = "KeyValuePair"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.KeyValuePair".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.KeyValuePair".into() + } +} /// Key/value pair plus option to control append behavior. This is used to specify /// key/value pairs that should be appended to a set of existing key/value pairs. #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyValueAppend { - /// Key/value pair entry that this option to append or overwrite. + /// The single key/value pair record to be appended or overridden. This field must be set. + #[prost(message, optional, tag = "3")] + pub record: ::core::option::Option, + /// Key/value pair entry that this option to append or overwrite. This field is deprecated + /// and please use :ref:`record ` + /// as replacement. + /// \[#not-implemented-hide:\] + #[deprecated] #[prost(message, optional, tag = "1")] pub entry: ::core::option::Option, /// Describes the action taken to append/overwrite the given value for an existing @@ -986,10 +1098,12 @@ impl ::prost::Name for KeyValueAppend { /// Key/value pair to append or remove. #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyValueMutation { - /// Key/value pair to append or overwrite. Only one of ``append`` or ``remove`` can be set. + /// Key/value pair to append or overwrite. Only one of ``append`` or ``remove`` can be set or + /// the configuration will be rejected. #[prost(message, optional, tag = "1")] pub append: ::core::option::Option, - /// Key to remove. Only one of ``append`` or ``remove`` can be set. + /// Key to remove. Only one of ``append`` or ``remove`` can be set or the configuration will be + /// rejected. #[prost(string, tag = "2")] pub remove: ::prost::alloc::string::String, } @@ -1156,6 +1270,7 @@ impl ::prost::Name for HeaderValueOption { /// Wrapper for a set of headers. #[derive(Clone, PartialEq, ::prost::Message)] pub struct HeaderMap { + /// A list of header names and their values. #[prost(message, repeated, tag = "1")] pub headers: ::prost::alloc::vec::Vec, } @@ -1651,6 +1766,26 @@ impl ::prost::Name for ProxyProtocolPassThroughTlVs { "type.googleapis.com/envoy.config.core.v3.ProxyProtocolPassThroughTLVs".into() } } +/// Represents a single Type-Length-Value (TLV) entry. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TlvEntry { + /// The type of the TLV. Must be a uint8 (0-255) as per the Proxy Protocol v2 specification. + #[prost(uint32, tag = "1")] + pub r#type: u32, + /// The value of the TLV. Must be at least one byte long. + #[prost(bytes = "vec", tag = "2")] + pub value: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for TlvEntry { + const NAME: &'static str = "TlvEntry"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.TlvEntry".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.TlvEntry".into() + } +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProxyProtocolConfig { /// The PROXY protocol version to use. See for details @@ -1660,6 +1795,32 @@ pub struct ProxyProtocolConfig { /// V2 header. If there is no setting for this field, no TLVs will be passed through. #[prost(message, optional, tag = "2")] pub pass_through_tlvs: ::core::option::Option, + /// This config allows additional TLVs to be included in the upstream PROXY protocol + /// V2 header. Unlike ``pass_through_tlvs``, which passes TLVs from the downstream request, + /// ``added_tlvs`` provides an extension mechanism for defining new TLVs that are included + /// with the upstream request. These TLVs may not be present in the downstream request and + /// can be defined at either the transport socket level or the host level to provide more + /// granular control over the TLVs that are included in the upstream request. + /// + /// Host-level TLVs are specified in the ``metadata.typed_filter_metadata`` field under the + /// ``envoy.transport_sockets.proxy_protocol`` namespace. + /// + /// .. literalinclude:: /_configs/repo/proxy_protocol.yaml + /// :language: yaml + /// :lines: 49-57 + /// :linenos: + /// :lineno-start: 49 + /// :caption: :download:`proxy_protocol.yaml ` + /// + /// **Precedence behavior**: + /// + /// - When a TLV is defined at both the host level and the transport socket level, the value + /// from the host level configuration takes precedence. This allows users to define default TLVs + /// at the transport socket level and override them at the host level. + /// - Any TLV defined in the ``pass_through_tlvs`` field will be overridden by either the host-level + /// or transport socket-level TLV. + #[prost(message, repeated, tag = "3")] + pub added_tlvs: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `ProxyProtocolConfig`. pub mod proxy_protocol_config { @@ -1712,6 +1873,22 @@ impl ::prost::Name for ProxyProtocolConfig { "type.googleapis.com/envoy.config.core.v3.ProxyProtocolConfig".into() } } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PerHostConfig { + /// Enables per-host configuration for Proxy Protocol. + #[prost(message, repeated, tag = "1")] + pub added_tlvs: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for PerHostConfig { + const NAME: &'static str = "PerHostConfig"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.PerHostConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.PerHostConfig".into() + } +} /// gRPC service configuration. This is used by :ref:`ApiConfigSource /// ` and filter configurations. /// \[#next-free-field: 7\] @@ -1739,6 +1916,7 @@ pub struct GrpcService { } /// Nested message and enum types in `GrpcService`. pub mod grpc_service { + /// \[#next-free-field: 6\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EnvoyGrpc { /// The name of the upstream gRPC cluster. SSL credentials will be supplied @@ -1764,6 +1942,12 @@ pub mod grpc_service { pub max_receive_message_length: ::core::option::Option< super::super::super::super::super::google::protobuf::UInt32Value, >, + /// This provides gRPC client level control over envoy generated headers. + /// If false, the header will be sent but it can be overridden by per stream option. + /// If true, the header will be removed and can not be overridden by per stream option. + /// Default to false. + #[prost(bool, tag = "5")] + pub skip_envoy_headers: bool, } impl ::prost::Name for EnvoyGrpc { const NAME: &'static str = "EnvoyGrpc"; @@ -2743,13 +2927,13 @@ pub struct HealthCheck { pub healthy_edge_interval: ::core::option::Option< super::super::super::super::google::protobuf::Duration, >, - /// .. attention:: - /// This field is deprecated in favor of the extension - /// :ref:`event_logger ` and - /// :ref:`event_log_path ` - /// in the file sink extension. - /// /// Specifies the path to the :ref:`health check event log `. + /// + /// .. attention:: + /// This field is deprecated in favor of the extension + /// :ref:`event_logger ` and + /// :ref:`event_log_path ` + /// in the file sink extension. #[deprecated] #[prost(string, tag = "17")] pub event_log_path: ::prost::alloc::string::String, @@ -3189,7 +3373,7 @@ pub struct QuicKeepAliveSettings { /// /// The value should be smaller than :ref:`connection idle_timeout ` to prevent idle timeout and smaller than max_interval to take effect. /// - /// If absent or zero, disable keepalive probing for a server connection. For a client connection, if :ref:`max_interval ` is also zero, do not keepalive, otherwise use max_interval or QUICHE default to probe all the time. + /// If absent, disable keepalive probing for a server connection. For a client connection, if :ref:`max_interval ` is zero, do not keepalive, otherwise use max_interval or QUICHE default to probe all the time. #[prost(message, optional, tag = "2")] pub initial_interval: ::core::option::Option< super::super::super::super::google::protobuf::Duration, @@ -3206,7 +3390,7 @@ impl ::prost::Name for QuicKeepAliveSettings { } } /// QUIC protocol options which apply to both downstream and upstream connections. -/// \[#next-free-field: 9\] +/// \[#next-free-field: 10\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuicProtocolOptions { /// Maximum number of streams that the client can negotiate per connection. 100 @@ -3219,8 +3403,11 @@ pub struct QuicProtocolOptions { /// <`_> size. Valid values range from /// 1 to 16777216 (2^24, maximum supported by QUICHE) and defaults to 16777216 (16 * 1024 * 1024). /// - /// NOTE: 16384 (2^14) is the minimum window size supported in Google QUIC. If configured smaller than it, we will use 16384 instead. - /// QUICHE IETF Quic implementation supports 1 bytes window. We only support increasing the default window size now, so it's also the minimum. + /// .. note:: + /// + /// 16384 (2^14) is the minimum window size supported in Google QUIC. If configured smaller than it, we will use + /// 16384 instead. QUICHE IETF Quic implementation supports 1 bytes window. We only support increasing the default + /// window size now, so it's also the minimum. /// /// This field also acts as a soft limit on the number of bytes Envoy will buffer per-stream in the /// QUIC stream send and receive buffers. Once the buffer reaches this pointer, watermark callbacks will fire to @@ -3233,8 +3420,11 @@ pub struct QuicProtocolOptions { /// flow-control. Valid values rage from 1 to 25165824 (24MB, maximum supported by QUICHE) and defaults /// to 25165824 (24 * 1024 * 1024). /// - /// NOTE: 16384 (2^14) is the minimum window size supported in Google QUIC. We only support increasing the default - /// window size now, so it's also the minimum. + /// .. note:: + /// + /// 16384 (2^14) is the minimum window size supported in Google QUIC. We only support increasing the default + /// window size now, so it's also the minimum. + /// #[prost(message, optional, tag = "3")] pub initial_connection_window_size: ::core::option::Option< super::super::super::super::google::protobuf::UInt32Value, @@ -3267,6 +3457,12 @@ pub struct QuicProtocolOptions { pub idle_network_timeout: ::core::option::Option< super::super::super::super::google::protobuf::Duration, >, + /// Maximum packet length for QUIC connections. It refers to the largest size of a QUIC packet that can be transmitted over the connection. + /// If not specified, one of the `default values in QUICHE <`_> is used. + #[prost(message, optional, tag = "9")] + pub max_packet_length: ::core::option::Option< + super::super::super::super::google::protobuf::UInt64Value, + >, } impl ::prost::Name for QuicProtocolOptions { const NAME: &'static str = "QuicProtocolOptions"; @@ -3285,6 +3481,9 @@ pub struct UpstreamHttpProtocolOptions { /// header when :ref:`override_auto_sni_header ` /// is set, as seen by the :ref:`router filter `. /// Does nothing if a filter before the http router filter sets the corresponding metadata. + /// + /// See :ref:`SNI configuration ` for details on how this + /// interacts with other validation options. #[prost(bool, tag = "1")] pub auto_sni: bool, /// Automatic validate upstream presented certificate for new upstream connections based on the @@ -3292,6 +3491,9 @@ pub struct UpstreamHttpProtocolOptions { /// is set, as seen by the :ref:`router filter `. /// This field is intended to be set with ``auto_sni`` field. /// Does nothing if a filter before the http router filter sets the corresponding metadata. + /// + /// See :ref:`validation configuration ` for how this interacts with + /// other validation options. #[prost(bool, tag = "2")] pub auto_san_validation: bool, /// An optional alternative to the host/authority header to be used for setting the SNI value. @@ -3407,7 +3609,7 @@ impl ::prost::Name for AlternateProtocolsCacheOptions { "type.googleapis.com/envoy.config.core.v3.AlternateProtocolsCacheOptions".into() } } -/// \[#next-free-field: 7\] +/// \[#next-free-field: 8\] #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct HttpProtocolOptions { /// The idle timeout for connections. The idle timeout is defined as the @@ -3431,22 +3633,46 @@ pub struct HttpProtocolOptions { super::super::super::super::google::protobuf::Duration, >, /// The maximum duration of a connection. The duration is defined as a period since a connection - /// was established. If not set, there is no max duration. When max_connection_duration is reached - /// and if there are no active streams, the connection will be closed. If the connection is a - /// downstream connection and there are any active streams, the drain sequence will kick-in, - /// and the connection will be force-closed after the drain period. See :ref:`drain_timeout + /// was established. If not set, there is no max duration. When max_connection_duration is reached, + /// the drain sequence will kick-in. The connection will be closed after the drain timeout period + /// if there are no active streams. See :ref:`drain_timeout /// `. #[prost(message, optional, tag = "3")] pub max_connection_duration: ::core::option::Option< super::super::super::super::google::protobuf::Duration, >, - /// The maximum number of headers. If unconfigured, the default - /// maximum number of request headers allowed is 100. Requests that exceed this limit will receive - /// a 431 response for HTTP/1.x and cause a stream reset for HTTP/2. + /// The maximum number of headers (request headers if configured on HttpConnectionManager, + /// response headers when configured on a cluster). + /// If unconfigured, the default maximum number of headers allowed is 100. + /// The default value for requests can be overridden by setting runtime key ``envoy.reloadable_features.max_request_headers_count``. + /// The default value for responses can be overridden by setting runtime key ``envoy.reloadable_features.max_response_headers_count``. + /// Downstream requests that exceed this limit will receive a 431 response for HTTP/1.x and cause a stream + /// reset for HTTP/2. + /// Upstream responses that exceed this limit will result in a 502 response. #[prost(message, optional, tag = "2")] pub max_headers_count: ::core::option::Option< super::super::super::super::google::protobuf::UInt32Value, >, + /// The maximum size of response headers. + /// If unconfigured, the default is 60 KiB, except for HTTP/1 response headers which have a default + /// of 80KiB. + /// The default value can be overridden by setting runtime key ``envoy.reloadable_features.max_response_headers_size_kb``. + /// Responses that exceed this limit will result in a 503 response. + /// In Envoy, this setting is only valid when configured on an upstream cluster, not on the + /// :ref:`HTTP Connection Manager + /// `. + /// + /// .. note:: + /// + /// Currently some protocol codecs impose limits on the maximum size of a single header. + /// + /// * HTTP/2 (when using nghttp2) limits a single header to around 100kb. + /// * HTTP/3 limits a single header to around 1024kb. + /// + #[prost(message, optional, tag = "7")] + pub max_response_headers_kb: ::core::option::Option< + super::super::super::super::google::protobuf::UInt32Value, + >, /// Total duration to keep alive an HTTP request/response stream. If the time limit is reached the stream will be /// reset independent of any other timeouts. If not specified, this value is not set. #[prost(message, optional, tag = "4")] @@ -3455,9 +3681,15 @@ pub struct HttpProtocolOptions { >, /// Action to take when a client request with a header name containing underscore characters is received. /// If this setting is not specified, the value defaults to ALLOW. - /// Note: upstream responses are not affected by this setting. - /// Note: this only affects client headers. It does not affect headers added - /// by Envoy filters and does not have any impact if added to cluster config. + /// + /// .. note:: + /// + /// Upstream responses are not affected by this setting. + /// + /// .. note:: + /// + /// This only affects client headers. It does not affect headers added by Envoy filters and does not have any + /// impact if added to cluster config. #[prost( enumeration = "http_protocol_options::HeadersWithUnderscoresAction", tag = "5" @@ -3536,7 +3768,7 @@ impl ::prost::Name for HttpProtocolOptions { "type.googleapis.com/envoy.config.core.v3.HttpProtocolOptions".into() } } -/// \[#next-free-field: 11\] +/// \[#next-free-field: 12\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http1ProtocolOptions { /// Handle HTTP requests with absolute URLs in the requests. These requests @@ -3627,6 +3859,16 @@ pub struct Http1ProtocolOptions { /// to reject custom methods. #[prost(bool, tag = "10")] pub allow_custom_methods: bool, + /// Ignore HTTP/1.1 upgrade values matching any of the supplied matchers. + /// + /// .. note:: + /// + /// ``h2c`` upgrades are always removed for backwards compatibility, regardless of the + /// value in this setting. + #[prost(message, repeated, tag = "11")] + pub ignore_http_11_upgrade: ::prost::alloc::vec::Vec< + super::super::super::r#type::matcher::v3::StringMatcher, + >, } /// Nested message and enum types in `Http1ProtocolOptions`. pub mod http1_protocol_options { @@ -3735,7 +3977,7 @@ impl ::prost::Name for KeepaliveSettings { "type.googleapis.com/envoy.config.core.v3.KeepaliveSettings".into() } } -/// \[#next-free-field: 17\] +/// \[#next-free-field: 18\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http2ProtocolOptions { /// `Maximum table size <`_> @@ -3766,8 +4008,10 @@ pub struct Http2ProtocolOptions { /// (2^16 - 1, HTTP/2 default) to 2147483647 (2^31 - 1, HTTP/2 maximum) and defaults to 268435456 /// (256 * 1024 * 1024). /// - /// NOTE: 65535 is the initial window size from HTTP/2 spec. We only support increasing the default - /// window size now, so it's also the minimum. + /// .. note:: + /// + /// 65535 is the initial window size from HTTP/2 spec. We only support increasing the default window size now, + /// so it's also the minimum. /// /// This field also acts as a soft limit on the number of bytes Envoy will buffer per-stream in the /// HTTP/2 codec buffers. Once the buffer reaches this pointer, watermark callbacks will fire to @@ -3921,6 +4165,11 @@ pub struct Http2ProtocolOptions { pub use_oghttp2_codec: ::core::option::Option< super::super::super::super::google::protobuf::BoolValue, >, + /// Configure the maximum amount of metadata than can be handled per stream. Defaults to 1 MB. + #[prost(message, optional, tag = "17")] + pub max_metadata_size: ::core::option::Option< + super::super::super::super::google::protobuf::UInt64Value, + >, } /// Nested message and enum types in `Http2ProtocolOptions`. pub mod http2_protocol_options { @@ -3978,7 +4227,7 @@ impl ::prost::Name for GrpcProtocolOptions { } } /// A message which allows using HTTP/3. -/// \[#next-free-field: 7\] +/// \[#next-free-field: 8\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http3ProtocolOptions { #[prost(message, optional, tag = "1")] @@ -4009,6 +4258,14 @@ pub struct Http3ProtocolOptions { /// information. #[prost(bool, tag = "6")] pub allow_metadata: bool, + /// \[#not-implemented-hide:\] Hiding until Envoy has full HTTP/3 upstream support. + /// Still under implementation. DO NOT USE. + /// + /// Disables QPACK compression related features for HTTP/3 including: + /// No huffman encoding, zero dynamic table capacity and no cookie crumbing. + /// This can be useful for trading off CPU vs bandwidth when an upstream HTTP/3 connection multiplexes multiple downstream connections. + #[prost(bool, tag = "7")] + pub disable_qpack: bool, } impl ::prost::Name for Http3ProtocolOptions { const NAME: &'static str = "Http3ProtocolOptions"; @@ -4126,6 +4383,34 @@ impl ::prost::Name for UdpSocketConfig { "type.googleapis.com/envoy.config.core.v3.UdpSocketConfig".into() } } +/// Configuration for socket cmsg headers. +/// See `:ref:CMSG <`_> for further information. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct SocketCmsgHeaders { + /// cmsg level. Default is unset. + #[prost(message, optional, tag = "1")] + pub level: ::core::option::Option< + super::super::super::super::google::protobuf::UInt32Value, + >, + /// cmsg type. Default is unset. + #[prost(message, optional, tag = "2")] + pub r#type: ::core::option::Option< + super::super::super::super::google::protobuf::UInt32Value, + >, + /// Expected size of cmsg value. Default is zero. + #[prost(uint32, tag = "3")] + pub expected_size: u32, +} +impl ::prost::Name for SocketCmsgHeaders { + const NAME: &'static str = "SocketCmsgHeaders"; + const PACKAGE: &'static str = "envoy.config.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.core.v3.SocketCmsgHeaders".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.core.v3.SocketCmsgHeaders".into() + } +} /// A list of gRPC methods which can be used as an allowlist, for example. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrpcMethodList { @@ -4196,6 +4481,11 @@ impl ::prost::Name for HttpService { #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct JsonFormatOptions { /// The output JSON string properties will be sorted. + /// + /// .. note:: + /// As the properties are always sorted, this option has no effect and is deprecated. + /// + #[deprecated] #[prost(bool, tag = "1")] pub sort_properties: bool, } @@ -4219,6 +4509,12 @@ pub struct SubstitutionFormatString { /// * for ``text_format``, the output of the empty operator is changed from ``-`` to an /// empty string, so that empty values are omitted entirely. /// * for ``json_format`` the keys with null values are omitted in the output structure. + /// + /// .. note:: + /// This option does not work perfectly with ``json_format`` as keys with ``null`` values + /// will still be included in the output. See + /// for more details. + /// #[prost(bool, tag = "3")] pub omit_empty_values: bool, /// Specify a ``content_type`` field. diff --git a/src/generated/envoy.config.core.v3.serde.rs b/src/generated/envoy.config.core.v3.serde.rs index 06ab2c8..3b38696 100644 --- a/src/generated/envoy.config.core.v3.serde.rs +++ b/src/generated/envoy.config.core.v3.serde.rs @@ -3269,6 +3269,9 @@ impl serde::Serialize for grpc_service::EnvoyGrpc { if self.max_receive_message_length.is_some() { len += 1; } + if self.skip_envoy_headers { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.GrpcService.EnvoyGrpc", len)?; if !self.cluster_name.is_empty() { struct_ser.serialize_field("cluster_name", &self.cluster_name)?; @@ -3282,6 +3285,9 @@ impl serde::Serialize for grpc_service::EnvoyGrpc { if let Some(v) = self.max_receive_message_length.as_ref() { struct_ser.serialize_field("max_receive_message_length", v)?; } + if self.skip_envoy_headers { + struct_ser.serialize_field("skip_envoy_headers", &self.skip_envoy_headers)?; + } struct_ser.end() } } @@ -3299,6 +3305,8 @@ impl<'de> serde::Deserialize<'de> for grpc_service::EnvoyGrpc { "retryPolicy", "max_receive_message_length", "maxReceiveMessageLength", + "skip_envoy_headers", + "skipEnvoyHeaders", ]; #[allow(clippy::enum_variant_names)] @@ -3307,6 +3315,7 @@ impl<'de> serde::Deserialize<'de> for grpc_service::EnvoyGrpc { Authority, RetryPolicy, MaxReceiveMessageLength, + SkipEnvoyHeaders, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -3332,6 +3341,7 @@ impl<'de> serde::Deserialize<'de> for grpc_service::EnvoyGrpc { "authority" => Ok(GeneratedField::Authority), "retryPolicy" | "retry_policy" => Ok(GeneratedField::RetryPolicy), "maxReceiveMessageLength" | "max_receive_message_length" => Ok(GeneratedField::MaxReceiveMessageLength), + "skipEnvoyHeaders" | "skip_envoy_headers" => Ok(GeneratedField::SkipEnvoyHeaders), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3355,6 +3365,7 @@ impl<'de> serde::Deserialize<'de> for grpc_service::EnvoyGrpc { let mut authority__ = None; let mut retry_policy__ = None; let mut max_receive_message_length__ = None; + let mut skip_envoy_headers__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ClusterName => { @@ -3381,6 +3392,12 @@ impl<'de> serde::Deserialize<'de> for grpc_service::EnvoyGrpc { } max_receive_message_length__ = map_.next_value()?; } + GeneratedField::SkipEnvoyHeaders => { + if skip_envoy_headers__.is_some() { + return Err(serde::de::Error::duplicate_field("skipEnvoyHeaders")); + } + skip_envoy_headers__ = Some(map_.next_value()?); + } } } Ok(grpc_service::EnvoyGrpc { @@ -3388,6 +3405,7 @@ impl<'de> serde::Deserialize<'de> for grpc_service::EnvoyGrpc { authority: authority__.unwrap_or_default(), retry_policy: retry_policy__, max_receive_message_length: max_receive_message_length__, + skip_envoy_headers: skip_envoy_headers__.unwrap_or_default(), }) } } @@ -7014,6 +7032,9 @@ impl serde::Serialize for Http1ProtocolOptions { if self.allow_custom_methods { len += 1; } + if !self.ignore_http_11_upgrade.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.Http1ProtocolOptions", len)?; if let Some(v) = self.allow_absolute_url.as_ref() { struct_ser.serialize_field("allow_absolute_url", v)?; @@ -7045,6 +7066,9 @@ impl serde::Serialize for Http1ProtocolOptions { if self.allow_custom_methods { struct_ser.serialize_field("allow_custom_methods", &self.allow_custom_methods)?; } + if !self.ignore_http_11_upgrade.is_empty() { + struct_ser.serialize_field("ignore_http_11_upgrade", &self.ignore_http_11_upgrade)?; + } struct_ser.end() } } @@ -7075,6 +7099,8 @@ impl<'de> serde::Deserialize<'de> for Http1ProtocolOptions { "useBalsaParser", "allow_custom_methods", "allowCustomMethods", + "ignore_http_11_upgrade", + "ignoreHttp11Upgrade", ]; #[allow(clippy::enum_variant_names)] @@ -7089,6 +7115,7 @@ impl<'de> serde::Deserialize<'de> for Http1ProtocolOptions { SendFullyQualifiedUrl, UseBalsaParser, AllowCustomMethods, + IgnoreHttp11Upgrade, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -7120,6 +7147,7 @@ impl<'de> serde::Deserialize<'de> for Http1ProtocolOptions { "sendFullyQualifiedUrl" | "send_fully_qualified_url" => Ok(GeneratedField::SendFullyQualifiedUrl), "useBalsaParser" | "use_balsa_parser" => Ok(GeneratedField::UseBalsaParser), "allowCustomMethods" | "allow_custom_methods" => Ok(GeneratedField::AllowCustomMethods), + "ignoreHttp11Upgrade" | "ignore_http_11_upgrade" => Ok(GeneratedField::IgnoreHttp11Upgrade), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7149,6 +7177,7 @@ impl<'de> serde::Deserialize<'de> for Http1ProtocolOptions { let mut send_fully_qualified_url__ = None; let mut use_balsa_parser__ = None; let mut allow_custom_methods__ = None; + let mut ignore_http_11_upgrade__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::AllowAbsoluteUrl => { @@ -7211,6 +7240,12 @@ impl<'de> serde::Deserialize<'de> for Http1ProtocolOptions { } allow_custom_methods__ = Some(map_.next_value()?); } + GeneratedField::IgnoreHttp11Upgrade => { + if ignore_http_11_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("ignoreHttp11Upgrade")); + } + ignore_http_11_upgrade__ = Some(map_.next_value()?); + } } } Ok(Http1ProtocolOptions { @@ -7224,6 +7259,7 @@ impl<'de> serde::Deserialize<'de> for Http1ProtocolOptions { send_fully_qualified_url: send_fully_qualified_url__.unwrap_or_default(), use_balsa_parser: use_balsa_parser__, allow_custom_methods: allow_custom_methods__.unwrap_or_default(), + ignore_http_11_upgrade: ignore_http_11_upgrade__.unwrap_or_default(), }) } } @@ -7468,6 +7504,9 @@ impl serde::Serialize for Http2ProtocolOptions { if self.use_oghttp2_codec.is_some() { len += 1; } + if self.max_metadata_size.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.Http2ProtocolOptions", len)?; if let Some(v) = self.hpack_table_size.as_ref() { struct_ser.serialize_field("hpack_table_size", v)?; @@ -7517,6 +7556,9 @@ impl serde::Serialize for Http2ProtocolOptions { if let Some(v) = self.use_oghttp2_codec.as_ref() { struct_ser.serialize_field("use_oghttp2_codec", v)?; } + if let Some(v) = self.max_metadata_size.as_ref() { + struct_ser.serialize_field("max_metadata_size", v)?; + } struct_ser.end() } } @@ -7559,6 +7601,8 @@ impl<'de> serde::Deserialize<'de> for Http2ProtocolOptions { "connectionKeepalive", "use_oghttp2_codec", "useOghttp2Codec", + "max_metadata_size", + "maxMetadataSize", ]; #[allow(clippy::enum_variant_names)] @@ -7579,6 +7623,7 @@ impl<'de> serde::Deserialize<'de> for Http2ProtocolOptions { CustomSettingsParameters, ConnectionKeepalive, UseOghttp2Codec, + MaxMetadataSize, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -7616,6 +7661,7 @@ impl<'de> serde::Deserialize<'de> for Http2ProtocolOptions { "customSettingsParameters" | "custom_settings_parameters" => Ok(GeneratedField::CustomSettingsParameters), "connectionKeepalive" | "connection_keepalive" => Ok(GeneratedField::ConnectionKeepalive), "useOghttp2Codec" | "use_oghttp2_codec" => Ok(GeneratedField::UseOghttp2Codec), + "maxMetadataSize" | "max_metadata_size" => Ok(GeneratedField::MaxMetadataSize), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7651,6 +7697,7 @@ impl<'de> serde::Deserialize<'de> for Http2ProtocolOptions { let mut custom_settings_parameters__ = None; let mut connection_keepalive__ = None; let mut use_oghttp2_codec__ = None; + let mut max_metadata_size__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::HpackTableSize => { @@ -7749,6 +7796,12 @@ impl<'de> serde::Deserialize<'de> for Http2ProtocolOptions { } use_oghttp2_codec__ = map_.next_value()?; } + GeneratedField::MaxMetadataSize => { + if max_metadata_size__.is_some() { + return Err(serde::de::Error::duplicate_field("maxMetadataSize")); + } + max_metadata_size__ = map_.next_value()?; + } } } Ok(Http2ProtocolOptions { @@ -7768,6 +7821,7 @@ impl<'de> serde::Deserialize<'de> for Http2ProtocolOptions { custom_settings_parameters: custom_settings_parameters__.unwrap_or_default(), connection_keepalive: connection_keepalive__, use_oghttp2_codec: use_oghttp2_codec__, + max_metadata_size: max_metadata_size__, }) } } @@ -7902,6 +7956,9 @@ impl serde::Serialize for Http3ProtocolOptions { if self.allow_metadata { len += 1; } + if self.disable_qpack { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.Http3ProtocolOptions", len)?; if let Some(v) = self.quic_protocol_options.as_ref() { struct_ser.serialize_field("quic_protocol_options", v)?; @@ -7915,6 +7972,9 @@ impl serde::Serialize for Http3ProtocolOptions { if self.allow_metadata { struct_ser.serialize_field("allow_metadata", &self.allow_metadata)?; } + if self.disable_qpack { + struct_ser.serialize_field("disable_qpack", &self.disable_qpack)?; + } struct_ser.end() } } @@ -7933,6 +7993,8 @@ impl<'de> serde::Deserialize<'de> for Http3ProtocolOptions { "allowExtendedConnect", "allow_metadata", "allowMetadata", + "disable_qpack", + "disableQpack", ]; #[allow(clippy::enum_variant_names)] @@ -7941,6 +8003,7 @@ impl<'de> serde::Deserialize<'de> for Http3ProtocolOptions { OverrideStreamErrorOnInvalidHttpMessage, AllowExtendedConnect, AllowMetadata, + DisableQpack, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -7966,6 +8029,7 @@ impl<'de> serde::Deserialize<'de> for Http3ProtocolOptions { "overrideStreamErrorOnInvalidHttpMessage" | "override_stream_error_on_invalid_http_message" => Ok(GeneratedField::OverrideStreamErrorOnInvalidHttpMessage), "allowExtendedConnect" | "allow_extended_connect" => Ok(GeneratedField::AllowExtendedConnect), "allowMetadata" | "allow_metadata" => Ok(GeneratedField::AllowMetadata), + "disableQpack" | "disable_qpack" => Ok(GeneratedField::DisableQpack), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7989,6 +8053,7 @@ impl<'de> serde::Deserialize<'de> for Http3ProtocolOptions { let mut override_stream_error_on_invalid_http_message__ = None; let mut allow_extended_connect__ = None; let mut allow_metadata__ = None; + let mut disable_qpack__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::QuicProtocolOptions => { @@ -8015,6 +8080,12 @@ impl<'de> serde::Deserialize<'de> for Http3ProtocolOptions { } allow_metadata__ = Some(map_.next_value()?); } + GeneratedField::DisableQpack => { + if disable_qpack__.is_some() { + return Err(serde::de::Error::duplicate_field("disableQpack")); + } + disable_qpack__ = Some(map_.next_value()?); + } } } Ok(Http3ProtocolOptions { @@ -8022,6 +8093,7 @@ impl<'de> serde::Deserialize<'de> for Http3ProtocolOptions { override_stream_error_on_invalid_http_message: override_stream_error_on_invalid_http_message__, allow_extended_connect: allow_extended_connect__.unwrap_or_default(), allow_metadata: allow_metadata__.unwrap_or_default(), + disable_qpack: disable_qpack__.unwrap_or_default(), }) } } @@ -8045,6 +8117,9 @@ impl serde::Serialize for HttpProtocolOptions { if self.max_headers_count.is_some() { len += 1; } + if self.max_response_headers_kb.is_some() { + len += 1; + } if self.max_stream_duration.is_some() { len += 1; } @@ -8064,6 +8139,9 @@ impl serde::Serialize for HttpProtocolOptions { if let Some(v) = self.max_headers_count.as_ref() { struct_ser.serialize_field("max_headers_count", v)?; } + if let Some(v) = self.max_response_headers_kb.as_ref() { + struct_ser.serialize_field("max_response_headers_kb", v)?; + } if let Some(v) = self.max_stream_duration.as_ref() { struct_ser.serialize_field("max_stream_duration", v)?; } @@ -8091,6 +8169,8 @@ impl<'de> serde::Deserialize<'de> for HttpProtocolOptions { "maxConnectionDuration", "max_headers_count", "maxHeadersCount", + "max_response_headers_kb", + "maxResponseHeadersKb", "max_stream_duration", "maxStreamDuration", "headers_with_underscores_action", @@ -8104,6 +8184,7 @@ impl<'de> serde::Deserialize<'de> for HttpProtocolOptions { IdleTimeout, MaxConnectionDuration, MaxHeadersCount, + MaxResponseHeadersKb, MaxStreamDuration, HeadersWithUnderscoresAction, MaxRequestsPerConnection, @@ -8131,6 +8212,7 @@ impl<'de> serde::Deserialize<'de> for HttpProtocolOptions { "idleTimeout" | "idle_timeout" => Ok(GeneratedField::IdleTimeout), "maxConnectionDuration" | "max_connection_duration" => Ok(GeneratedField::MaxConnectionDuration), "maxHeadersCount" | "max_headers_count" => Ok(GeneratedField::MaxHeadersCount), + "maxResponseHeadersKb" | "max_response_headers_kb" => Ok(GeneratedField::MaxResponseHeadersKb), "maxStreamDuration" | "max_stream_duration" => Ok(GeneratedField::MaxStreamDuration), "headersWithUnderscoresAction" | "headers_with_underscores_action" => Ok(GeneratedField::HeadersWithUnderscoresAction), "maxRequestsPerConnection" | "max_requests_per_connection" => Ok(GeneratedField::MaxRequestsPerConnection), @@ -8156,6 +8238,7 @@ impl<'de> serde::Deserialize<'de> for HttpProtocolOptions { let mut idle_timeout__ = None; let mut max_connection_duration__ = None; let mut max_headers_count__ = None; + let mut max_response_headers_kb__ = None; let mut max_stream_duration__ = None; let mut headers_with_underscores_action__ = None; let mut max_requests_per_connection__ = None; @@ -8179,6 +8262,12 @@ impl<'de> serde::Deserialize<'de> for HttpProtocolOptions { } max_headers_count__ = map_.next_value()?; } + GeneratedField::MaxResponseHeadersKb => { + if max_response_headers_kb__.is_some() { + return Err(serde::de::Error::duplicate_field("maxResponseHeadersKb")); + } + max_response_headers_kb__ = map_.next_value()?; + } GeneratedField::MaxStreamDuration => { if max_stream_duration__.is_some() { return Err(serde::de::Error::duplicate_field("maxStreamDuration")); @@ -8203,6 +8292,7 @@ impl<'de> serde::Deserialize<'de> for HttpProtocolOptions { idle_timeout: idle_timeout__, max_connection_duration: max_connection_duration__, max_headers_count: max_headers_count__, + max_response_headers_kb: max_response_headers_kb__, max_stream_duration: max_stream_duration__, headers_with_underscores_action: headers_with_underscores_action__.unwrap_or_default(), max_requests_per_connection: max_requests_per_connection__, @@ -8881,6 +8971,9 @@ impl serde::Serialize for KeyValueAppend { { use serde::ser::SerializeStruct; let mut len = 0; + if self.record.is_some() { + len += 1; + } if self.entry.is_some() { len += 1; } @@ -8888,6 +8981,9 @@ impl serde::Serialize for KeyValueAppend { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.KeyValueAppend", len)?; + if let Some(v) = self.record.as_ref() { + struct_ser.serialize_field("record", v)?; + } if let Some(v) = self.entry.as_ref() { struct_ser.serialize_field("entry", v)?; } @@ -8906,12 +9002,14 @@ impl<'de> serde::Deserialize<'de> for KeyValueAppend { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "record", "entry", "action", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + Record, Entry, Action, } @@ -8935,6 +9033,7 @@ impl<'de> serde::Deserialize<'de> for KeyValueAppend { E: serde::de::Error, { match value { + "record" => Ok(GeneratedField::Record), "entry" => Ok(GeneratedField::Entry), "action" => Ok(GeneratedField::Action), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -8956,10 +9055,17 @@ impl<'de> serde::Deserialize<'de> for KeyValueAppend { where V: serde::de::MapAccess<'de>, { + let mut record__ = None; let mut entry__ = None; let mut action__ = None; while let Some(k) = map_.next_key()? { match k { + GeneratedField::Record => { + if record__.is_some() { + return Err(serde::de::Error::duplicate_field("record")); + } + record__ = map_.next_value()?; + } GeneratedField::Entry => { if entry__.is_some() { return Err(serde::de::Error::duplicate_field("entry")); @@ -8975,6 +9081,7 @@ impl<'de> serde::Deserialize<'de> for KeyValueAppend { } } Ok(KeyValueAppend { + record: record__, entry: entry__, action: action__.unwrap_or_default(), }) @@ -9168,6 +9275,114 @@ impl<'de> serde::Deserialize<'de> for KeyValueMutation { deserializer.deserialize_struct("envoy.config.core.v3.KeyValueMutation", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for KeyValuePair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if self.value.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.KeyValuePair", len)?; + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + if let Some(v) = self.value.as_ref() { + struct_ser.serialize_field("value", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for KeyValuePair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = KeyValuePair; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.KeyValuePair") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = Some(map_.next_value()?); + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = map_.next_value()?; + } + } + } + Ok(KeyValuePair { + key: key__.unwrap_or_default(), + value: value__, + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.KeyValuePair", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for Locality { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -9786,6 +10001,98 @@ impl<'de> serde::Deserialize<'de> for PathConfigSource { deserializer.deserialize_struct("envoy.config.core.v3.PathConfigSource", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for PerHostConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.added_tlvs.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.PerHostConfig", len)?; + if !self.added_tlvs.is_empty() { + struct_ser.serialize_field("added_tlvs", &self.added_tlvs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PerHostConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "added_tlvs", + "addedTlvs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddedTlvs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "addedTlvs" | "added_tlvs" => Ok(GeneratedField::AddedTlvs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PerHostConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.PerHostConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut added_tlvs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AddedTlvs => { + if added_tlvs__.is_some() { + return Err(serde::de::Error::duplicate_field("addedTlvs")); + } + added_tlvs__ = Some(map_.next_value()?); + } + } + } + Ok(PerHostConfig { + added_tlvs: added_tlvs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.PerHostConfig", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for Pipe { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -9910,6 +10217,9 @@ impl serde::Serialize for ProxyProtocolConfig { if self.pass_through_tlvs.is_some() { len += 1; } + if !self.added_tlvs.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.ProxyProtocolConfig", len)?; if self.version != 0 { let v = proxy_protocol_config::Version::try_from(self.version) @@ -9919,6 +10229,9 @@ impl serde::Serialize for ProxyProtocolConfig { if let Some(v) = self.pass_through_tlvs.as_ref() { struct_ser.serialize_field("pass_through_tlvs", v)?; } + if !self.added_tlvs.is_empty() { + struct_ser.serialize_field("added_tlvs", &self.added_tlvs)?; + } struct_ser.end() } } @@ -9932,12 +10245,15 @@ impl<'de> serde::Deserialize<'de> for ProxyProtocolConfig { "version", "pass_through_tlvs", "passThroughTlvs", + "added_tlvs", + "addedTlvs", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Version, PassThroughTlvs, + AddedTlvs, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -9961,6 +10277,7 @@ impl<'de> serde::Deserialize<'de> for ProxyProtocolConfig { match value { "version" => Ok(GeneratedField::Version), "passThroughTlvs" | "pass_through_tlvs" => Ok(GeneratedField::PassThroughTlvs), + "addedTlvs" | "added_tlvs" => Ok(GeneratedField::AddedTlvs), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -9982,6 +10299,7 @@ impl<'de> serde::Deserialize<'de> for ProxyProtocolConfig { { let mut version__ = None; let mut pass_through_tlvs__ = None; + let mut added_tlvs__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Version => { @@ -9996,11 +10314,18 @@ impl<'de> serde::Deserialize<'de> for ProxyProtocolConfig { } pass_through_tlvs__ = map_.next_value()?; } + GeneratedField::AddedTlvs => { + if added_tlvs__.is_some() { + return Err(serde::de::Error::duplicate_field("addedTlvs")); + } + added_tlvs__ = Some(map_.next_value()?); + } } } Ok(ProxyProtocolConfig { version: version__.unwrap_or_default(), pass_through_tlvs: pass_through_tlvs__, + added_tlvs: added_tlvs__.unwrap_or_default(), }) } } @@ -10514,6 +10839,9 @@ impl serde::Serialize for QuicProtocolOptions { if self.idle_network_timeout.is_some() { len += 1; } + if self.max_packet_length.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.QuicProtocolOptions", len)?; if let Some(v) = self.max_concurrent_streams.as_ref() { struct_ser.serialize_field("max_concurrent_streams", v)?; @@ -10539,6 +10867,9 @@ impl serde::Serialize for QuicProtocolOptions { if let Some(v) = self.idle_network_timeout.as_ref() { struct_ser.serialize_field("idle_network_timeout", v)?; } + if let Some(v) = self.max_packet_length.as_ref() { + struct_ser.serialize_field("max_packet_length", v)?; + } struct_ser.end() } } @@ -10565,6 +10896,8 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { "clientConnectionOptions", "idle_network_timeout", "idleNetworkTimeout", + "max_packet_length", + "maxPacketLength", ]; #[allow(clippy::enum_variant_names)] @@ -10577,6 +10910,7 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { ConnectionOptions, ClientConnectionOptions, IdleNetworkTimeout, + MaxPacketLength, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -10606,6 +10940,7 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { "connectionOptions" | "connection_options" => Ok(GeneratedField::ConnectionOptions), "clientConnectionOptions" | "client_connection_options" => Ok(GeneratedField::ClientConnectionOptions), "idleNetworkTimeout" | "idle_network_timeout" => Ok(GeneratedField::IdleNetworkTimeout), + "maxPacketLength" | "max_packet_length" => Ok(GeneratedField::MaxPacketLength), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -10633,6 +10968,7 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { let mut connection_options__ = None; let mut client_connection_options__ = None; let mut idle_network_timeout__ = None; + let mut max_packet_length__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::MaxConcurrentStreams => { @@ -10683,6 +11019,12 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { } idle_network_timeout__ = map_.next_value()?; } + GeneratedField::MaxPacketLength => { + if max_packet_length__.is_some() { + return Err(serde::de::Error::duplicate_field("maxPacketLength")); + } + max_packet_length__ = map_.next_value()?; + } } } Ok(QuicProtocolOptions { @@ -10694,6 +11036,7 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { connection_options: connection_options__.unwrap_or_default(), client_connection_options: client_connection_options__.unwrap_or_default(), idle_network_timeout: idle_network_timeout__, + max_packet_length: max_packet_length__, }) } } @@ -12299,6 +12642,9 @@ impl serde::Serialize for SocketAddress { if self.ipv4_compat { len += 1; } + if !self.network_namespace_filepath.is_empty() { + len += 1; + } if self.port_specifier.is_some() { len += 1; } @@ -12317,6 +12663,9 @@ impl serde::Serialize for SocketAddress { if self.ipv4_compat { struct_ser.serialize_field("ipv4_compat", &self.ipv4_compat)?; } + if !self.network_namespace_filepath.is_empty() { + struct_ser.serialize_field("network_namespace_filepath", &self.network_namespace_filepath)?; + } if let Some(v) = self.port_specifier.as_ref() { match v { socket_address::PortSpecifier::PortValue(v) => { @@ -12343,6 +12692,8 @@ impl<'de> serde::Deserialize<'de> for SocketAddress { "resolverName", "ipv4_compat", "ipv4Compat", + "network_namespace_filepath", + "networkNamespaceFilepath", "port_value", "portValue", "named_port", @@ -12355,6 +12706,7 @@ impl<'de> serde::Deserialize<'de> for SocketAddress { Address, ResolverName, Ipv4Compat, + NetworkNamespaceFilepath, PortValue, NamedPort, } @@ -12382,6 +12734,7 @@ impl<'de> serde::Deserialize<'de> for SocketAddress { "address" => Ok(GeneratedField::Address), "resolverName" | "resolver_name" => Ok(GeneratedField::ResolverName), "ipv4Compat" | "ipv4_compat" => Ok(GeneratedField::Ipv4Compat), + "networkNamespaceFilepath" | "network_namespace_filepath" => Ok(GeneratedField::NetworkNamespaceFilepath), "portValue" | "port_value" => Ok(GeneratedField::PortValue), "namedPort" | "named_port" => Ok(GeneratedField::NamedPort), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -12407,6 +12760,7 @@ impl<'de> serde::Deserialize<'de> for SocketAddress { let mut address__ = None; let mut resolver_name__ = None; let mut ipv4_compat__ = None; + let mut network_namespace_filepath__ = None; let mut port_specifier__ = None; while let Some(k) = map_.next_key()? { match k { @@ -12434,6 +12788,12 @@ impl<'de> serde::Deserialize<'de> for SocketAddress { } ipv4_compat__ = Some(map_.next_value()?); } + GeneratedField::NetworkNamespaceFilepath => { + if network_namespace_filepath__.is_some() { + return Err(serde::de::Error::duplicate_field("networkNamespaceFilepath")); + } + network_namespace_filepath__ = Some(map_.next_value()?); + } GeneratedField::PortValue => { if port_specifier__.is_some() { return Err(serde::de::Error::duplicate_field("portValue")); @@ -12453,6 +12813,7 @@ impl<'de> serde::Deserialize<'de> for SocketAddress { address: address__.unwrap_or_default(), resolver_name: resolver_name__.unwrap_or_default(), ipv4_compat: ipv4_compat__.unwrap_or_default(), + network_namespace_filepath: network_namespace_filepath__.unwrap_or_default(), port_specifier: port_specifier__, }) } @@ -12531,7 +12892,7 @@ impl<'de> serde::Deserialize<'de> for socket_address::Protocol { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for SocketOption { +impl serde::Serialize for SocketCmsgHeaders { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12539,53 +12900,187 @@ impl serde::Serialize for SocketOption { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.description.is_empty() { - len += 1; - } - if self.level != 0 { - len += 1; - } - if self.name != 0 { + if self.level.is_some() { len += 1; } - if self.state != 0 { + if self.r#type.is_some() { len += 1; } - if self.value.is_some() { + if self.expected_size != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.SocketOption", len)?; - if !self.description.is_empty() { - struct_ser.serialize_field("description", &self.description)?; - } - if self.level != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("level", ToString::to_string(&self.level).as_str())?; - } - if self.name != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("name", ToString::to_string(&self.name).as_str())?; + let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.SocketCmsgHeaders", len)?; + if let Some(v) = self.level.as_ref() { + struct_ser.serialize_field("level", v)?; } - if self.state != 0 { - let v = socket_option::SocketState::try_from(self.state) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; - struct_ser.serialize_field("state", &v)?; + if let Some(v) = self.r#type.as_ref() { + struct_ser.serialize_field("type", v)?; } - if let Some(v) = self.value.as_ref() { - match v { - socket_option::Value::IntValue(v) => { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("int_value", ToString::to_string(&v).as_str())?; - } - socket_option::Value::BufValue(v) => { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("buf_value", pbjson::private::base64::encode(&v).as_str())?; - } - } + if self.expected_size != 0 { + struct_ser.serialize_field("expected_size", &self.expected_size)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SocketCmsgHeaders { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "level", + "type", + "expected_size", + "expectedSize", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Level, + Type, + ExpectedSize, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "level" => Ok(GeneratedField::Level), + "type" => Ok(GeneratedField::Type), + "expectedSize" | "expected_size" => Ok(GeneratedField::ExpectedSize), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SocketCmsgHeaders; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.SocketCmsgHeaders") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut level__ = None; + let mut r#type__ = None; + let mut expected_size__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Level => { + if level__.is_some() { + return Err(serde::de::Error::duplicate_field("level")); + } + level__ = map_.next_value()?; + } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = map_.next_value()?; + } + GeneratedField::ExpectedSize => { + if expected_size__.is_some() { + return Err(serde::de::Error::duplicate_field("expectedSize")); + } + expected_size__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SocketCmsgHeaders { + level: level__, + r#type: r#type__, + expected_size: expected_size__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.SocketCmsgHeaders", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SocketOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.description.is_empty() { + len += 1; + } + if self.level != 0 { + len += 1; + } + if self.name != 0 { + len += 1; + } + if self.state != 0 { + len += 1; + } + if self.r#type.is_some() { + len += 1; + } + if self.value.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.SocketOption", len)?; + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if self.level != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("level", ToString::to_string(&self.level).as_str())?; + } + if self.name != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("name", ToString::to_string(&self.name).as_str())?; + } + if self.state != 0 { + let v = socket_option::SocketState::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if let Some(v) = self.r#type.as_ref() { + struct_ser.serialize_field("type", v)?; + } + if let Some(v) = self.value.as_ref() { + match v { + socket_option::Value::IntValue(v) => { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("int_value", ToString::to_string(&v).as_str())?; + } + socket_option::Value::BufValue(v) => { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("buf_value", pbjson::private::base64::encode(&v).as_str())?; + } + } } struct_ser.end() } @@ -12601,6 +13096,7 @@ impl<'de> serde::Deserialize<'de> for SocketOption { "level", "name", "state", + "type", "int_value", "intValue", "buf_value", @@ -12613,6 +13109,7 @@ impl<'de> serde::Deserialize<'de> for SocketOption { Level, Name, State, + Type, IntValue, BufValue, } @@ -12640,6 +13137,7 @@ impl<'de> serde::Deserialize<'de> for SocketOption { "level" => Ok(GeneratedField::Level), "name" => Ok(GeneratedField::Name), "state" => Ok(GeneratedField::State), + "type" => Ok(GeneratedField::Type), "intValue" | "int_value" => Ok(GeneratedField::IntValue), "bufValue" | "buf_value" => Ok(GeneratedField::BufValue), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -12665,6 +13163,7 @@ impl<'de> serde::Deserialize<'de> for SocketOption { let mut level__ = None; let mut name__ = None; let mut state__ = None; + let mut r#type__ = None; let mut value__ = None; while let Some(k) = map_.next_key()? { match k { @@ -12696,6 +13195,12 @@ impl<'de> serde::Deserialize<'de> for SocketOption { } state__ = Some(map_.next_value::()? as i32); } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = map_.next_value()?; + } GeneratedField::IntValue => { if value__.is_some() { return Err(serde::de::Error::duplicate_field("intValue")); @@ -12715,6 +13220,7 @@ impl<'de> serde::Deserialize<'de> for SocketOption { level: level__.unwrap_or_default(), name: name__.unwrap_or_default(), state: state__.unwrap_or_default(), + r#type: r#type__, value: value__, }) } @@ -12796,6 +13302,256 @@ impl<'de> serde::Deserialize<'de> for socket_option::SocketState { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for socket_option::SocketType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.stream.is_some() { + len += 1; + } + if self.datagram.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.SocketOption.SocketType", len)?; + if let Some(v) = self.stream.as_ref() { + struct_ser.serialize_field("stream", v)?; + } + if let Some(v) = self.datagram.as_ref() { + struct_ser.serialize_field("datagram", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for socket_option::SocketType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "stream", + "datagram", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Stream, + Datagram, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "stream" => Ok(GeneratedField::Stream), + "datagram" => Ok(GeneratedField::Datagram), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = socket_option::SocketType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.SocketOption.SocketType") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut stream__ = None; + let mut datagram__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Stream => { + if stream__.is_some() { + return Err(serde::de::Error::duplicate_field("stream")); + } + stream__ = map_.next_value()?; + } + GeneratedField::Datagram => { + if datagram__.is_some() { + return Err(serde::de::Error::duplicate_field("datagram")); + } + datagram__ = map_.next_value()?; + } + } + } + Ok(socket_option::SocketType { + stream: stream__, + datagram: datagram__, + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.SocketOption.SocketType", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for socket_option::socket_type::Datagram { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("envoy.config.core.v3.SocketOption.SocketType.Datagram", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for socket_option::socket_type::Datagram { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = socket_option::socket_type::Datagram; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.SocketOption.SocketType.Datagram") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(socket_option::socket_type::Datagram { + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.SocketOption.SocketType.Datagram", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for socket_option::socket_type::Stream { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("envoy.config.core.v3.SocketOption.SocketType.Stream", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for socket_option::socket_type::Stream { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = socket_option::socket_type::Stream; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.SocketOption.SocketType.Stream") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(socket_option::socket_type::Stream { + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.SocketOption.SocketType.Stream", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for SocketOptionsOverride { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -13282,6 +14038,120 @@ impl<'de> serde::Deserialize<'de> for TcpProtocolOptions { deserializer.deserialize_struct("envoy.config.core.v3.TcpProtocolOptions", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for TlvEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.r#type != 0 { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.core.v3.TlvEntry", len)?; + if self.r#type != 0 { + struct_ser.serialize_field("type", &self.r#type)?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TlvEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "type", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "type" => Ok(GeneratedField::Type), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TlvEntry; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.core.v3.TlvEntry") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut r#type__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(TlvEntry { + r#type: r#type__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.core.v3.TlvEntry", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for TrafficDirection { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.config.endpoint.v3.rs b/src/generated/envoy.config.endpoint.v3.rs index 9eb6628..41cfebb 100644 --- a/src/generated/envoy.config.endpoint.v3.rs +++ b/src/generated/envoy.config.endpoint.v3.rs @@ -162,15 +162,38 @@ impl ::prost::Name for LbEndpoint { "type.googleapis.com/envoy.config.endpoint.v3.LbEndpoint".into() } } +/// LbEndpoint list collection. Entries are `LbEndpoint` resources or references. /// \[#not-implemented-hide:\] -/// A configuration for a LEDS collection. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LbEndpointCollection { + #[prost(message, optional, tag = "1")] + pub entries: ::core::option::Option< + super::super::super::super::xds::core::v3::CollectionEntry, + >, +} +impl ::prost::Name for LbEndpointCollection { + const NAME: &'static str = "LbEndpointCollection"; + const PACKAGE: &'static str = "envoy.config.endpoint.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.endpoint.v3.LbEndpointCollection".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.endpoint.v3.LbEndpointCollection".into() + } +} +/// A configuration for an LEDS collection. #[derive(Clone, PartialEq, ::prost::Message)] pub struct LedsClusterLocalityConfig { /// Configuration for the source of LEDS updates for a Locality. #[prost(message, optional, tag = "1")] pub leds_config: ::core::option::Option, - /// The xDS transport protocol glob collection resource name. - /// The service is only supported in delta xDS (incremental) mode. + /// The name of the LbEndpoint collection resource. + /// + /// If the name ends in ``/*``, it indicates an LbEndpoint glob collection, + /// which is supported only in the xDS incremental protocol variants. + /// Otherwise, it indicates an LbEndpointCollection list collection. + /// + /// Envoy currently supports only glob collections. #[prost(string, tag = "2")] pub leds_collection_name: ::prost::alloc::string::String, } @@ -187,15 +210,18 @@ impl ::prost::Name for LedsClusterLocalityConfig { /// A group of endpoints belonging to a Locality. /// One can have multiple LocalityLbEndpoints for a locality, but only if /// they have different priorities. -/// \[#next-free-field: 9\] +/// \[#next-free-field: 10\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalityLbEndpoints { /// Identifies location of where the upstream hosts run. #[prost(message, optional, tag = "1")] pub locality: ::core::option::Option, + /// Metadata to provide additional information about the locality endpoints in aggregate. + #[prost(message, optional, tag = "9")] + pub metadata: ::core::option::Option, /// The group of endpoints belonging to the locality specified. - /// [#comment:TODO(adisuissa): Once LEDS is implemented this field needs to be - /// deprecated and replaced by ``load_balancer_endpoints``.] + /// This is ignored if :ref:`leds_cluster_locality_config + /// ` is set. #[prost(message, repeated, tag = "2")] pub lb_endpoints: ::prost::alloc::vec::Vec, /// Optional: Per priority/region/zone/sub_zone weight; at least 1. The load @@ -234,7 +260,6 @@ pub struct LocalityLbEndpoints { pub proximity: ::core::option::Option< super::super::super::super::google::protobuf::UInt32Value, >, - /// \[#not-implemented-hide:\] #[prost(oneof = "locality_lb_endpoints::LbConfig", tags = "7, 8")] pub lb_config: ::core::option::Option, } @@ -258,15 +283,16 @@ pub mod locality_lb_endpoints { .into() } } - /// \[#not-implemented-hide:\] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum LbConfig { - /// The group of endpoints belonging to the locality. - /// [#comment:TODO(adisuissa): Once LEDS is implemented the ``lb_endpoints`` field - /// needs to be deprecated.] + /// \[#not-implemented-hide:\] + /// Not implemented and deprecated. #[prost(message, tag = "7")] LoadBalancerEndpoints(LbEndpointList), /// LEDS Configuration for the current locality. + /// If this is set, the :ref:`lb_endpoints + /// ` + /// field is ignored. #[prost(message, tag = "8")] LedsClusterLocalityConfig(super::LedsClusterLocalityConfig), } @@ -381,8 +407,9 @@ pub mod cluster_load_assignment { /// to determine the health of the priority level, or in other words assume each host has a weight of 1 for /// this calculation. /// - /// Note: this is not currently implemented for - /// :ref:`locality weighted load balancing `. + /// .. note:: + /// This is not currently implemented for + /// :ref:`locality weighted load balancing `. #[prost(bool, tag = "6")] pub weighted_priority_health: bool, } @@ -437,7 +464,7 @@ impl ::prost::Name for ClusterLoadAssignment { /// These are stats Envoy reports to the management server at a frequency defined by /// :ref:`LoadStatsResponse.load_reporting_interval`. /// Stats per upstream region/zone and optionally per subzone. -/// \[#next-free-field: 9\] +/// \[#next-free-field: 15\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpstreamLocalityStats { /// Name of zone, region and optionally endpoint group these metrics were @@ -460,7 +487,45 @@ pub struct UpstreamLocalityStats { /// upstream endpoints in the locality. #[prost(uint64, tag = "8")] pub total_issued_requests: u64, - /// Stats for multi-dimensional load balancing. + /// The total number of connections in an established state at the time of the + /// report. This field is aggregated over all the upstream endpoints in the + /// locality. + /// In Envoy, this information may be based on ``upstream_cx_active metric``. + /// \[#not-implemented-hide:\] + #[prost(uint64, tag = "9")] + pub total_active_connections: u64, + /// The total number of connections opened since the last report. + /// This field is aggregated over all the upstream endpoints in the locality. + /// In Envoy, this information may be based on ``upstream_cx_total`` metric + /// compared to itself between start and end of an interval, i.e. + /// ``upstream_cx_total``(now) - ``upstream_cx_total``(now - + /// load_report_interval). + /// \[#not-implemented-hide:\] + #[prost(uint64, tag = "10")] + pub total_new_connections: u64, + /// The total number of connection failures since the last report. + /// This field is aggregated over all the upstream endpoints in the locality. + /// In Envoy, this information may be based on ``upstream_cx_connect_fail`` + /// metric compared to itself between start and end of an interval, i.e. + /// ``upstream_cx_connect_fail``(now) - ``upstream_cx_connect_fail``(now - + /// load_report_interval). + /// \[#not-implemented-hide:\] + #[prost(uint64, tag = "11")] + pub total_fail_connections: u64, + /// CPU utilization stats for multi-dimensional load balancing. + /// This typically comes from endpoint metrics reported via ORCA. + #[prost(message, optional, tag = "12")] + pub cpu_utilization: ::core::option::Option, + /// Memory utilization for multi-dimensional load balancing. + /// This typically comes from endpoint metrics reported via ORCA. + #[prost(message, optional, tag = "13")] + pub mem_utilization: ::core::option::Option, + /// Blended application-defined utilization for multi-dimensional load balancing. + /// This typically comes from endpoint metrics reported via ORCA. + #[prost(message, optional, tag = "14")] + pub application_utilization: ::core::option::Option, + /// Named stats for multi-dimensional load balancing. + /// These typically come from endpoint metrics reported via ORCA. #[prost(message, repeated, tag = "5")] pub load_metric_stats: ::prost::alloc::vec::Vec, /// Endpoint granularity stats information for this locality. This information @@ -558,6 +623,28 @@ impl ::prost::Name for EndpointLoadMetricStats { "type.googleapis.com/envoy.config.endpoint.v3.EndpointLoadMetricStats".into() } } +/// Same as EndpointLoadMetricStats, except without the metric_name field. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct UnnamedEndpointLoadMetricStats { + /// Number of calls that finished and included this metric. + #[prost(uint64, tag = "1")] + pub num_requests_finished_with_metric: u64, + /// Sum of metric values across all calls that finished with this metric for + /// load_reporting_interval. + #[prost(double, tag = "2")] + pub total_metric_value: f64, +} +impl ::prost::Name for UnnamedEndpointLoadMetricStats { + const NAME: &'static str = "UnnamedEndpointLoadMetricStats"; + const PACKAGE: &'static str = "envoy.config.endpoint.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.endpoint.v3.UnnamedEndpointLoadMetricStats".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.endpoint.v3.UnnamedEndpointLoadMetricStats" + .into() + } +} /// Per cluster load stats. Envoy reports these stats a management server in a /// :ref:`LoadStatsRequest` /// Next ID: 7 diff --git a/src/generated/envoy.config.endpoint.v3.serde.rs b/src/generated/envoy.config.endpoint.v3.serde.rs index ac6747f..e4d20b1 100644 --- a/src/generated/envoy.config.endpoint.v3.serde.rs +++ b/src/generated/envoy.config.endpoint.v3.serde.rs @@ -1377,6 +1377,97 @@ impl<'de> serde::Deserialize<'de> for LbEndpoint { deserializer.deserialize_struct("envoy.config.endpoint.v3.LbEndpoint", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for LbEndpointCollection { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.entries.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.endpoint.v3.LbEndpointCollection", len)?; + if let Some(v) = self.entries.as_ref() { + struct_ser.serialize_field("entries", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for LbEndpointCollection { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "entries", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Entries, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "entries" => Ok(GeneratedField::Entries), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = LbEndpointCollection; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.endpoint.v3.LbEndpointCollection") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut entries__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); + } + entries__ = map_.next_value()?; + } + } + } + Ok(LbEndpointCollection { + entries: entries__, + }) + } + } + deserializer.deserialize_struct("envoy.config.endpoint.v3.LbEndpointCollection", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for LedsClusterLocalityConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1498,6 +1589,9 @@ impl serde::Serialize for LocalityLbEndpoints { if self.locality.is_some() { len += 1; } + if self.metadata.is_some() { + len += 1; + } if !self.lb_endpoints.is_empty() { len += 1; } @@ -1517,6 +1611,9 @@ impl serde::Serialize for LocalityLbEndpoints { if let Some(v) = self.locality.as_ref() { struct_ser.serialize_field("locality", v)?; } + if let Some(v) = self.metadata.as_ref() { + struct_ser.serialize_field("metadata", v)?; + } if !self.lb_endpoints.is_empty() { struct_ser.serialize_field("lb_endpoints", &self.lb_endpoints)?; } @@ -1550,6 +1647,7 @@ impl<'de> serde::Deserialize<'de> for LocalityLbEndpoints { { const FIELDS: &[&str] = &[ "locality", + "metadata", "lb_endpoints", "lbEndpoints", "load_balancing_weight", @@ -1565,6 +1663,7 @@ impl<'de> serde::Deserialize<'de> for LocalityLbEndpoints { #[allow(clippy::enum_variant_names)] enum GeneratedField { Locality, + Metadata, LbEndpoints, LoadBalancingWeight, Priority, @@ -1593,6 +1692,7 @@ impl<'de> serde::Deserialize<'de> for LocalityLbEndpoints { { match value { "locality" => Ok(GeneratedField::Locality), + "metadata" => Ok(GeneratedField::Metadata), "lbEndpoints" | "lb_endpoints" => Ok(GeneratedField::LbEndpoints), "loadBalancingWeight" | "load_balancing_weight" => Ok(GeneratedField::LoadBalancingWeight), "priority" => Ok(GeneratedField::Priority), @@ -1619,6 +1719,7 @@ impl<'de> serde::Deserialize<'de> for LocalityLbEndpoints { V: serde::de::MapAccess<'de>, { let mut locality__ = None; + let mut metadata__ = None; let mut lb_endpoints__ = None; let mut load_balancing_weight__ = None; let mut priority__ = None; @@ -1632,6 +1733,12 @@ impl<'de> serde::Deserialize<'de> for LocalityLbEndpoints { } locality__ = map_.next_value()?; } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = map_.next_value()?; + } GeneratedField::LbEndpoints => { if lb_endpoints__.is_some() { return Err(serde::de::Error::duplicate_field("lbEndpoints")); @@ -1676,6 +1783,7 @@ impl<'de> serde::Deserialize<'de> for LocalityLbEndpoints { } Ok(LocalityLbEndpoints { locality: locality__, + metadata: metadata__, lb_endpoints: lb_endpoints__.unwrap_or_default(), load_balancing_weight: load_balancing_weight__, priority: priority__.unwrap_or_default(), @@ -1779,6 +1887,122 @@ impl<'de> serde::Deserialize<'de> for locality_lb_endpoints::LbEndpointList { deserializer.deserialize_struct("envoy.config.endpoint.v3.LocalityLbEndpoints.LbEndpointList", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for UnnamedEndpointLoadMetricStats { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.num_requests_finished_with_metric != 0 { + len += 1; + } + if self.total_metric_value != 0. { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.endpoint.v3.UnnamedEndpointLoadMetricStats", len)?; + if self.num_requests_finished_with_metric != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("num_requests_finished_with_metric", ToString::to_string(&self.num_requests_finished_with_metric).as_str())?; + } + if self.total_metric_value != 0. { + struct_ser.serialize_field("total_metric_value", &self.total_metric_value)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UnnamedEndpointLoadMetricStats { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "num_requests_finished_with_metric", + "numRequestsFinishedWithMetric", + "total_metric_value", + "totalMetricValue", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NumRequestsFinishedWithMetric, + TotalMetricValue, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "numRequestsFinishedWithMetric" | "num_requests_finished_with_metric" => Ok(GeneratedField::NumRequestsFinishedWithMetric), + "totalMetricValue" | "total_metric_value" => Ok(GeneratedField::TotalMetricValue), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UnnamedEndpointLoadMetricStats; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.endpoint.v3.UnnamedEndpointLoadMetricStats") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut num_requests_finished_with_metric__ = None; + let mut total_metric_value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NumRequestsFinishedWithMetric => { + if num_requests_finished_with_metric__.is_some() { + return Err(serde::de::Error::duplicate_field("numRequestsFinishedWithMetric")); + } + num_requests_finished_with_metric__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TotalMetricValue => { + if total_metric_value__.is_some() { + return Err(serde::de::Error::duplicate_field("totalMetricValue")); + } + total_metric_value__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(UnnamedEndpointLoadMetricStats { + num_requests_finished_with_metric: num_requests_finished_with_metric__.unwrap_or_default(), + total_metric_value: total_metric_value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.endpoint.v3.UnnamedEndpointLoadMetricStats", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for UpstreamEndpointStats { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -2016,6 +2240,24 @@ impl serde::Serialize for UpstreamLocalityStats { if self.total_issued_requests != 0 { len += 1; } + if self.total_active_connections != 0 { + len += 1; + } + if self.total_new_connections != 0 { + len += 1; + } + if self.total_fail_connections != 0 { + len += 1; + } + if self.cpu_utilization.is_some() { + len += 1; + } + if self.mem_utilization.is_some() { + len += 1; + } + if self.application_utilization.is_some() { + len += 1; + } if !self.load_metric_stats.is_empty() { len += 1; } @@ -2049,6 +2291,30 @@ impl serde::Serialize for UpstreamLocalityStats { #[allow(clippy::needless_borrows_for_generic_args)] struct_ser.serialize_field("total_issued_requests", ToString::to_string(&self.total_issued_requests).as_str())?; } + if self.total_active_connections != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("total_active_connections", ToString::to_string(&self.total_active_connections).as_str())?; + } + if self.total_new_connections != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("total_new_connections", ToString::to_string(&self.total_new_connections).as_str())?; + } + if self.total_fail_connections != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("total_fail_connections", ToString::to_string(&self.total_fail_connections).as_str())?; + } + if let Some(v) = self.cpu_utilization.as_ref() { + struct_ser.serialize_field("cpu_utilization", v)?; + } + if let Some(v) = self.mem_utilization.as_ref() { + struct_ser.serialize_field("mem_utilization", v)?; + } + if let Some(v) = self.application_utilization.as_ref() { + struct_ser.serialize_field("application_utilization", v)?; + } if !self.load_metric_stats.is_empty() { struct_ser.serialize_field("load_metric_stats", &self.load_metric_stats)?; } @@ -2077,6 +2343,18 @@ impl<'de> serde::Deserialize<'de> for UpstreamLocalityStats { "totalErrorRequests", "total_issued_requests", "totalIssuedRequests", + "total_active_connections", + "totalActiveConnections", + "total_new_connections", + "totalNewConnections", + "total_fail_connections", + "totalFailConnections", + "cpu_utilization", + "cpuUtilization", + "mem_utilization", + "memUtilization", + "application_utilization", + "applicationUtilization", "load_metric_stats", "loadMetricStats", "upstream_endpoint_stats", @@ -2091,6 +2369,12 @@ impl<'de> serde::Deserialize<'de> for UpstreamLocalityStats { TotalRequestsInProgress, TotalErrorRequests, TotalIssuedRequests, + TotalActiveConnections, + TotalNewConnections, + TotalFailConnections, + CpuUtilization, + MemUtilization, + ApplicationUtilization, LoadMetricStats, UpstreamEndpointStats, Priority, @@ -2120,6 +2404,12 @@ impl<'de> serde::Deserialize<'de> for UpstreamLocalityStats { "totalRequestsInProgress" | "total_requests_in_progress" => Ok(GeneratedField::TotalRequestsInProgress), "totalErrorRequests" | "total_error_requests" => Ok(GeneratedField::TotalErrorRequests), "totalIssuedRequests" | "total_issued_requests" => Ok(GeneratedField::TotalIssuedRequests), + "totalActiveConnections" | "total_active_connections" => Ok(GeneratedField::TotalActiveConnections), + "totalNewConnections" | "total_new_connections" => Ok(GeneratedField::TotalNewConnections), + "totalFailConnections" | "total_fail_connections" => Ok(GeneratedField::TotalFailConnections), + "cpuUtilization" | "cpu_utilization" => Ok(GeneratedField::CpuUtilization), + "memUtilization" | "mem_utilization" => Ok(GeneratedField::MemUtilization), + "applicationUtilization" | "application_utilization" => Ok(GeneratedField::ApplicationUtilization), "loadMetricStats" | "load_metric_stats" => Ok(GeneratedField::LoadMetricStats), "upstreamEndpointStats" | "upstream_endpoint_stats" => Ok(GeneratedField::UpstreamEndpointStats), "priority" => Ok(GeneratedField::Priority), @@ -2147,6 +2437,12 @@ impl<'de> serde::Deserialize<'de> for UpstreamLocalityStats { let mut total_requests_in_progress__ = None; let mut total_error_requests__ = None; let mut total_issued_requests__ = None; + let mut total_active_connections__ = None; + let mut total_new_connections__ = None; + let mut total_fail_connections__ = None; + let mut cpu_utilization__ = None; + let mut mem_utilization__ = None; + let mut application_utilization__ = None; let mut load_metric_stats__ = None; let mut upstream_endpoint_stats__ = None; let mut priority__ = None; @@ -2190,6 +2486,48 @@ impl<'de> serde::Deserialize<'de> for UpstreamLocalityStats { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::TotalActiveConnections => { + if total_active_connections__.is_some() { + return Err(serde::de::Error::duplicate_field("totalActiveConnections")); + } + total_active_connections__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TotalNewConnections => { + if total_new_connections__.is_some() { + return Err(serde::de::Error::duplicate_field("totalNewConnections")); + } + total_new_connections__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TotalFailConnections => { + if total_fail_connections__.is_some() { + return Err(serde::de::Error::duplicate_field("totalFailConnections")); + } + total_fail_connections__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CpuUtilization => { + if cpu_utilization__.is_some() { + return Err(serde::de::Error::duplicate_field("cpuUtilization")); + } + cpu_utilization__ = map_.next_value()?; + } + GeneratedField::MemUtilization => { + if mem_utilization__.is_some() { + return Err(serde::de::Error::duplicate_field("memUtilization")); + } + mem_utilization__ = map_.next_value()?; + } + GeneratedField::ApplicationUtilization => { + if application_utilization__.is_some() { + return Err(serde::de::Error::duplicate_field("applicationUtilization")); + } + application_utilization__ = map_.next_value()?; + } GeneratedField::LoadMetricStats => { if load_metric_stats__.is_some() { return Err(serde::de::Error::duplicate_field("loadMetricStats")); @@ -2218,6 +2556,12 @@ impl<'de> serde::Deserialize<'de> for UpstreamLocalityStats { total_requests_in_progress: total_requests_in_progress__.unwrap_or_default(), total_error_requests: total_error_requests__.unwrap_or_default(), total_issued_requests: total_issued_requests__.unwrap_or_default(), + total_active_connections: total_active_connections__.unwrap_or_default(), + total_new_connections: total_new_connections__.unwrap_or_default(), + total_fail_connections: total_fail_connections__.unwrap_or_default(), + cpu_utilization: cpu_utilization__, + mem_utilization: mem_utilization__, + application_utilization: application_utilization__, load_metric_stats: load_metric_stats__.unwrap_or_default(), upstream_endpoint_stats: upstream_endpoint_stats__.unwrap_or_default(), priority: priority__.unwrap_or_default(), diff --git a/src/generated/envoy.config.grpc_credential.v3.rs b/src/generated/envoy.config.grpc_credential.v3.rs index 6319282..4af9e3e 100644 --- a/src/generated/envoy.config.grpc_credential.v3.rs +++ b/src/generated/envoy.config.grpc_credential.v3.rs @@ -1,32 +1,5 @@ // This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct AwsIamConfig { - /// The `service namespace - /// <`_> - /// of the Grpc endpoint. - /// - /// Example: appmesh - #[prost(string, tag = "1")] - pub service_name: ::prost::alloc::string::String, - /// The `region <`_> hosting the Grpc - /// endpoint. If unspecified, the extension will use the value in the ``AWS_REGION`` environment - /// variable. - /// - /// Example: us-west-2 - #[prost(string, tag = "2")] - pub region: ::prost::alloc::string::String, -} -impl ::prost::Name for AwsIamConfig { - const NAME: &'static str = "AwsIamConfig"; - const PACKAGE: &'static str = "envoy.config.grpc_credential.v3"; - fn full_name() -> ::prost::alloc::string::String { - "envoy.config.grpc_credential.v3.AwsIamConfig".into() - } - fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.config.grpc_credential.v3.AwsIamConfig".into() - } -} -#[derive(Clone, PartialEq, ::prost::Message)] pub struct FileBasedMetadataConfig { /// Location or inline data of secret to use for authentication of the Google gRPC connection /// this secret will be attached to a header of the gRPC connection diff --git a/src/generated/envoy.config.grpc_credential.v3.serde.rs b/src/generated/envoy.config.grpc_credential.v3.serde.rs index 6c5a626..3107d67 100644 --- a/src/generated/envoy.config.grpc_credential.v3.serde.rs +++ b/src/generated/envoy.config.grpc_credential.v3.serde.rs @@ -1,112 +1,3 @@ -impl serde::Serialize for AwsIamConfig { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.service_name.is_empty() { - len += 1; - } - if !self.region.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("envoy.config.grpc_credential.v3.AwsIamConfig", len)?; - if !self.service_name.is_empty() { - struct_ser.serialize_field("service_name", &self.service_name)?; - } - if !self.region.is_empty() { - struct_ser.serialize_field("region", &self.region)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AwsIamConfig { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "service_name", - "serviceName", - "region", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ServiceName, - Region, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "serviceName" | "service_name" => Ok(GeneratedField::ServiceName), - "region" => Ok(GeneratedField::Region), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AwsIamConfig; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct envoy.config.grpc_credential.v3.AwsIamConfig") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut service_name__ = None; - let mut region__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ServiceName => { - if service_name__.is_some() { - return Err(serde::de::Error::duplicate_field("serviceName")); - } - service_name__ = Some(map_.next_value()?); - } - GeneratedField::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); - } - region__ = Some(map_.next_value()?); - } - } - } - Ok(AwsIamConfig { - service_name: service_name__.unwrap_or_default(), - region: region__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("envoy.config.grpc_credential.v3.AwsIamConfig", FIELDS, GeneratedVisitor) - } -} impl serde::Serialize for FileBasedMetadataConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.config.listener.v3.rs b/src/generated/envoy.config.listener.v3.rs index a74dad0..a6586d7 100644 --- a/src/generated/envoy.config.listener.v3.rs +++ b/src/generated/envoy.config.listener.v3.rs @@ -316,45 +316,6 @@ pub struct FilterChain { /// requires that filter chains are uniquely named within a listener. #[prost(string, tag = "7")] pub name: ::prost::alloc::string::String, - /// \[#not-implemented-hide:\] The configuration to specify whether the filter chain will be built on-demand. - /// If this field is not empty, the filter chain will be built on-demand. - /// Otherwise, the filter chain will be built normally and block listener warming. - #[prost(message, optional, tag = "8")] - pub on_demand_configuration: ::core::option::Option< - filter_chain::OnDemandConfiguration, - >, -} -/// Nested message and enum types in `FilterChain`. -pub mod filter_chain { - /// The configuration for on-demand filter chain. If this field is not empty in FilterChain message, - /// a filter chain will be built on-demand. - /// On-demand filter chains help speedup the warming up of listeners since the building and initialization of - /// an on-demand filter chain will be postponed to the arrival of new connection requests that require this filter chain. - /// Filter chains that are not often used can be set as on-demand. - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct OnDemandConfiguration { - /// The timeout to wait for filter chain placeholders to complete rebuilding. - /// 1. If this field is set to 0, timeout is disabled. - /// 2. If not specified, a default timeout of 15s is used. - /// Rebuilding will wait until dependencies are ready, have failed, or this timeout is reached. - /// Upon failure or timeout, all connections related to this filter chain will be closed. - /// Rebuilding will start again on the next new connection. - #[prost(message, optional, tag = "1")] - pub rebuild_timeout: ::core::option::Option< - super::super::super::super::super::google::protobuf::Duration, - >, - } - impl ::prost::Name for OnDemandConfiguration { - const NAME: &'static str = "OnDemandConfiguration"; - const PACKAGE: &'static str = "envoy.config.listener.v3"; - fn full_name() -> ::prost::alloc::string::String { - "envoy.config.listener.v3.FilterChain.OnDemandConfiguration".into() - } - fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.config.listener.v3.FilterChain.OnDemandConfiguration" - .into() - } - } } impl ::prost::Name for FilterChain { const NAME: &'static str = "FilterChain"; @@ -495,7 +456,7 @@ impl ::prost::Name for ListenerFilter { } } /// Configuration specific to the UDP QUIC listener. -/// \[#next-free-field: 12\] +/// \[#next-free-field: 14\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuicProtocolOptions { #[prost(message, optional, tag = "1")] @@ -574,6 +535,19 @@ pub struct QuicProtocolOptions { pub connection_debug_visitor_config: ::core::option::Option< super::super::core::v3::TypedExtensionConfig, >, + /// Configure a type of UDP cmsg to pass to listener filters via QuicReceivedPacket. + /// Both level and type must be specified for cmsg to be saved. + /// Cmsg may be truncated or omitted if expected size is not set. + /// If not specified, no cmsg will be saved to QuicReceivedPacket. + #[prost(message, repeated, tag = "12")] + pub save_cmsg_config: ::prost::alloc::vec::Vec< + super::super::core::v3::SocketCmsgHeaders, + >, + /// If true, the listener will reject connection-establishing packets at the + /// QUIC layer by replying with an empty version negotiation packet to the + /// client. + #[prost(bool, tag = "13")] + pub reject_new_connections: bool, } impl ::prost::Name for QuicProtocolOptions { const NAME: &'static str = "QuicProtocolOptions"; @@ -679,7 +653,7 @@ impl ::prost::Name for ListenerCollection { "type.googleapis.com/envoy.config.listener.v3.ListenerCollection".into() } } -/// \[#next-free-field: 36\] +/// \[#next-free-field: 37\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Listener { /// The unique name by which this listener is known. If no name is provided, @@ -712,6 +686,12 @@ pub struct Listener { /// :ref:`FAQ entry `. #[prost(message, repeated, tag = "3")] pub filter_chains: ::prost::alloc::vec::Vec, + /// Discover filter chains configurations by external service. Dynamic discovery of filter chains is allowed + /// while having statically configured filter chains, however, a filter chain name must be unique within a + /// listener. If a discovered filter chain matches a name of an existing filter chain, it is discarded. + /// \[#not-implemented-hide:\] + #[prost(message, optional, tag = "36")] + pub fcds_config: ::core::option::Option, /// :ref:`Matcher API ` resolving the filter chain name from the /// network properties. This matcher is used as a replacement for the filter chain match condition /// :ref:`filter_chain_match @@ -822,10 +802,10 @@ pub struct Listener { super::super::super::super::google::protobuf::BoolValue, >, /// Additional socket options that may not be present in Envoy source code or - /// precompiled binaries. The socket options can be updated for a listener when + /// precompiled binaries. + /// It is not allowed to update the socket options for any existing address if /// :ref:`enable_reuse_port ` - /// is ``true``. Otherwise, if socket options change during a listener update the update will be rejected - /// to make it clear that the options were not updated. + /// is ``false`` to avoid the conflict when creating new sockets for the listener. #[prost(message, repeated, tag = "13")] pub socket_options: ::prost::alloc::vec::Vec, /// Whether the listener should accept TCP Fast Open (TFO) connections. @@ -936,6 +916,11 @@ pub struct Listener { /// accepted in later event loop iterations. /// If no value is provided Envoy will accept all connections pending accept /// from the kernel. + /// + /// .. note:: + /// + /// It is recommended to lower this value for better overload management and reduced per-event cost. + /// Setting it to 1 is a viable option with no noticeable impact on performance. #[prost(message, optional, tag = "34")] pub max_connections_to_accept_per_socket_event: ::core::option::Option< super::super::super::super::google::protobuf::UInt32Value, @@ -1054,6 +1039,33 @@ pub mod listener { .into() } } + /// Configuration for filter chains discovery. + /// \[#not-implemented-hide:\] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct FcdsConfig { + /// Optional name to present to the filter chain discovery service. This may be an arbitrary name with arbitrary + /// length. If a name is not provided, the listener's name is used. Refer to :ref:`filter_chains `. + /// for details on how listener name is determined if unspecified. In addition, this may be a xdstp:// URL. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Configuration for the source of FCDS updates for this listener. + /// .. note:: + /// This discovery service only supports ``AGGREGATED_GRPC`` API type. + #[prost(message, optional, tag = "2")] + pub config_source: ::core::option::Option< + super::super::super::core::v3::ConfigSource, + >, + } + impl ::prost::Name for FcdsConfig { + const NAME: &'static str = "FcdsConfig"; + const PACKAGE: &'static str = "envoy.config.listener.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.listener.v3.Listener.FcdsConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.listener.v3.Listener.FcdsConfig".into() + } + } #[derive( Clone, Copy, diff --git a/src/generated/envoy.config.listener.v3.serde.rs b/src/generated/envoy.config.listener.v3.serde.rs index 4fc2e18..5f2e68d 100644 --- a/src/generated/envoy.config.listener.v3.serde.rs +++ b/src/generated/envoy.config.listener.v3.serde.rs @@ -498,9 +498,6 @@ impl serde::Serialize for FilterChain { if !self.name.is_empty() { len += 1; } - if self.on_demand_configuration.is_some() { - len += 1; - } let mut struct_ser = serializer.serialize_struct("envoy.config.listener.v3.FilterChain", len)?; if let Some(v) = self.filter_chain_match.as_ref() { struct_ser.serialize_field("filter_chain_match", v)?; @@ -523,9 +520,6 @@ impl serde::Serialize for FilterChain { if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } - if let Some(v) = self.on_demand_configuration.as_ref() { - struct_ser.serialize_field("on_demand_configuration", v)?; - } struct_ser.end() } } @@ -547,8 +541,6 @@ impl<'de> serde::Deserialize<'de> for FilterChain { "transport_socket_connect_timeout", "transportSocketConnectTimeout", "name", - "on_demand_configuration", - "onDemandConfiguration", ]; #[allow(clippy::enum_variant_names)] @@ -560,7 +552,6 @@ impl<'de> serde::Deserialize<'de> for FilterChain { TransportSocket, TransportSocketConnectTimeout, Name, - OnDemandConfiguration, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -589,7 +580,6 @@ impl<'de> serde::Deserialize<'de> for FilterChain { "transportSocket" | "transport_socket" => Ok(GeneratedField::TransportSocket), "transportSocketConnectTimeout" | "transport_socket_connect_timeout" => Ok(GeneratedField::TransportSocketConnectTimeout), "name" => Ok(GeneratedField::Name), - "onDemandConfiguration" | "on_demand_configuration" => Ok(GeneratedField::OnDemandConfiguration), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -616,7 +606,6 @@ impl<'de> serde::Deserialize<'de> for FilterChain { let mut transport_socket__ = None; let mut transport_socket_connect_timeout__ = None; let mut name__ = None; - let mut on_demand_configuration__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::FilterChainMatch => { @@ -661,12 +650,6 @@ impl<'de> serde::Deserialize<'de> for FilterChain { } name__ = Some(map_.next_value()?); } - GeneratedField::OnDemandConfiguration => { - if on_demand_configuration__.is_some() { - return Err(serde::de::Error::duplicate_field("onDemandConfiguration")); - } - on_demand_configuration__ = map_.next_value()?; - } } } Ok(FilterChain { @@ -677,105 +660,12 @@ impl<'de> serde::Deserialize<'de> for FilterChain { transport_socket: transport_socket__, transport_socket_connect_timeout: transport_socket_connect_timeout__, name: name__.unwrap_or_default(), - on_demand_configuration: on_demand_configuration__, }) } } deserializer.deserialize_struct("envoy.config.listener.v3.FilterChain", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for filter_chain::OnDemandConfiguration { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.rebuild_timeout.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("envoy.config.listener.v3.FilterChain.OnDemandConfiguration", len)?; - if let Some(v) = self.rebuild_timeout.as_ref() { - struct_ser.serialize_field("rebuild_timeout", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for filter_chain::OnDemandConfiguration { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "rebuild_timeout", - "rebuildTimeout", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RebuildTimeout, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "rebuildTimeout" | "rebuild_timeout" => Ok(GeneratedField::RebuildTimeout), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = filter_chain::OnDemandConfiguration; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct envoy.config.listener.v3.FilterChain.OnDemandConfiguration") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut rebuild_timeout__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::RebuildTimeout => { - if rebuild_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("rebuildTimeout")); - } - rebuild_timeout__ = map_.next_value()?; - } - } - } - Ok(filter_chain::OnDemandConfiguration { - rebuild_timeout: rebuild_timeout__, - }) - } - } - deserializer.deserialize_struct("envoy.config.listener.v3.FilterChain.OnDemandConfiguration", FIELDS, GeneratedVisitor) - } -} impl serde::Serialize for FilterChainMatch { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1150,6 +1040,9 @@ impl serde::Serialize for Listener { if !self.filter_chains.is_empty() { len += 1; } + if self.fcds_config.is_some() { + len += 1; + } if self.filter_chain_matcher.is_some() { len += 1; } @@ -1250,6 +1143,9 @@ impl serde::Serialize for Listener { if !self.filter_chains.is_empty() { struct_ser.serialize_field("filter_chains", &self.filter_chains)?; } + if let Some(v) = self.fcds_config.as_ref() { + struct_ser.serialize_field("fcds_config", v)?; + } if let Some(v) = self.filter_chain_matcher.as_ref() { struct_ser.serialize_field("filter_chain_matcher", v)?; } @@ -1360,6 +1256,8 @@ impl<'de> serde::Deserialize<'de> for Listener { "statPrefix", "filter_chains", "filterChains", + "fcds_config", + "fcdsConfig", "filter_chain_matcher", "filterChainMatcher", "use_original_dst", @@ -1422,6 +1320,7 @@ impl<'de> serde::Deserialize<'de> for Listener { AdditionalAddresses, StatPrefix, FilterChains, + FcdsConfig, FilterChainMatcher, UseOriginalDst, DefaultFilterChain, @@ -1476,6 +1375,7 @@ impl<'de> serde::Deserialize<'de> for Listener { "additionalAddresses" | "additional_addresses" => Ok(GeneratedField::AdditionalAddresses), "statPrefix" | "stat_prefix" => Ok(GeneratedField::StatPrefix), "filterChains" | "filter_chains" => Ok(GeneratedField::FilterChains), + "fcdsConfig" | "fcds_config" => Ok(GeneratedField::FcdsConfig), "filterChainMatcher" | "filter_chain_matcher" => Ok(GeneratedField::FilterChainMatcher), "useOriginalDst" | "use_original_dst" => Ok(GeneratedField::UseOriginalDst), "defaultFilterChain" | "default_filter_chain" => Ok(GeneratedField::DefaultFilterChain), @@ -1528,6 +1428,7 @@ impl<'de> serde::Deserialize<'de> for Listener { let mut additional_addresses__ = None; let mut stat_prefix__ = None; let mut filter_chains__ = None; + let mut fcds_config__ = None; let mut filter_chain_matcher__ = None; let mut use_original_dst__ = None; let mut default_filter_chain__ = None; @@ -1588,6 +1489,12 @@ impl<'de> serde::Deserialize<'de> for Listener { } filter_chains__ = Some(map_.next_value()?); } + GeneratedField::FcdsConfig => { + if fcds_config__.is_some() { + return Err(serde::de::Error::duplicate_field("fcdsConfig")); + } + fcds_config__ = map_.next_value()?; + } GeneratedField::FilterChainMatcher => { if filter_chain_matcher__.is_some() { return Err(serde::de::Error::duplicate_field("filterChainMatcher")); @@ -1765,6 +1672,7 @@ impl<'de> serde::Deserialize<'de> for Listener { additional_addresses: additional_addresses__.unwrap_or_default(), stat_prefix: stat_prefix__.unwrap_or_default(), filter_chains: filter_chains__.unwrap_or_default(), + fcds_config: fcds_config__, filter_chain_matcher: filter_chain_matcher__, use_original_dst: use_original_dst__, default_filter_chain: default_filter_chain__, @@ -2144,6 +2052,115 @@ impl<'de> serde::Deserialize<'de> for listener::DrainType { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for listener::FcdsConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.config_source.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.listener.v3.Listener.FcdsConfig", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.config_source.as_ref() { + struct_ser.serialize_field("config_source", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for listener::FcdsConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "config_source", + "configSource", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + ConfigSource, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "configSource" | "config_source" => Ok(GeneratedField::ConfigSource), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = listener::FcdsConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.listener.v3.Listener.FcdsConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut config_source__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::ConfigSource => { + if config_source__.is_some() { + return Err(serde::de::Error::duplicate_field("configSource")); + } + config_source__ = map_.next_value()?; + } + } + } + Ok(listener::FcdsConfig { + name: name__.unwrap_or_default(), + config_source: config_source__, + }) + } + } + deserializer.deserialize_struct("envoy.config.listener.v3.Listener.FcdsConfig", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for listener::InternalListenerConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -2807,6 +2824,12 @@ impl serde::Serialize for QuicProtocolOptions { if self.connection_debug_visitor_config.is_some() { len += 1; } + if !self.save_cmsg_config.is_empty() { + len += 1; + } + if self.reject_new_connections { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.listener.v3.QuicProtocolOptions", len)?; if let Some(v) = self.quic_protocol_options.as_ref() { struct_ser.serialize_field("quic_protocol_options", v)?; @@ -2841,6 +2864,12 @@ impl serde::Serialize for QuicProtocolOptions { if let Some(v) = self.connection_debug_visitor_config.as_ref() { struct_ser.serialize_field("connection_debug_visitor_config", v)?; } + if !self.save_cmsg_config.is_empty() { + struct_ser.serialize_field("save_cmsg_config", &self.save_cmsg_config)?; + } + if self.reject_new_connections { + struct_ser.serialize_field("reject_new_connections", &self.reject_new_connections)?; + } struct_ser.end() } } @@ -2872,6 +2901,10 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { "sendDisableActiveMigration", "connection_debug_visitor_config", "connectionDebugVisitorConfig", + "save_cmsg_config", + "saveCmsgConfig", + "reject_new_connections", + "rejectNewConnections", ]; #[allow(clippy::enum_variant_names)] @@ -2887,6 +2920,8 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { ServerPreferredAddressConfig, SendDisableActiveMigration, ConnectionDebugVisitorConfig, + SaveCmsgConfig, + RejectNewConnections, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -2919,6 +2954,8 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { "serverPreferredAddressConfig" | "server_preferred_address_config" => Ok(GeneratedField::ServerPreferredAddressConfig), "sendDisableActiveMigration" | "send_disable_active_migration" => Ok(GeneratedField::SendDisableActiveMigration), "connectionDebugVisitorConfig" | "connection_debug_visitor_config" => Ok(GeneratedField::ConnectionDebugVisitorConfig), + "saveCmsgConfig" | "save_cmsg_config" => Ok(GeneratedField::SaveCmsgConfig), + "rejectNewConnections" | "reject_new_connections" => Ok(GeneratedField::RejectNewConnections), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2949,6 +2986,8 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { let mut server_preferred_address_config__ = None; let mut send_disable_active_migration__ = None; let mut connection_debug_visitor_config__ = None; + let mut save_cmsg_config__ = None; + let mut reject_new_connections__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::QuicProtocolOptions => { @@ -3017,6 +3056,18 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { } connection_debug_visitor_config__ = map_.next_value()?; } + GeneratedField::SaveCmsgConfig => { + if save_cmsg_config__.is_some() { + return Err(serde::de::Error::duplicate_field("saveCmsgConfig")); + } + save_cmsg_config__ = Some(map_.next_value()?); + } + GeneratedField::RejectNewConnections => { + if reject_new_connections__.is_some() { + return Err(serde::de::Error::duplicate_field("rejectNewConnections")); + } + reject_new_connections__ = Some(map_.next_value()?); + } } } Ok(QuicProtocolOptions { @@ -3031,6 +3082,8 @@ impl<'de> serde::Deserialize<'de> for QuicProtocolOptions { server_preferred_address_config: server_preferred_address_config__, send_disable_active_migration: send_disable_active_migration__, connection_debug_visitor_config: connection_debug_visitor_config__, + save_cmsg_config: save_cmsg_config__.unwrap_or_default(), + reject_new_connections: reject_new_connections__.unwrap_or_default(), }) } } diff --git a/src/generated/envoy.config.overload.v3.rs b/src/generated/envoy.config.overload.v3.rs index 193472a..70e8655 100644 --- a/src/generated/envoy.config.overload.v3.rs +++ b/src/generated/envoy.config.overload.v3.rs @@ -172,6 +172,11 @@ pub mod scale_timers_overload_action_config { /// This affects the value of /// :ref:`FilterChain.transport_socket_connect_timeout `. TransportSocketConnect = 3, + /// Adjusts the max connection duration timer for downstream HTTP connections. + /// This affects the value of + /// :ref:`HttpConnectionManager.common_http_protocol_options.max_connection_duration + /// `. + HttpDownstreamConnectionMax = 4, } impl TimerType { /// String value of the enum field names used in the ProtoBuf definition. @@ -184,6 +189,7 @@ pub mod scale_timers_overload_action_config { Self::HttpDownstreamConnectionIdle => "HTTP_DOWNSTREAM_CONNECTION_IDLE", Self::HttpDownstreamStreamIdle => "HTTP_DOWNSTREAM_STREAM_IDLE", Self::TransportSocketConnect => "TRANSPORT_SOCKET_CONNECT", + Self::HttpDownstreamConnectionMax => "HTTP_DOWNSTREAM_CONNECTION_MAX", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -195,6 +201,9 @@ pub mod scale_timers_overload_action_config { } "HTTP_DOWNSTREAM_STREAM_IDLE" => Some(Self::HttpDownstreamStreamIdle), "TRANSPORT_SOCKET_CONNECT" => Some(Self::TransportSocketConnect), + "HTTP_DOWNSTREAM_CONNECTION_MAX" => { + Some(Self::HttpDownstreamConnectionMax) + } _ => None, } } diff --git a/src/generated/envoy.config.overload.v3.serde.rs b/src/generated/envoy.config.overload.v3.serde.rs index 6eab194..1cbad7a 100644 --- a/src/generated/envoy.config.overload.v3.serde.rs +++ b/src/generated/envoy.config.overload.v3.serde.rs @@ -836,6 +836,7 @@ impl serde::Serialize for scale_timers_overload_action_config::TimerType { Self::HttpDownstreamConnectionIdle => "HTTP_DOWNSTREAM_CONNECTION_IDLE", Self::HttpDownstreamStreamIdle => "HTTP_DOWNSTREAM_STREAM_IDLE", Self::TransportSocketConnect => "TRANSPORT_SOCKET_CONNECT", + Self::HttpDownstreamConnectionMax => "HTTP_DOWNSTREAM_CONNECTION_MAX", }; serializer.serialize_str(variant) } @@ -851,6 +852,7 @@ impl<'de> serde::Deserialize<'de> for scale_timers_overload_action_config::Timer "HTTP_DOWNSTREAM_CONNECTION_IDLE", "HTTP_DOWNSTREAM_STREAM_IDLE", "TRANSPORT_SOCKET_CONNECT", + "HTTP_DOWNSTREAM_CONNECTION_MAX", ]; struct GeneratedVisitor; @@ -895,6 +897,7 @@ impl<'de> serde::Deserialize<'de> for scale_timers_overload_action_config::Timer "HTTP_DOWNSTREAM_CONNECTION_IDLE" => Ok(scale_timers_overload_action_config::TimerType::HttpDownstreamConnectionIdle), "HTTP_DOWNSTREAM_STREAM_IDLE" => Ok(scale_timers_overload_action_config::TimerType::HttpDownstreamStreamIdle), "TRANSPORT_SOCKET_CONNECT" => Ok(scale_timers_overload_action_config::TimerType::TransportSocketConnect), + "HTTP_DOWNSTREAM_CONNECTION_MAX" => Ok(scale_timers_overload_action_config::TimerType::HttpDownstreamConnectionMax), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } diff --git a/src/generated/envoy.config.rbac.v3.rs b/src/generated/envoy.config.rbac.v3.rs index 9aa7ddd..f1bbace 100644 --- a/src/generated/envoy.config.rbac.v3.rs +++ b/src/generated/envoy.config.rbac.v3.rs @@ -280,13 +280,46 @@ impl ::prost::Name for Policy { "type.googleapis.com/envoy.config.rbac.v3.Policy".into() } } +/// SourcedMetadata enables matching against metadata from different sources in the request processing +/// pipeline. It extends the base MetadataMatcher functionality by allowing specification of where the +/// metadata should be sourced from, rather than only matching against dynamic metadata. +/// +/// The matcher can be configured to look up metadata from: +/// +/// * Dynamic metadata: Runtime metadata added by filters during request processing +/// * Route metadata: Static metadata configured on the route entry +/// +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SourcedMetadata { + /// Metadata matcher configuration that defines what metadata to match against. This includes the filter name, + /// metadata key path, and expected value. + #[prost(message, optional, tag = "1")] + pub metadata_matcher: ::core::option::Option< + super::super::super::r#type::matcher::v3::MetadataMatcher, + >, + /// Specifies which metadata source should be used for matching. If not set, + /// defaults to DYNAMIC (dynamic metadata). Set to ROUTE to match against + /// static metadata configured on the route entry. + #[prost(enumeration = "MetadataSource", tag = "2")] + pub metadata_source: i32, +} +impl ::prost::Name for SourcedMetadata { + const NAME: &'static str = "SourcedMetadata"; + const PACKAGE: &'static str = "envoy.config.rbac.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.rbac.v3.SourcedMetadata".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.rbac.v3.SourcedMetadata".into() + } +} /// Permission defines an action (or actions) that a principal can take. -/// \[#next-free-field: 14\] +/// \[#next-free-field: 15\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Permission { #[prost( oneof = "permission::Rule", - tags = "1, 2, 3, 4, 10, 5, 6, 11, 7, 8, 9, 12, 13" + tags = "1, 2, 3, 4, 10, 5, 6, 11, 7, 8, 9, 12, 13, 14" )] pub rule: ::core::option::Option, } @@ -320,10 +353,14 @@ pub mod permission { /// When any is set, it matches any action. #[prost(bool, tag = "3")] Any(bool), - /// A header (or pseudo-header such as :path or :method) on the incoming HTTP request. Only - /// available for HTTP request. - /// Note: the pseudo-header :path includes the query and fragment string. Use the ``url_path`` - /// field if you want to match the URL path without the query and fragment string. + /// A header (or pseudo-header such as ``:path`` or ``:method``) on the incoming HTTP request. Only available + /// for HTTP request. + /// + /// .. note:: + /// + /// The pseudo-header ``:path`` includes the query and fragment string. Use the ``url_path`` field if you + /// want to match the URL path without the query and fragment string. + /// #[prost(message, tag = "4")] Header(super::super::super::route::v3::HeaderMatcher), /// A URL path on the incoming HTTP request. Only available for HTTP. @@ -338,7 +375,8 @@ pub mod permission { /// A port number range that describes a range of destination ports connecting to. #[prost(message, tag = "11")] DestinationPortRange(super::super::super::super::r#type::v3::Int32Range), - /// Metadata that describes additional information about the action. + /// Metadata that describes additional information about the action. This field is deprecated; please use + /// :ref:`sourced_metadata` instead. #[prost(message, tag = "7")] Metadata(super::super::super::super::r#type::matcher::v3::MetadataMatcher), /// Negates matching the provided permission. For instance, if the value of @@ -346,8 +384,7 @@ pub mod permission { /// the value of ``not_rule`` would not match, this permission would match. #[prost(message, tag = "8")] NotRule(::prost::alloc::boxed::Box), - /// The request server from the client's connection request. This is - /// typically TLS SNI. + /// The request server from the client's connection request. This is typically TLS SNI. /// /// .. attention:: /// @@ -364,8 +401,7 @@ pub mod permission { /// * A :ref:`listener filter ` may /// overwrite a connection's requested server name within Envoy. /// - /// Please refer to :ref:`this FAQ entry ` to learn to - /// setup SNI. + /// Please refer to :ref:`this FAQ entry ` to learn how to setup SNI. #[prost(message, tag = "9")] RequestedServerName( super::super::super::super::r#type::matcher::v3::StringMatcher, @@ -378,6 +414,10 @@ pub mod permission { /// \[#extension-category: envoy.path.match\] #[prost(message, tag = "13")] UriTemplate(super::super::super::core::v3::TypedExtensionConfig), + /// Matches against metadata from either dynamic state or route configuration. Preferred over the + /// ``metadata`` field as it provides more flexibility in metadata source selection. + #[prost(message, tag = "14")] + SourcedMetadata(super::SourcedMetadata), } } impl ::prost::Name for Permission { @@ -392,12 +432,12 @@ impl ::prost::Name for Permission { } /// Principal defines an identity or a group of identities for a downstream /// subject. -/// \[#next-free-field: 13\] +/// \[#next-free-field: 15\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Principal { #[prost( oneof = "principal::Identifier", - tags = "1, 2, 3, 4, 5, 10, 11, 6, 9, 7, 12, 8" + tags = "1, 2, 3, 4, 5, 10, 11, 6, 9, 7, 12, 8, 13, 14" )] pub identifier: ::core::option::Option, } @@ -421,11 +461,19 @@ pub mod principal { } } /// Authentication attributes for a downstream. + /// It is recommended to NOT use this type, but instead use + /// :ref:`MTlsAuthenticated `, + /// configured via :ref:`custom `, + /// which should be used for most use cases due to its improved security. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Authenticated { /// The name of the principal. If set, The URI SAN or DNS SAN in that order /// is used from the certificate, otherwise the subject field is used. If - /// unset, it applies to any user that is authenticated. + /// unset, it applies to any user that is allowed by the downstream TLS configuration. + /// If :ref:`require_client_certificate ` + /// is false or :ref:`trust_chain_verification ` + /// is set to :ref:`ACCEPT_UNTRUSTED `, + /// then no authentication is required. #[prost(message, optional, tag = "2")] pub principal_name: ::core::option::Option< super::super::super::super::r#type::matcher::v3::StringMatcher, @@ -443,18 +491,20 @@ pub mod principal { } #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Identifier { - /// A set of identifiers that all must match in order to define the - /// downstream. + /// A set of identifiers that all must match in order to define the downstream. #[prost(message, tag = "1")] AndIds(Set), - /// A set of identifiers at least one must match in order to define the - /// downstream. + /// A set of identifiers at least one must match in order to define the downstream. #[prost(message, tag = "2")] OrIds(Set), /// When any is set, it matches any downstream. #[prost(bool, tag = "3")] Any(bool), /// Authenticated attributes that identify the downstream. + /// It is recommended to NOT use this field, but instead use + /// :ref:`MTlsAuthenticated `, + /// configured via :ref:`custom `, + /// which should be used for most use cases due to its improved security. #[prost(message, tag = "4")] Authenticated(Authenticated), /// A CIDR block that describes the downstream IP. @@ -467,30 +517,40 @@ pub mod principal { #[prost(message, tag = "5")] SourceIp(super::super::super::core::v3::CidrRange), /// A CIDR block that describes the downstream remote/origin address. - /// Note: This is always the physical peer even if the - /// :ref:`remote_ip ` is - /// inferred from for example the x-forwarder-for header, proxy protocol, - /// etc. + /// + /// .. note:: + /// + /// This is always the physical peer even if the + /// :ref:`remote_ip ` is inferred from the + /// x-forwarder-for header, the proxy protocol, etc. + /// #[prost(message, tag = "10")] DirectRemoteIp(super::super::super::core::v3::CidrRange), /// A CIDR block that describes the downstream remote/origin address. - /// Note: This may not be the physical peer and could be different from the - /// :ref:`direct_remote_ip - /// `. E.g, if the - /// remote ip is inferred from for example the x-forwarder-for header, proxy - /// protocol, etc. + /// + /// .. note:: + /// + /// This may not be the physical peer and could be different from the :ref:`direct_remote_ip + /// `. E.g, if the remote ip is inferred from + /// the x-forwarder-for header, the proxy protocol, etc. + /// #[prost(message, tag = "11")] RemoteIp(super::super::super::core::v3::CidrRange), - /// A header (or pseudo-header such as :path or :method) on the incoming HTTP - /// request. Only available for HTTP request. Note: the pseudo-header :path - /// includes the query and fragment string. Use the ``url_path`` field if you - /// want to match the URL path without the query and fragment string. + /// A header (or pseudo-header such as ``:path`` or ``:method``) on the incoming HTTP request. Only available + /// for HTTP request. + /// + /// .. note:: + /// + /// The pseudo-header ``:path`` includes the query and fragment string. Use the ``url_path`` field if you + /// want to match the URL path without the query and fragment string. + /// #[prost(message, tag = "6")] Header(super::super::super::route::v3::HeaderMatcher), /// A URL path on the incoming HTTP request. Only available for HTTP. #[prost(message, tag = "9")] UrlPath(super::super::super::super::r#type::matcher::v3::PathMatcher), - /// Metadata that describes additional information about the principal. + /// Metadata that describes additional information about the principal. This field is deprecated; please use + /// :ref:`sourced_metadata` instead. #[prost(message, tag = "7")] Metadata(super::super::super::super::r#type::matcher::v3::MetadataMatcher), /// Identifies the principal using a filter state object. @@ -501,6 +561,14 @@ pub mod principal { /// value of ``not_id`` would not match, this principal would match. #[prost(message, tag = "8")] NotId(::prost::alloc::boxed::Box), + /// Matches against metadata from either dynamic state or route configuration. Preferred over the + /// ``metadata`` field as it provides more flexibility in metadata source selection. + #[prost(message, tag = "13")] + SourcedMetadata(super::SourcedMetadata), + /// Extension for configuring custom principals for RBAC. + /// \[#extension-category: envoy.rbac.principals\] + #[prost(message, tag = "14")] + Custom(super::super::super::core::v3::TypedExtensionConfig), } } impl ::prost::Name for Principal { @@ -522,7 +590,7 @@ pub struct Action { /// The action to take if the matcher matches. Every action either allows or denies a request, /// and can also carry out action-specific operations. /// - /// Actions: + /// **Actions:** /// /// * ``ALLOW``: If the request gets matched on ALLOW, it is permitted. /// * ``DENY``: If the request gets matched on DENY, it is not permitted. @@ -531,7 +599,7 @@ pub struct Action { /// ``envoy.common`` will be set to the value ``true``. /// * If the request cannot get matched, it will fallback to ``DENY``. /// - /// Log behavior: + /// **Log behavior:** /// /// If the RBAC matcher contains at least one LOG action, the dynamic /// metadata key ``access_log_hint`` will be set based on if the request @@ -550,3 +618,31 @@ impl ::prost::Name for Action { "type.googleapis.com/envoy.config.rbac.v3.Action".into() } } +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum MetadataSource { + /// Query :ref:`dynamic metadata ` + Dynamic = 0, + /// Query :ref:`route metadata ` + Route = 1, +} +impl MetadataSource { + /// 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::Dynamic => "DYNAMIC", + Self::Route => "ROUTE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DYNAMIC" => Some(Self::Dynamic), + "ROUTE" => Some(Self::Route), + _ => None, + } + } +} diff --git a/src/generated/envoy.config.rbac.v3.serde.rs b/src/generated/envoy.config.rbac.v3.serde.rs index 53e5d6a..af358c2 100644 --- a/src/generated/envoy.config.rbac.v3.serde.rs +++ b/src/generated/envoy.config.rbac.v3.serde.rs @@ -108,6 +108,77 @@ impl<'de> serde::Deserialize<'de> for Action { deserializer.deserialize_struct("envoy.config.rbac.v3.Action", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MetadataSource { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Dynamic => "DYNAMIC", + Self::Route => "ROUTE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for MetadataSource { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "DYNAMIC", + "ROUTE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MetadataSource; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "DYNAMIC" => Ok(MetadataSource::Dynamic), + "ROUTE" => Ok(MetadataSource::Route), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for Permission { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -161,6 +232,9 @@ impl serde::Serialize for Permission { permission::Rule::UriTemplate(v) => { struct_ser.serialize_field("uri_template", v)?; } + permission::Rule::SourcedMetadata(v) => { + struct_ser.serialize_field("sourced_metadata", v)?; + } } } struct_ser.end() @@ -195,6 +269,8 @@ impl<'de> serde::Deserialize<'de> for Permission { "matcher", "uri_template", "uriTemplate", + "sourced_metadata", + "sourcedMetadata", ]; #[allow(clippy::enum_variant_names)] @@ -212,6 +288,7 @@ impl<'de> serde::Deserialize<'de> for Permission { RequestedServerName, Matcher, UriTemplate, + SourcedMetadata, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -246,6 +323,7 @@ impl<'de> serde::Deserialize<'de> for Permission { "requestedServerName" | "requested_server_name" => Ok(GeneratedField::RequestedServerName), "matcher" => Ok(GeneratedField::Matcher), "uriTemplate" | "uri_template" => Ok(GeneratedField::UriTemplate), + "sourcedMetadata" | "sourced_metadata" => Ok(GeneratedField::SourcedMetadata), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -355,6 +433,13 @@ impl<'de> serde::Deserialize<'de> for Permission { return Err(serde::de::Error::duplicate_field("uriTemplate")); } rule__ = map_.next_value::<::std::option::Option<_>>()?.map(permission::Rule::UriTemplate) +; + } + GeneratedField::SourcedMetadata => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcedMetadata")); + } + rule__ = map_.next_value::<::std::option::Option<_>>()?.map(permission::Rule::SourcedMetadata) ; } } @@ -651,6 +736,12 @@ impl serde::Serialize for Principal { principal::Identifier::NotId(v) => { struct_ser.serialize_field("not_id", v)?; } + principal::Identifier::SourcedMetadata(v) => { + struct_ser.serialize_field("sourced_metadata", v)?; + } + principal::Identifier::Custom(v) => { + struct_ser.serialize_field("custom", v)?; + } } } struct_ser.end() @@ -683,6 +774,9 @@ impl<'de> serde::Deserialize<'de> for Principal { "filterState", "not_id", "notId", + "sourced_metadata", + "sourcedMetadata", + "custom", ]; #[allow(clippy::enum_variant_names)] @@ -699,6 +793,8 @@ impl<'de> serde::Deserialize<'de> for Principal { Metadata, FilterState, NotId, + SourcedMetadata, + Custom, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -732,6 +828,8 @@ impl<'de> serde::Deserialize<'de> for Principal { "metadata" => Ok(GeneratedField::Metadata), "filterState" | "filter_state" => Ok(GeneratedField::FilterState), "notId" | "not_id" => Ok(GeneratedField::NotId), + "sourcedMetadata" | "sourced_metadata" => Ok(GeneratedField::SourcedMetadata), + "custom" => Ok(GeneratedField::Custom), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -835,6 +933,20 @@ impl<'de> serde::Deserialize<'de> for Principal { return Err(serde::de::Error::duplicate_field("notId")); } identifier__ = map_.next_value::<::std::option::Option<_>>()?.map(principal::Identifier::NotId) +; + } + GeneratedField::SourcedMetadata => { + if identifier__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcedMetadata")); + } + identifier__ = map_.next_value::<::std::option::Option<_>>()?.map(principal::Identifier::SourcedMetadata) +; + } + GeneratedField::Custom => { + if identifier__.is_some() { + return Err(serde::de::Error::duplicate_field("custom")); + } + identifier__ = map_.next_value::<::std::option::Option<_>>()?.map(principal::Identifier::Custom) ; } } @@ -1533,3 +1645,115 @@ impl<'de> serde::Deserialize<'de> for rbac::audit_logging_options::AuditLoggerCo deserializer.deserialize_struct("envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for SourcedMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.metadata_matcher.is_some() { + len += 1; + } + if self.metadata_source != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.rbac.v3.SourcedMetadata", len)?; + if let Some(v) = self.metadata_matcher.as_ref() { + struct_ser.serialize_field("metadata_matcher", v)?; + } + if self.metadata_source != 0 { + let v = MetadataSource::try_from(self.metadata_source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.metadata_source)))?; + struct_ser.serialize_field("metadata_source", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SourcedMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "metadata_matcher", + "metadataMatcher", + "metadata_source", + "metadataSource", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MetadataMatcher, + MetadataSource, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "metadataMatcher" | "metadata_matcher" => Ok(GeneratedField::MetadataMatcher), + "metadataSource" | "metadata_source" => Ok(GeneratedField::MetadataSource), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SourcedMetadata; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.rbac.v3.SourcedMetadata") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut metadata_matcher__ = None; + let mut metadata_source__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MetadataMatcher => { + if metadata_matcher__.is_some() { + return Err(serde::de::Error::duplicate_field("metadataMatcher")); + } + metadata_matcher__ = map_.next_value()?; + } + GeneratedField::MetadataSource => { + if metadata_source__.is_some() { + return Err(serde::de::Error::duplicate_field("metadataSource")); + } + metadata_source__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(SourcedMetadata { + metadata_matcher: metadata_matcher__, + metadata_source: metadata_source__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.rbac.v3.SourcedMetadata", FIELDS, GeneratedVisitor) + } +} diff --git a/src/generated/envoy.config.route.v3.rs b/src/generated/envoy.config.route.v3.rs index 5755b97..4c4fbf5 100644 --- a/src/generated/envoy.config.route.v3.rs +++ b/src/generated/envoy.config.route.v3.rs @@ -36,7 +36,6 @@ pub struct VirtualHost { /// Only one of this and ``matcher`` can be specified. #[prost(message, repeated, tag = "3")] pub routes: ::prost::alloc::vec::Vec, - /// \[#next-major-version: This should be included in a oneof with routes wrapped in a message.\] /// The match tree to use when resolving route actions for incoming requests. Only one of this and ``routes`` /// can be specified. #[prost(message, optional, tag = "21")] @@ -589,6 +588,8 @@ impl ::prost::Name for WeightedCluster { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClusterSpecifierPlugin { /// The name of the plugin and its opaque configuration. + /// + /// \[#extension-category: envoy.router.cluster_specifier_plugin\] #[prost(message, optional, tag = "1")] pub extension: ::core::option::Option, /// If is_optional is not set or is set to false and the plugin defined by this message is not a @@ -609,7 +610,7 @@ impl ::prost::Name for ClusterSpecifierPlugin { "type.googleapis.com/envoy.config.route.v3.ClusterSpecifierPlugin".into() } } -/// \[#next-free-field: 16\] +/// \[#next-free-field: 17\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RouteMatch { /// Indicates that prefix/path matching should be case sensitive. The default @@ -680,6 +681,14 @@ pub struct RouteMatch { pub dynamic_metadata: ::prost::alloc::vec::Vec< super::super::super::r#type::matcher::v3::MetadataMatcher, >, + /// Specifies a set of filter state matchers on which the route should match. + /// The router will check the filter state against all the specified filter state matchers. + /// If the number of specified filter state matchers is nonzero, they all must match the + /// filter state for a match to occur. + #[prost(message, repeated, tag = "16")] + pub filter_state: ::prost::alloc::vec::Vec< + super::super::super::r#type::matcher::v3::FilterStateMatcher, + >, #[prost(oneof = "route_match::PathSpecifier", tags = "1, 2, 10, 12, 14, 15")] pub path_specifier: ::core::option::Option, } @@ -1183,6 +1192,18 @@ pub struct RouteAction { pub max_stream_duration: ::core::option::Option, #[prost(oneof = "route_action::ClusterSpecifier", tags = "1, 2, 3, 37, 39")] pub cluster_specifier: ::core::option::Option, + /// If one of the host rewrite specifiers is set and the + /// :ref:`suppress_envoy_headers + /// ` flag is not + /// set to true, the router filter will place the original host header value before + /// rewriting into the :ref:`x-envoy-original-host + /// ` header. + /// + /// And if the + /// :ref:`append_x_forwarded_host ` + /// is set to true, the original host value will also be appended to the + /// :ref:`config_http_conn_man_headers_x-forwarded-host` header. + /// #[prost(oneof = "route_action::HostRewriteSpecifier", tags = "6, 7, 29, 35")] pub host_rewrite_specifier: ::core::option::Option< route_action::HostRewriteSpecifier, @@ -1243,7 +1264,10 @@ pub mod route_action { pub runtime_fraction: ::core::option::Option< super::super::super::core::v3::RuntimeFractionalPercent, >, - /// Determines if the trace span should be sampled. Defaults to true. + /// Specifies whether the trace span for the shadow request should be sampled. If this field is not explicitly set, + /// the shadow request will inherit the sampling decision of its parent span. This ensures consistency with the trace + /// sampling policy of the original request and prevents oversampling, especially in scenarios where runtime sampling + /// is disabled. #[prost(message, optional, tag = "4")] pub trace_sampled: ::core::option::Option< super::super::super::super::super::google::protobuf::BoolValue, @@ -1699,13 +1723,22 @@ pub mod route_action { #[prost(message, tag = "39")] InlineClusterSpecifierPlugin(super::ClusterSpecifierPlugin), } + /// If one of the host rewrite specifiers is set and the + /// :ref:`suppress_envoy_headers + /// ` flag is not + /// set to true, the router filter will place the original host header value before + /// rewriting into the :ref:`x-envoy-original-host + /// ` header. + /// + /// And if the + /// :ref:`append_x_forwarded_host ` + /// is set to true, the original host value will also be appended to the + /// :ref:`config_http_conn_man_headers_x-forwarded-host` header. + /// #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum HostRewriteSpecifier { /// Indicates that during forwarding, the host header will be swapped with - /// this value. Using this option will append the - /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if - /// :ref:`append_x_forwarded_host ` - /// is set. + /// this value. #[prost(string, tag = "6")] HostRewriteLiteral(::prost::alloc::string::String), /// Indicates that during forwarding, the host header will be swapped with @@ -1714,18 +1747,12 @@ pub mod route_action { /// type ``strict_dns`` or ``logical_dns``, /// or when :ref:`hostname ` /// field is not empty. Setting this to true with other cluster types - /// has no effect. Using this option will append the - /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if - /// :ref:`append_x_forwarded_host ` - /// is set. + /// has no effect. #[prost(message, tag = "7")] AutoHostRewrite(super::super::super::super::super::google::protobuf::BoolValue), /// Indicates that during forwarding, the host header will be swapped with the content of given /// downstream or :ref:`custom ` header. - /// If header value is empty, host header is left intact. Using this option will append the - /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if - /// :ref:`append_x_forwarded_host ` - /// is set. + /// If header value is empty, host header is left intact. /// /// .. attention:: /// @@ -1740,10 +1767,6 @@ pub mod route_action { /// Indicates that during forwarding, the host header will be swapped with /// the result of the regex substitution executed on path value with query and fragment removed. /// This is useful for transitioning variable content between path segment and subdomain. - /// Using this option will append the - /// :ref:`config_http_conn_man_headers_x-forwarded-host` header if - /// :ref:`append_x_forwarded_host ` - /// is set. /// /// For example with the following config: /// @@ -2479,6 +2502,7 @@ impl ::prost::Name for VirtualCluster { } /// Global rate limiting :ref:`architecture overview `. /// Also applies to Local rate limiting :ref:`using descriptors `. +/// \[#next-free-field: 7\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RateLimit { /// Refers to the stage set in the filter. The rate limit configuration only @@ -2488,11 +2512,21 @@ pub struct RateLimit { /// .. note:: /// /// The filter supports a range of 0 - 10 inclusively for stage numbers. + /// + /// .. note:: + /// This is not supported if the rate limit action is configured in the ``typed_per_filter_config`` like + /// :ref:`VirtualHost.typed_per_filter_config` or + /// :ref:`Route.typed_per_filter_config`, etc. #[prost(message, optional, tag = "1")] pub stage: ::core::option::Option< super::super::super::super::google::protobuf::UInt32Value, >, /// The key to be set in runtime to disable this rate limit configuration. + /// + /// .. note:: + /// This is not supported if the rate limit action is configured in the ``typed_per_filter_config`` like + /// :ref:`VirtualHost.typed_per_filter_config` or + /// :ref:`Route.typed_per_filter_config`, etc. #[prost(string, tag = "2")] pub disable_key: ::prost::alloc::string::String, /// A list of actions that are to be applied for this rate limit configuration. @@ -2507,17 +2541,48 @@ pub struct RateLimit { /// rate limit configuration. If the override value is invalid or cannot be resolved /// from metadata, no override is provided. See :ref:`rate limit override /// ` for more information. + /// + /// .. note:: + /// This is not supported if the rate limit action is configured in the ``typed_per_filter_config`` like + /// :ref:`VirtualHost.typed_per_filter_config` or + /// :ref:`Route.typed_per_filter_config`, etc. #[prost(message, optional, tag = "4")] pub limit: ::core::option::Option, + /// An optional hits addend to be appended to the descriptor produced by this rate limit + /// configuration. + /// + /// .. note:: + /// This is only supported if the rate limit action is configured in the ``typed_per_filter_config`` like + /// :ref:`VirtualHost.typed_per_filter_config` or + /// :ref:`Route.typed_per_filter_config`, etc. + #[prost(message, optional, tag = "5")] + pub hits_addend: ::core::option::Option, + /// If true, the rate limit request will be applied when the stream completes. The default value is false. + /// This is useful when the rate limit budget needs to reflect the response context that is not available + /// on the request path. + /// + /// For example, let's say the upstream service calculates the usage statistics and returns them in the response body + /// and we want to utilize these numbers to apply the rate limit action for the subsequent requests. + /// Combined with another filter that can set the desired addend based on the response (e.g. Lua filter), + /// this can be used to subtract the usage statistics from the rate limit budget. + /// + /// A rate limit applied on the stream completion is "fire-and-forget" by nature, and rate limit is not enforced by this config. + /// In other words, the current request won't be blocked when this is true, but the budget will be updated for the subsequent + /// requests based on the action with this field set to true. Users should ensure that the rate limit is enforced by the actions + /// applied on the request path, i.e. the ones with this field set to false. + /// + /// Currently, this is only supported by the HTTP global rate filter. + #[prost(bool, tag = "6")] + pub apply_on_stream_done: bool, } /// Nested message and enum types in `RateLimit`. pub mod rate_limit { - /// \[#next-free-field: 12\] + /// \[#next-free-field: 13\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Action { #[prost( oneof = "action::ActionSpecifier", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11" + tags = "1, 2, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11" )] pub action_specifier: ::core::option::Option, } @@ -2588,9 +2653,18 @@ pub mod rate_limit { /// The key to use in the descriptor entry. #[prost(string, tag = "2")] pub descriptor_key: ::prost::alloc::string::String, - /// If set to true, Envoy skips the descriptor while calling rate limiting service - /// when header is not present in the request. By default it skips calling the - /// rate limiting service if this header is not present in the request. + /// Controls the behavior when the specified header is not present in the request. + /// + /// If set to ``false`` (default): + /// + /// * Envoy does **NOT** call the rate limiting service for this descriptor. + /// * Useful if the header is optional and you prefer to skip rate limiting when it's absent. + /// + /// If set to ``true``: + /// + /// * Envoy calls the rate limiting service but omits this descriptor if the header is missing. + /// * Useful if you want Envoy to enforce rate limiting even when the header is not present. + /// #[prost(bool, tag = "3")] pub skip_if_absent: bool, } @@ -2605,6 +2679,48 @@ pub mod rate_limit { .into() } } + /// The following descriptor entry is appended when a query parameter contains a key that matches the + /// ``query_parameter_name``: + /// + /// .. code-block:: cpp + /// + /// ("", "") + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct QueryParameters { + /// The name of the query parameter to use for rate limiting. Value of this query parameter is used to populate + /// the value of the descriptor entry for the descriptor_key. + #[prost(string, tag = "1")] + pub query_parameter_name: ::prost::alloc::string::String, + /// The key to use when creating the rate limit descriptor entry. his descriptor key will be used to identify the + /// rate limit rule in the rate limiting service. + #[prost(string, tag = "2")] + pub descriptor_key: ::prost::alloc::string::String, + /// Controls the behavior when the specified query parameter is not present in the request. + /// + /// If set to ``false`` (default): + /// + /// * Envoy does **NOT** call the rate limiting service for this descriptor. + /// * Useful if the query parameter is optional and you prefer to skip rate limiting when it's absent. + /// + /// If set to ``true``: + /// + /// * Envoy calls the rate limiting service but omits this descriptor if the query parameter is missing. + /// * Useful if you want Envoy to enforce rate limiting even when the query parameter is not present. + /// + #[prost(bool, tag = "3")] + pub skip_if_absent: bool, + } + impl ::prost::Name for QueryParameters { + const NAME: &'static str = "QueryParameters"; + const PACKAGE: &'static str = "envoy.config.route.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.route.v3.RateLimit.Action.QueryParameters".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.route.v3.RateLimit.Action.QueryParameters" + .into() + } + } /// The following descriptor entry is appended to the descriptor and is populated using the /// trusted address from :ref:`x-forwarded-for `: /// @@ -2789,9 +2905,19 @@ pub mod rate_limit { /// Source of metadata #[prost(enumeration = "meta_data::Source", tag = "4")] pub source: i32, - /// If set to true, Envoy skips the descriptor while calling rate limiting service - /// when ``metadata_key`` is empty and ``default_value`` is not set. By default it skips calling the - /// rate limiting service in that case. + /// Controls the behavior when the specified ``metadata_key`` is empty and ``default_value`` is not set. + /// + /// If set to ``false`` (default): + /// + /// * Envoy does **NOT** call the rate limiting service for this descriptor. + /// * Useful if the metadata is optional and you prefer to skip rate limiting when it's absent. + /// + /// If set to ``true``: + /// + /// * Envoy calls the rate limiting service but omits this descriptor if the ``metadata_key`` is empty and + /// ``default_value`` is missing. + /// * Useful if you want Envoy to enforce rate limiting even when the metadata is not present. + /// #[prost(bool, tag = "5")] pub skip_if_absent: bool, } @@ -2900,6 +3026,9 @@ pub mod rate_limit { /// Rate limit on request headers. #[prost(message, tag = "3")] RequestHeaders(RequestHeaders), + /// Rate limit on query parameters. + #[prost(message, tag = "12")] + QueryParameters(QueryParameters), /// Rate limit on remote address. #[prost(message, tag = "4")] RemoteAddress(RemoteAddress), @@ -2993,6 +3122,46 @@ pub mod rate_limit { "type.googleapis.com/envoy.config.route.v3.RateLimit.Override".into() } } + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct HitsAddend { + /// Fixed number of hits to add to the rate limit descriptor. + /// + /// One of the ``number`` or ``format`` fields should be set but not both. + #[prost(message, optional, tag = "1")] + pub number: ::core::option::Option< + super::super::super::super::super::google::protobuf::UInt64Value, + >, + /// Substitution format string to extract the number of hits to add to the rate limit descriptor. + /// The same :ref:`format specifier ` as used for + /// :ref:`HTTP access logging ` applies here. + /// + /// .. note:: + /// + /// The format string must contains only single valid substitution field. If the format string + /// not meets the requirement, the configuration will be rejected. + /// + /// The substitution field should generates a non-negative number or string representation of + /// a non-negative number. The value of the non-negative number should be less than or equal + /// to 1000000000 like the ``number`` field. If the output of the substitution field not meet + /// the requirement, this will be treated as an error and the current descriptor will be ignored. + /// + /// For example, the ``%BYTES_RECEIVED%`` format string will be replaced with the number of bytes + /// received in the request. + /// + /// One of the ``number`` or ``format`` fields should be set but not both. + #[prost(string, tag = "2")] + pub format: ::prost::alloc::string::String, + } + impl ::prost::Name for HitsAddend { + const NAME: &'static str = "HitsAddend"; + const PACKAGE: &'static str = "envoy.config.route.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.route.v3.RateLimit.HitsAddend".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.route.v3.RateLimit.HitsAddend".into() + } + } } impl ::prost::Name for RateLimit { const NAME: &'static str = "RateLimit"; diff --git a/src/generated/envoy.config.route.v3.serde.rs b/src/generated/envoy.config.route.v3.serde.rs index 7984582..4144c4f 100644 --- a/src/generated/envoy.config.route.v3.serde.rs +++ b/src/generated/envoy.config.route.v3.serde.rs @@ -1556,6 +1556,12 @@ impl serde::Serialize for RateLimit { if self.limit.is_some() { len += 1; } + if self.hits_addend.is_some() { + len += 1; + } + if self.apply_on_stream_done { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.route.v3.RateLimit", len)?; if let Some(v) = self.stage.as_ref() { struct_ser.serialize_field("stage", v)?; @@ -1569,6 +1575,12 @@ impl serde::Serialize for RateLimit { if let Some(v) = self.limit.as_ref() { struct_ser.serialize_field("limit", v)?; } + if let Some(v) = self.hits_addend.as_ref() { + struct_ser.serialize_field("hits_addend", v)?; + } + if self.apply_on_stream_done { + struct_ser.serialize_field("apply_on_stream_done", &self.apply_on_stream_done)?; + } struct_ser.end() } } @@ -1584,6 +1596,10 @@ impl<'de> serde::Deserialize<'de> for RateLimit { "disableKey", "actions", "limit", + "hits_addend", + "hitsAddend", + "apply_on_stream_done", + "applyOnStreamDone", ]; #[allow(clippy::enum_variant_names)] @@ -1592,6 +1608,8 @@ impl<'de> serde::Deserialize<'de> for RateLimit { DisableKey, Actions, Limit, + HitsAddend, + ApplyOnStreamDone, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1617,6 +1635,8 @@ impl<'de> serde::Deserialize<'de> for RateLimit { "disableKey" | "disable_key" => Ok(GeneratedField::DisableKey), "actions" => Ok(GeneratedField::Actions), "limit" => Ok(GeneratedField::Limit), + "hitsAddend" | "hits_addend" => Ok(GeneratedField::HitsAddend), + "applyOnStreamDone" | "apply_on_stream_done" => Ok(GeneratedField::ApplyOnStreamDone), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1640,6 +1660,8 @@ impl<'de> serde::Deserialize<'de> for RateLimit { let mut disable_key__ = None; let mut actions__ = None; let mut limit__ = None; + let mut hits_addend__ = None; + let mut apply_on_stream_done__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Stage => { @@ -1666,6 +1688,18 @@ impl<'de> serde::Deserialize<'de> for RateLimit { } limit__ = map_.next_value()?; } + GeneratedField::HitsAddend => { + if hits_addend__.is_some() { + return Err(serde::de::Error::duplicate_field("hitsAddend")); + } + hits_addend__ = map_.next_value()?; + } + GeneratedField::ApplyOnStreamDone => { + if apply_on_stream_done__.is_some() { + return Err(serde::de::Error::duplicate_field("applyOnStreamDone")); + } + apply_on_stream_done__ = Some(map_.next_value()?); + } } } Ok(RateLimit { @@ -1673,6 +1707,8 @@ impl<'de> serde::Deserialize<'de> for RateLimit { disable_key: disable_key__.unwrap_or_default(), actions: actions__.unwrap_or_default(), limit: limit__, + hits_addend: hits_addend__, + apply_on_stream_done: apply_on_stream_done__.unwrap_or_default(), }) } } @@ -1702,6 +1738,9 @@ impl serde::Serialize for rate_limit::Action { rate_limit::action::ActionSpecifier::RequestHeaders(v) => { struct_ser.serialize_field("request_headers", v)?; } + rate_limit::action::ActionSpecifier::QueryParameters(v) => { + struct_ser.serialize_field("query_parameters", v)?; + } rate_limit::action::ActionSpecifier::RemoteAddress(v) => { struct_ser.serialize_field("remote_address", v)?; } @@ -1744,6 +1783,8 @@ impl<'de> serde::Deserialize<'de> for rate_limit::Action { "destinationCluster", "request_headers", "requestHeaders", + "query_parameters", + "queryParameters", "remote_address", "remoteAddress", "generic_key", @@ -1765,6 +1806,7 @@ impl<'de> serde::Deserialize<'de> for rate_limit::Action { SourceCluster, DestinationCluster, RequestHeaders, + QueryParameters, RemoteAddress, GenericKey, HeaderValueMatch, @@ -1797,6 +1839,7 @@ impl<'de> serde::Deserialize<'de> for rate_limit::Action { "sourceCluster" | "source_cluster" => Ok(GeneratedField::SourceCluster), "destinationCluster" | "destination_cluster" => Ok(GeneratedField::DestinationCluster), "requestHeaders" | "request_headers" => Ok(GeneratedField::RequestHeaders), + "queryParameters" | "query_parameters" => Ok(GeneratedField::QueryParameters), "remoteAddress" | "remote_address" => Ok(GeneratedField::RemoteAddress), "genericKey" | "generic_key" => Ok(GeneratedField::GenericKey), "headerValueMatch" | "header_value_match" => Ok(GeneratedField::HeaderValueMatch), @@ -1846,6 +1889,13 @@ impl<'de> serde::Deserialize<'de> for rate_limit::Action { return Err(serde::de::Error::duplicate_field("requestHeaders")); } action_specifier__ = map_.next_value::<::std::option::Option<_>>()?.map(rate_limit::action::ActionSpecifier::RequestHeaders) +; + } + GeneratedField::QueryParameters => { + if action_specifier__.is_some() { + return Err(serde::de::Error::duplicate_field("queryParameters")); + } + action_specifier__ = map_.next_value::<::std::option::Option<_>>()?.map(rate_limit::action::ActionSpecifier::QueryParameters) ; } GeneratedField::RemoteAddress => { @@ -2860,6 +2910,134 @@ impl<'de> serde::Deserialize<'de> for rate_limit::action::QueryParameterValueMat deserializer.deserialize_struct("envoy.config.route.v3.RateLimit.Action.QueryParameterValueMatch", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for rate_limit::action::QueryParameters { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.query_parameter_name.is_empty() { + len += 1; + } + if !self.descriptor_key.is_empty() { + len += 1; + } + if self.skip_if_absent { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.route.v3.RateLimit.Action.QueryParameters", len)?; + if !self.query_parameter_name.is_empty() { + struct_ser.serialize_field("query_parameter_name", &self.query_parameter_name)?; + } + if !self.descriptor_key.is_empty() { + struct_ser.serialize_field("descriptor_key", &self.descriptor_key)?; + } + if self.skip_if_absent { + struct_ser.serialize_field("skip_if_absent", &self.skip_if_absent)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for rate_limit::action::QueryParameters { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "query_parameter_name", + "queryParameterName", + "descriptor_key", + "descriptorKey", + "skip_if_absent", + "skipIfAbsent", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + QueryParameterName, + DescriptorKey, + SkipIfAbsent, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "queryParameterName" | "query_parameter_name" => Ok(GeneratedField::QueryParameterName), + "descriptorKey" | "descriptor_key" => Ok(GeneratedField::DescriptorKey), + "skipIfAbsent" | "skip_if_absent" => Ok(GeneratedField::SkipIfAbsent), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = rate_limit::action::QueryParameters; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.route.v3.RateLimit.Action.QueryParameters") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut query_parameter_name__ = None; + let mut descriptor_key__ = None; + let mut skip_if_absent__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::QueryParameterName => { + if query_parameter_name__.is_some() { + return Err(serde::de::Error::duplicate_field("queryParameterName")); + } + query_parameter_name__ = Some(map_.next_value()?); + } + GeneratedField::DescriptorKey => { + if descriptor_key__.is_some() { + return Err(serde::de::Error::duplicate_field("descriptorKey")); + } + descriptor_key__ = Some(map_.next_value()?); + } + GeneratedField::SkipIfAbsent => { + if skip_if_absent__.is_some() { + return Err(serde::de::Error::duplicate_field("skipIfAbsent")); + } + skip_if_absent__ = Some(map_.next_value()?); + } + } + } + Ok(rate_limit::action::QueryParameters { + query_parameter_name: query_parameter_name__.unwrap_or_default(), + descriptor_key: descriptor_key__.unwrap_or_default(), + skip_if_absent: skip_if_absent__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.route.v3.RateLimit.Action.QueryParameters", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for rate_limit::action::RemoteAddress { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -3130,6 +3308,114 @@ impl<'de> serde::Deserialize<'de> for rate_limit::action::SourceCluster { deserializer.deserialize_struct("envoy.config.route.v3.RateLimit.Action.SourceCluster", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for rate_limit::HitsAddend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.number.is_some() { + len += 1; + } + if !self.format.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.route.v3.RateLimit.HitsAddend", len)?; + if let Some(v) = self.number.as_ref() { + struct_ser.serialize_field("number", v)?; + } + if !self.format.is_empty() { + struct_ser.serialize_field("format", &self.format)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for rate_limit::HitsAddend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "number", + "format", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Number, + Format, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "number" => Ok(GeneratedField::Number), + "format" => Ok(GeneratedField::Format), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = rate_limit::HitsAddend; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.route.v3.RateLimit.HitsAddend") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut number__ = None; + let mut format__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Number => { + if number__.is_some() { + return Err(serde::de::Error::duplicate_field("number")); + } + number__ = map_.next_value()?; + } + GeneratedField::Format => { + if format__.is_some() { + return Err(serde::de::Error::duplicate_field("format")); + } + format__ = Some(map_.next_value()?); + } + } + } + Ok(rate_limit::HitsAddend { + number: number__, + format: format__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.config.route.v3.RateLimit.HitsAddend", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for rate_limit::Override { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -7580,6 +7866,9 @@ impl serde::Serialize for RouteMatch { if !self.dynamic_metadata.is_empty() { len += 1; } + if !self.filter_state.is_empty() { + len += 1; + } if self.path_specifier.is_some() { len += 1; } @@ -7605,6 +7894,9 @@ impl serde::Serialize for RouteMatch { if !self.dynamic_metadata.is_empty() { struct_ser.serialize_field("dynamic_metadata", &self.dynamic_metadata)?; } + if !self.filter_state.is_empty() { + struct_ser.serialize_field("filter_state", &self.filter_state)?; + } if let Some(v) = self.path_specifier.as_ref() { match v { route_match::PathSpecifier::Prefix(v) => { @@ -7649,6 +7941,8 @@ impl<'de> serde::Deserialize<'de> for RouteMatch { "tlsContext", "dynamic_metadata", "dynamicMetadata", + "filter_state", + "filterState", "prefix", "path", "safe_regex", @@ -7670,6 +7964,7 @@ impl<'de> serde::Deserialize<'de> for RouteMatch { Grpc, TlsContext, DynamicMetadata, + FilterState, Prefix, Path, SafeRegex, @@ -7704,6 +7999,7 @@ impl<'de> serde::Deserialize<'de> for RouteMatch { "grpc" => Ok(GeneratedField::Grpc), "tlsContext" | "tls_context" => Ok(GeneratedField::TlsContext), "dynamicMetadata" | "dynamic_metadata" => Ok(GeneratedField::DynamicMetadata), + "filterState" | "filter_state" => Ok(GeneratedField::FilterState), "prefix" => Ok(GeneratedField::Prefix), "path" => Ok(GeneratedField::Path), "safeRegex" | "safe_regex" => Ok(GeneratedField::SafeRegex), @@ -7736,6 +8032,7 @@ impl<'de> serde::Deserialize<'de> for RouteMatch { let mut grpc__ = None; let mut tls_context__ = None; let mut dynamic_metadata__ = None; + let mut filter_state__ = None; let mut path_specifier__ = None; while let Some(k) = map_.next_key()? { match k { @@ -7781,6 +8078,12 @@ impl<'de> serde::Deserialize<'de> for RouteMatch { } dynamic_metadata__ = Some(map_.next_value()?); } + GeneratedField::FilterState => { + if filter_state__.is_some() { + return Err(serde::de::Error::duplicate_field("filterState")); + } + filter_state__ = Some(map_.next_value()?); + } GeneratedField::Prefix => { if path_specifier__.is_some() { return Err(serde::de::Error::duplicate_field("prefix")); @@ -7830,6 +8133,7 @@ impl<'de> serde::Deserialize<'de> for RouteMatch { grpc: grpc__, tls_context: tls_context__, dynamic_metadata: dynamic_metadata__.unwrap_or_default(), + filter_state: filter_state__.unwrap_or_default(), path_specifier: path_specifier__, }) } diff --git a/src/generated/envoy.config.tap.v3.rs b/src/generated/envoy.config.tap.v3.rs index 0ea127a..d70bd1b 100644 --- a/src/generated/envoy.config.tap.v3.rs +++ b/src/generated/envoy.config.tap.v3.rs @@ -199,6 +199,7 @@ impl ::prost::Name for HttpGenericBodyMatch { } } /// Tap output configuration. +/// \[#next-free-field: 6\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutputConfig { /// Output sinks for tap data. Currently a single sink is allowed in the list. Once multiple @@ -229,6 +230,14 @@ pub struct OutputConfig { /// ` documentation for more information. #[prost(bool, tag = "4")] pub streaming: bool, + /// Tapped messages will be sent on each read/write event for streamed tapping by default. + /// But this behavior could be controlled by setting this field. + /// If set then the tapped messages will be send once the threshold is reached. + /// This could be used to avoid high frequent sending. + #[prost(message, optional, tag = "5")] + pub min_streamed_sent_bytes: ::core::option::Option< + super::super::super::super::google::protobuf::UInt32Value, + >, } impl ::prost::Name for OutputConfig { const NAME: &'static str = "OutputConfig"; diff --git a/src/generated/envoy.config.tap.v3.serde.rs b/src/generated/envoy.config.tap.v3.serde.rs index 78be284..274f149 100644 --- a/src/generated/envoy.config.tap.v3.serde.rs +++ b/src/generated/envoy.config.tap.v3.serde.rs @@ -849,6 +849,9 @@ impl serde::Serialize for OutputConfig { if self.streaming { len += 1; } + if self.min_streamed_sent_bytes.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.tap.v3.OutputConfig", len)?; if !self.sinks.is_empty() { struct_ser.serialize_field("sinks", &self.sinks)?; @@ -862,6 +865,9 @@ impl serde::Serialize for OutputConfig { if self.streaming { struct_ser.serialize_field("streaming", &self.streaming)?; } + if let Some(v) = self.min_streamed_sent_bytes.as_ref() { + struct_ser.serialize_field("min_streamed_sent_bytes", v)?; + } struct_ser.end() } } @@ -878,6 +884,8 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { "max_buffered_tx_bytes", "maxBufferedTxBytes", "streaming", + "min_streamed_sent_bytes", + "minStreamedSentBytes", ]; #[allow(clippy::enum_variant_names)] @@ -886,6 +894,7 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { MaxBufferedRxBytes, MaxBufferedTxBytes, Streaming, + MinStreamedSentBytes, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -911,6 +920,7 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { "maxBufferedRxBytes" | "max_buffered_rx_bytes" => Ok(GeneratedField::MaxBufferedRxBytes), "maxBufferedTxBytes" | "max_buffered_tx_bytes" => Ok(GeneratedField::MaxBufferedTxBytes), "streaming" => Ok(GeneratedField::Streaming), + "minStreamedSentBytes" | "min_streamed_sent_bytes" => Ok(GeneratedField::MinStreamedSentBytes), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -934,6 +944,7 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { let mut max_buffered_rx_bytes__ = None; let mut max_buffered_tx_bytes__ = None; let mut streaming__ = None; + let mut min_streamed_sent_bytes__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Sinks => { @@ -960,6 +971,12 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { } streaming__ = Some(map_.next_value()?); } + GeneratedField::MinStreamedSentBytes => { + if min_streamed_sent_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("minStreamedSentBytes")); + } + min_streamed_sent_bytes__ = map_.next_value()?; + } } } Ok(OutputConfig { @@ -967,6 +984,7 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { max_buffered_rx_bytes: max_buffered_rx_bytes__, max_buffered_tx_bytes: max_buffered_tx_bytes__, streaming: streaming__.unwrap_or_default(), + min_streamed_sent_bytes: min_streamed_sent_bytes__, }) } } diff --git a/src/generated/envoy.config.trace.v3.rs b/src/generated/envoy.config.trace.v3.rs index a4873f0..fcd74b9 100644 --- a/src/generated/envoy.config.trace.v3.rs +++ b/src/generated/envoy.config.trace.v3.rs @@ -65,6 +65,26 @@ impl ::prost::Name for Tracing { "type.googleapis.com/envoy.config.trace.v3.Tracing".into() } } +/// Configuration for the Remote Configuration feature. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct DatadogRemoteConfig { + /// Frequency at which new configuration updates are queried. + /// If no value is provided, the default value is delegated to the Datadog tracing library. + #[prost(message, optional, tag = "1")] + pub polling_interval: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, +} +impl ::prost::Name for DatadogRemoteConfig { + const NAME: &'static str = "DatadogRemoteConfig"; + const PACKAGE: &'static str = "envoy.config.trace.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.config.trace.v3.DatadogRemoteConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.config.trace.v3.DatadogRemoteConfig".into() + } +} /// Configuration for the Datadog tracer. /// \[#extension: envoy.tracers.datadog\] #[derive(Clone, PartialEq, ::prost::Message)] @@ -79,6 +99,13 @@ pub struct DatadogConfig { /// that require a specific hostname. Defaults to :ref:`collector_cluster ` above. #[prost(string, tag = "3")] pub collector_hostname: ::prost::alloc::string::String, + /// Enables and configures remote configuration. + /// Remote Configuration allows to configure the tracer from Datadog's user interface. + /// This feature can drastically increase the number of connections to the Datadog Agent. + /// Each tracer regularly polls for configuration updates, and the number of tracers is the product + /// of the number of listeners and worker threads. + #[prost(message, optional, tag = "4")] + pub remote_config: ::core::option::Option, } impl ::prost::Name for DatadogConfig { const NAME: &'static str = "DatadogConfig"; @@ -90,10 +117,10 @@ impl ::prost::Name for DatadogConfig { "type.googleapis.com/envoy.config.trace.v3.DatadogConfig".into() } } -/// DynamicOtConfig is used to dynamically load a tracer from a shared library +/// DynamicOtConfig was used to dynamically load a tracer from a shared library /// that implements the `OpenTracing dynamic loading API /// <`_.> -/// \[#extension: envoy.tracers.dynamic_ot\] +/// \[#not-implemented-hide:\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DynamicOtConfig { /// Dynamic library implementing the `OpenTracing API @@ -204,162 +231,9 @@ impl ::prost::Name for LightstepConfig { "type.googleapis.com/envoy.config.trace.v3.LightstepConfig".into() } } -/// Configuration for the OpenCensus tracer. -/// \[#next-free-field: 15\] -/// \[#extension: envoy.tracers.opencensus\] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct OpenCensusConfig { - /// Configures tracing, e.g. the sampler, max number of annotations, etc. - #[deprecated] - #[prost(message, optional, tag = "1")] - pub trace_config: ::core::option::Option< - super::super::super::super::opencensus::proto::trace::v1::TraceConfig, - >, - /// Enables the stdout exporter if set to true. This is intended for debugging - /// purposes. - #[deprecated] - #[prost(bool, tag = "2")] - pub stdout_exporter_enabled: bool, - /// Enables the Stackdriver exporter if set to true. The project_id must also - /// be set. - #[deprecated] - #[prost(bool, tag = "3")] - pub stackdriver_exporter_enabled: bool, - /// The Cloud project_id to use for Stackdriver tracing. - #[deprecated] - #[prost(string, tag = "4")] - pub stackdriver_project_id: ::prost::alloc::string::String, - /// (optional) By default, the Stackdriver exporter will connect to production - /// Stackdriver. If stackdriver_address is non-empty, it will instead connect - /// to this address, which is in the gRPC format: - /// - #[deprecated] - #[prost(string, tag = "10")] - pub stackdriver_address: ::prost::alloc::string::String, - /// (optional) The gRPC server that hosts Stackdriver tracing service. Only - /// Google gRPC is supported. If :ref:`target_uri ` - /// is not provided, the default production Stackdriver address will be used. - #[deprecated] - #[prost(message, optional, tag = "13")] - pub stackdriver_grpc_service: ::core::option::Option< - super::super::core::v3::GrpcService, - >, - /// Enables the Zipkin exporter if set to true. The url and service name must - /// also be set. This is deprecated, prefer to use Envoy's :ref:`native Zipkin - /// tracer `. - #[deprecated] - #[prost(bool, tag = "5")] - pub zipkin_exporter_enabled: bool, - /// The URL to Zipkin, e.g. " This is - /// deprecated, prefer to use Envoy's :ref:`native Zipkin tracer - /// `. - #[deprecated] - #[prost(string, tag = "6")] - pub zipkin_url: ::prost::alloc::string::String, - /// Enables the OpenCensus Agent exporter if set to true. The ocagent_address or - /// ocagent_grpc_service must also be set. - #[deprecated] - #[prost(bool, tag = "11")] - pub ocagent_exporter_enabled: bool, - /// The address of the OpenCensus Agent, if its exporter is enabled, in gRPC - /// format: - /// \[#comment:TODO: deprecate this field\] - #[deprecated] - #[prost(string, tag = "12")] - pub ocagent_address: ::prost::alloc::string::String, - /// (optional) The gRPC server hosted by the OpenCensus Agent. Only Google gRPC is supported. - /// This is only used if the ocagent_address is left empty. - #[deprecated] - #[prost(message, optional, tag = "14")] - pub ocagent_grpc_service: ::core::option::Option< - super::super::core::v3::GrpcService, - >, - /// List of incoming trace context headers we will accept. First one found - /// wins. - #[deprecated] - #[prost( - enumeration = "open_census_config::TraceContext", - repeated, - packed = "false", - tag = "8" - )] - pub incoming_trace_context: ::prost::alloc::vec::Vec, - /// List of outgoing trace context headers we will produce. - #[deprecated] - #[prost( - enumeration = "open_census_config::TraceContext", - repeated, - packed = "false", - tag = "9" - )] - pub outgoing_trace_context: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `OpenCensusConfig`. -pub mod open_census_config { - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum TraceContext { - /// No-op default, no trace context is utilized. - None = 0, - /// W3C Trace-Context format "traceparent:" header. - TraceContext = 1, - /// Binary "grpc-trace-bin:" header. - GrpcTraceBin = 2, - /// "X-Cloud-Trace-Context:" header. - CloudTraceContext = 3, - /// X-B3-* headers. - B3 = 4, - } - impl TraceContext { - /// 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::None => "NONE", - Self::TraceContext => "TRACE_CONTEXT", - Self::GrpcTraceBin => "GRPC_TRACE_BIN", - Self::CloudTraceContext => "CLOUD_TRACE_CONTEXT", - Self::B3 => "B3", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NONE" => Some(Self::None), - "TRACE_CONTEXT" => Some(Self::TraceContext), - "GRPC_TRACE_BIN" => Some(Self::GrpcTraceBin), - "CLOUD_TRACE_CONTEXT" => Some(Self::CloudTraceContext), - "B3" => Some(Self::B3), - _ => None, - } - } - } -} -impl ::prost::Name for OpenCensusConfig { - const NAME: &'static str = "OpenCensusConfig"; - const PACKAGE: &'static str = "envoy.config.trace.v3"; - fn full_name() -> ::prost::alloc::string::String { - "envoy.config.trace.v3.OpenCensusConfig".into() - } - fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.config.trace.v3.OpenCensusConfig".into() - } -} /// Configuration for the OpenTelemetry tracer. /// \[#extension: envoy.tracers.opentelemetry\] -/// \[#next-free-field: 6\] +/// \[#next-free-field: 7\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OpenTelemetryConfig { /// The upstream gRPC cluster that will receive OTLP traces. @@ -399,6 +273,13 @@ pub struct OpenTelemetryConfig { /// \[#extension-category: envoy.tracers.opentelemetry.samplers\] #[prost(message, optional, tag = "5")] pub sampler: ::core::option::Option, + /// Envoy caches the span in memory when the OpenTelemetry backend service is temporarily unavailable. + /// This field specifies the maximum number of spans that can be cached. If not specified, the + /// default is 1024. + #[prost(message, optional, tag = "6")] + pub max_cache_size: ::core::option::Option< + super::super::super::super::google::protobuf::UInt32Value, + >, } impl ::prost::Name for OpenTelemetryConfig { const NAME: &'static str = "OpenTelemetryConfig"; diff --git a/src/generated/envoy.config.trace.v3.serde.rs b/src/generated/envoy.config.trace.v3.serde.rs index 2a8c3e1..ed06d45 100644 --- a/src/generated/envoy.config.trace.v3.serde.rs +++ b/src/generated/envoy.config.trace.v3.serde.rs @@ -165,6 +165,9 @@ impl serde::Serialize for DatadogConfig { if !self.collector_hostname.is_empty() { len += 1; } + if self.remote_config.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.trace.v3.DatadogConfig", len)?; if !self.collector_cluster.is_empty() { struct_ser.serialize_field("collector_cluster", &self.collector_cluster)?; @@ -175,6 +178,9 @@ impl serde::Serialize for DatadogConfig { if !self.collector_hostname.is_empty() { struct_ser.serialize_field("collector_hostname", &self.collector_hostname)?; } + if let Some(v) = self.remote_config.as_ref() { + struct_ser.serialize_field("remote_config", v)?; + } struct_ser.end() } } @@ -191,6 +197,8 @@ impl<'de> serde::Deserialize<'de> for DatadogConfig { "serviceName", "collector_hostname", "collectorHostname", + "remote_config", + "remoteConfig", ]; #[allow(clippy::enum_variant_names)] @@ -198,6 +206,7 @@ impl<'de> serde::Deserialize<'de> for DatadogConfig { CollectorCluster, ServiceName, CollectorHostname, + RemoteConfig, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -222,6 +231,7 @@ impl<'de> serde::Deserialize<'de> for DatadogConfig { "collectorCluster" | "collector_cluster" => Ok(GeneratedField::CollectorCluster), "serviceName" | "service_name" => Ok(GeneratedField::ServiceName), "collectorHostname" | "collector_hostname" => Ok(GeneratedField::CollectorHostname), + "remoteConfig" | "remote_config" => Ok(GeneratedField::RemoteConfig), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -244,6 +254,7 @@ impl<'de> serde::Deserialize<'de> for DatadogConfig { let mut collector_cluster__ = None; let mut service_name__ = None; let mut collector_hostname__ = None; + let mut remote_config__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::CollectorCluster => { @@ -264,18 +275,117 @@ impl<'de> serde::Deserialize<'de> for DatadogConfig { } collector_hostname__ = Some(map_.next_value()?); } + GeneratedField::RemoteConfig => { + if remote_config__.is_some() { + return Err(serde::de::Error::duplicate_field("remoteConfig")); + } + remote_config__ = map_.next_value()?; + } } } Ok(DatadogConfig { collector_cluster: collector_cluster__.unwrap_or_default(), service_name: service_name__.unwrap_or_default(), collector_hostname: collector_hostname__.unwrap_or_default(), + remote_config: remote_config__, }) } } deserializer.deserialize_struct("envoy.config.trace.v3.DatadogConfig", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for DatadogRemoteConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.polling_interval.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.config.trace.v3.DatadogRemoteConfig", len)?; + if let Some(v) = self.polling_interval.as_ref() { + struct_ser.serialize_field("polling_interval", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DatadogRemoteConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "polling_interval", + "pollingInterval", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PollingInterval, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "pollingInterval" | "polling_interval" => Ok(GeneratedField::PollingInterval), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DatadogRemoteConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.config.trace.v3.DatadogRemoteConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut polling_interval__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PollingInterval => { + if polling_interval__.is_some() { + return Err(serde::de::Error::duplicate_field("pollingInterval")); + } + polling_interval__ = map_.next_value()?; + } + } + } + Ok(DatadogRemoteConfig { + polling_interval: polling_interval__, + }) + } + } + deserializer.deserialize_struct("envoy.config.trace.v3.DatadogRemoteConfig", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for DynamicOtConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -611,402 +721,6 @@ impl<'de> serde::Deserialize<'de> for lightstep_config::PropagationMode { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for OpenCensusConfig { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.trace_config.is_some() { - len += 1; - } - if self.stdout_exporter_enabled { - len += 1; - } - if self.stackdriver_exporter_enabled { - len += 1; - } - if !self.stackdriver_project_id.is_empty() { - len += 1; - } - if !self.stackdriver_address.is_empty() { - len += 1; - } - if self.stackdriver_grpc_service.is_some() { - len += 1; - } - if self.zipkin_exporter_enabled { - len += 1; - } - if !self.zipkin_url.is_empty() { - len += 1; - } - if self.ocagent_exporter_enabled { - len += 1; - } - if !self.ocagent_address.is_empty() { - len += 1; - } - if self.ocagent_grpc_service.is_some() { - len += 1; - } - if !self.incoming_trace_context.is_empty() { - len += 1; - } - if !self.outgoing_trace_context.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("envoy.config.trace.v3.OpenCensusConfig", len)?; - if let Some(v) = self.trace_config.as_ref() { - struct_ser.serialize_field("trace_config", v)?; - } - if self.stdout_exporter_enabled { - struct_ser.serialize_field("stdout_exporter_enabled", &self.stdout_exporter_enabled)?; - } - if self.stackdriver_exporter_enabled { - struct_ser.serialize_field("stackdriver_exporter_enabled", &self.stackdriver_exporter_enabled)?; - } - if !self.stackdriver_project_id.is_empty() { - struct_ser.serialize_field("stackdriver_project_id", &self.stackdriver_project_id)?; - } - if !self.stackdriver_address.is_empty() { - struct_ser.serialize_field("stackdriver_address", &self.stackdriver_address)?; - } - if let Some(v) = self.stackdriver_grpc_service.as_ref() { - struct_ser.serialize_field("stackdriver_grpc_service", v)?; - } - if self.zipkin_exporter_enabled { - struct_ser.serialize_field("zipkin_exporter_enabled", &self.zipkin_exporter_enabled)?; - } - if !self.zipkin_url.is_empty() { - struct_ser.serialize_field("zipkin_url", &self.zipkin_url)?; - } - if self.ocagent_exporter_enabled { - struct_ser.serialize_field("ocagent_exporter_enabled", &self.ocagent_exporter_enabled)?; - } - if !self.ocagent_address.is_empty() { - struct_ser.serialize_field("ocagent_address", &self.ocagent_address)?; - } - if let Some(v) = self.ocagent_grpc_service.as_ref() { - struct_ser.serialize_field("ocagent_grpc_service", v)?; - } - if !self.incoming_trace_context.is_empty() { - let v = self.incoming_trace_context.iter().cloned().map(|v| { - open_census_config::TraceContext::try_from(v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) - }).collect::, _>>()?; - struct_ser.serialize_field("incoming_trace_context", &v)?; - } - if !self.outgoing_trace_context.is_empty() { - let v = self.outgoing_trace_context.iter().cloned().map(|v| { - open_census_config::TraceContext::try_from(v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) - }).collect::, _>>()?; - struct_ser.serialize_field("outgoing_trace_context", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for OpenCensusConfig { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "trace_config", - "traceConfig", - "stdout_exporter_enabled", - "stdoutExporterEnabled", - "stackdriver_exporter_enabled", - "stackdriverExporterEnabled", - "stackdriver_project_id", - "stackdriverProjectId", - "stackdriver_address", - "stackdriverAddress", - "stackdriver_grpc_service", - "stackdriverGrpcService", - "zipkin_exporter_enabled", - "zipkinExporterEnabled", - "zipkin_url", - "zipkinUrl", - "ocagent_exporter_enabled", - "ocagentExporterEnabled", - "ocagent_address", - "ocagentAddress", - "ocagent_grpc_service", - "ocagentGrpcService", - "incoming_trace_context", - "incomingTraceContext", - "outgoing_trace_context", - "outgoingTraceContext", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TraceConfig, - StdoutExporterEnabled, - StackdriverExporterEnabled, - StackdriverProjectId, - StackdriverAddress, - StackdriverGrpcService, - ZipkinExporterEnabled, - ZipkinUrl, - OcagentExporterEnabled, - OcagentAddress, - OcagentGrpcService, - IncomingTraceContext, - OutgoingTraceContext, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "traceConfig" | "trace_config" => Ok(GeneratedField::TraceConfig), - "stdoutExporterEnabled" | "stdout_exporter_enabled" => Ok(GeneratedField::StdoutExporterEnabled), - "stackdriverExporterEnabled" | "stackdriver_exporter_enabled" => Ok(GeneratedField::StackdriverExporterEnabled), - "stackdriverProjectId" | "stackdriver_project_id" => Ok(GeneratedField::StackdriverProjectId), - "stackdriverAddress" | "stackdriver_address" => Ok(GeneratedField::StackdriverAddress), - "stackdriverGrpcService" | "stackdriver_grpc_service" => Ok(GeneratedField::StackdriverGrpcService), - "zipkinExporterEnabled" | "zipkin_exporter_enabled" => Ok(GeneratedField::ZipkinExporterEnabled), - "zipkinUrl" | "zipkin_url" => Ok(GeneratedField::ZipkinUrl), - "ocagentExporterEnabled" | "ocagent_exporter_enabled" => Ok(GeneratedField::OcagentExporterEnabled), - "ocagentAddress" | "ocagent_address" => Ok(GeneratedField::OcagentAddress), - "ocagentGrpcService" | "ocagent_grpc_service" => Ok(GeneratedField::OcagentGrpcService), - "incomingTraceContext" | "incoming_trace_context" => Ok(GeneratedField::IncomingTraceContext), - "outgoingTraceContext" | "outgoing_trace_context" => Ok(GeneratedField::OutgoingTraceContext), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = OpenCensusConfig; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct envoy.config.trace.v3.OpenCensusConfig") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut trace_config__ = None; - let mut stdout_exporter_enabled__ = None; - let mut stackdriver_exporter_enabled__ = None; - let mut stackdriver_project_id__ = None; - let mut stackdriver_address__ = None; - let mut stackdriver_grpc_service__ = None; - let mut zipkin_exporter_enabled__ = None; - let mut zipkin_url__ = None; - let mut ocagent_exporter_enabled__ = None; - let mut ocagent_address__ = None; - let mut ocagent_grpc_service__ = None; - let mut incoming_trace_context__ = None; - let mut outgoing_trace_context__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::TraceConfig => { - if trace_config__.is_some() { - return Err(serde::de::Error::duplicate_field("traceConfig")); - } - trace_config__ = map_.next_value()?; - } - GeneratedField::StdoutExporterEnabled => { - if stdout_exporter_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("stdoutExporterEnabled")); - } - stdout_exporter_enabled__ = Some(map_.next_value()?); - } - GeneratedField::StackdriverExporterEnabled => { - if stackdriver_exporter_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("stackdriverExporterEnabled")); - } - stackdriver_exporter_enabled__ = Some(map_.next_value()?); - } - GeneratedField::StackdriverProjectId => { - if stackdriver_project_id__.is_some() { - return Err(serde::de::Error::duplicate_field("stackdriverProjectId")); - } - stackdriver_project_id__ = Some(map_.next_value()?); - } - GeneratedField::StackdriverAddress => { - if stackdriver_address__.is_some() { - return Err(serde::de::Error::duplicate_field("stackdriverAddress")); - } - stackdriver_address__ = Some(map_.next_value()?); - } - GeneratedField::StackdriverGrpcService => { - if stackdriver_grpc_service__.is_some() { - return Err(serde::de::Error::duplicate_field("stackdriverGrpcService")); - } - stackdriver_grpc_service__ = map_.next_value()?; - } - GeneratedField::ZipkinExporterEnabled => { - if zipkin_exporter_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("zipkinExporterEnabled")); - } - zipkin_exporter_enabled__ = Some(map_.next_value()?); - } - GeneratedField::ZipkinUrl => { - if zipkin_url__.is_some() { - return Err(serde::de::Error::duplicate_field("zipkinUrl")); - } - zipkin_url__ = Some(map_.next_value()?); - } - GeneratedField::OcagentExporterEnabled => { - if ocagent_exporter_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("ocagentExporterEnabled")); - } - ocagent_exporter_enabled__ = Some(map_.next_value()?); - } - GeneratedField::OcagentAddress => { - if ocagent_address__.is_some() { - return Err(serde::de::Error::duplicate_field("ocagentAddress")); - } - ocagent_address__ = Some(map_.next_value()?); - } - GeneratedField::OcagentGrpcService => { - if ocagent_grpc_service__.is_some() { - return Err(serde::de::Error::duplicate_field("ocagentGrpcService")); - } - ocagent_grpc_service__ = map_.next_value()?; - } - GeneratedField::IncomingTraceContext => { - if incoming_trace_context__.is_some() { - return Err(serde::de::Error::duplicate_field("incomingTraceContext")); - } - incoming_trace_context__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); - } - GeneratedField::OutgoingTraceContext => { - if outgoing_trace_context__.is_some() { - return Err(serde::de::Error::duplicate_field("outgoingTraceContext")); - } - outgoing_trace_context__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); - } - } - } - Ok(OpenCensusConfig { - trace_config: trace_config__, - stdout_exporter_enabled: stdout_exporter_enabled__.unwrap_or_default(), - stackdriver_exporter_enabled: stackdriver_exporter_enabled__.unwrap_or_default(), - stackdriver_project_id: stackdriver_project_id__.unwrap_or_default(), - stackdriver_address: stackdriver_address__.unwrap_or_default(), - stackdriver_grpc_service: stackdriver_grpc_service__, - zipkin_exporter_enabled: zipkin_exporter_enabled__.unwrap_or_default(), - zipkin_url: zipkin_url__.unwrap_or_default(), - ocagent_exporter_enabled: ocagent_exporter_enabled__.unwrap_or_default(), - ocagent_address: ocagent_address__.unwrap_or_default(), - ocagent_grpc_service: ocagent_grpc_service__, - incoming_trace_context: incoming_trace_context__.unwrap_or_default(), - outgoing_trace_context: outgoing_trace_context__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("envoy.config.trace.v3.OpenCensusConfig", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for open_census_config::TraceContext { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::None => "NONE", - Self::TraceContext => "TRACE_CONTEXT", - Self::GrpcTraceBin => "GRPC_TRACE_BIN", - Self::CloudTraceContext => "CLOUD_TRACE_CONTEXT", - Self::B3 => "B3", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for open_census_config::TraceContext { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "NONE", - "TRACE_CONTEXT", - "GRPC_TRACE_BIN", - "CLOUD_TRACE_CONTEXT", - "B3", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = open_census_config::TraceContext; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "NONE" => Ok(open_census_config::TraceContext::None), - "TRACE_CONTEXT" => Ok(open_census_config::TraceContext::TraceContext), - "GRPC_TRACE_BIN" => Ok(open_census_config::TraceContext::GrpcTraceBin), - "CLOUD_TRACE_CONTEXT" => Ok(open_census_config::TraceContext::CloudTraceContext), - "B3" => Ok(open_census_config::TraceContext::B3), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} impl serde::Serialize for OpenTelemetryConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1030,6 +744,9 @@ impl serde::Serialize for OpenTelemetryConfig { if self.sampler.is_some() { len += 1; } + if self.max_cache_size.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.config.trace.v3.OpenTelemetryConfig", len)?; if let Some(v) = self.grpc_service.as_ref() { struct_ser.serialize_field("grpc_service", v)?; @@ -1046,6 +763,9 @@ impl serde::Serialize for OpenTelemetryConfig { if let Some(v) = self.sampler.as_ref() { struct_ser.serialize_field("sampler", v)?; } + if let Some(v) = self.max_cache_size.as_ref() { + struct_ser.serialize_field("max_cache_size", v)?; + } struct_ser.end() } } @@ -1065,6 +785,8 @@ impl<'de> serde::Deserialize<'de> for OpenTelemetryConfig { "resource_detectors", "resourceDetectors", "sampler", + "max_cache_size", + "maxCacheSize", ]; #[allow(clippy::enum_variant_names)] @@ -1074,6 +796,7 @@ impl<'de> serde::Deserialize<'de> for OpenTelemetryConfig { ServiceName, ResourceDetectors, Sampler, + MaxCacheSize, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1100,6 +823,7 @@ impl<'de> serde::Deserialize<'de> for OpenTelemetryConfig { "serviceName" | "service_name" => Ok(GeneratedField::ServiceName), "resourceDetectors" | "resource_detectors" => Ok(GeneratedField::ResourceDetectors), "sampler" => Ok(GeneratedField::Sampler), + "maxCacheSize" | "max_cache_size" => Ok(GeneratedField::MaxCacheSize), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1124,6 +848,7 @@ impl<'de> serde::Deserialize<'de> for OpenTelemetryConfig { let mut service_name__ = None; let mut resource_detectors__ = None; let mut sampler__ = None; + let mut max_cache_size__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::GrpcService => { @@ -1156,6 +881,12 @@ impl<'de> serde::Deserialize<'de> for OpenTelemetryConfig { } sampler__ = map_.next_value()?; } + GeneratedField::MaxCacheSize => { + if max_cache_size__.is_some() { + return Err(serde::de::Error::duplicate_field("maxCacheSize")); + } + max_cache_size__ = map_.next_value()?; + } } } Ok(OpenTelemetryConfig { @@ -1164,6 +895,7 @@ impl<'de> serde::Deserialize<'de> for OpenTelemetryConfig { service_name: service_name__.unwrap_or_default(), resource_detectors: resource_detectors__.unwrap_or_default(), sampler: sampler__, + max_cache_size: max_cache_size__, }) } } diff --git a/src/generated/envoy.data.accesslog.v3.rs b/src/generated/envoy.data.accesslog.v3.rs index a064ad5..5849a0a 100644 --- a/src/generated/envoy.data.accesslog.v3.rs +++ b/src/generated/envoy.data.accesslog.v3.rs @@ -121,8 +121,10 @@ pub struct AccessLogCommon { #[prost(double, tag = "1")] pub sample_rate: f64, /// This field is the remote/origin address on which the request from the user was received. - /// Note: This may not be the physical peer. E.g, if the remote address is inferred from for - /// example the x-forwarder-for header, proxy protocol, etc. + /// + /// .. note:: + /// This may not be the actual peer address. For example, it might be derived from headers like ``x-forwarded-for``, + /// the proxy protocol, or similar sources. #[prost(message, optional, tag = "2")] pub downstream_remote_address: ::core::option::Option< super::super::super::config::core::v3::Address, @@ -132,7 +134,7 @@ pub struct AccessLogCommon { pub downstream_local_address: ::core::option::Option< super::super::super::config::core::v3::Address, >, - /// If the connection is secure,S this field will contain TLS properties. + /// If the connection is secure, this field will contain TLS properties. #[prost(message, optional, tag = "4")] pub tls_properties: ::core::option::Option, /// The time that Envoy started servicing this request. This is effectively the time that the first @@ -148,7 +150,7 @@ pub struct AccessLogCommon { super::super::super::super::google::protobuf::Duration, >, /// Interval between the first downstream byte received and the first upstream byte sent. There may - /// by considerable delta between ``time_to_last_rx_byte`` and this value due to filters. + /// be considerable delta between ``time_to_last_rx_byte`` and this value due to filters. /// Additionally, the same caveats apply as documented in ``time_to_last_downstream_tx_byte`` about /// not accounting for kernel socket buffer time, etc. #[prost(message, optional, tag = "7")] @@ -225,7 +227,7 @@ pub struct AccessLogCommon { /// If upstream connection failed due to transport socket (e.g. TLS handshake), provides the /// failure reason from the transport socket. The format of this field depends on the configured /// upstream transport socket. Common TLS failures are in - /// :ref:`TLS trouble shooting `. + /// :ref:`TLS troubleshooting `. #[prost(string, tag = "18")] pub upstream_transport_failure_reason: ::prost::alloc::string::String, /// The name of the route @@ -247,7 +249,7 @@ pub struct AccessLogCommon { super::super::super::super::google::protobuf::Any, >, /// A list of custom tags, which annotate logs with additional information. - /// To configure this value, users should configure + /// To configure this value, see the documentation for /// :ref:`custom_tags `. #[prost(map = "string, string", tag = "22")] pub custom_tags: ::std::collections::HashMap< @@ -273,40 +275,41 @@ pub struct AccessLogCommon { /// This could be any format string that could be used to identify one stream. #[prost(string, tag = "26")] pub stream_id: ::prost::alloc::string::String, - /// If this log entry is final log entry that flushed after the stream completed or - /// intermediate log entry that flushed periodically during the stream. - /// There may be multiple intermediate log entries and only one final log entry for each - /// long-live stream (TCP connection, long-live HTTP2 stream). - /// And if it is necessary, unique ID or identifier can be added to the log entry - /// :ref:`stream_id ` to - /// correlate all these intermediate log entries and final log entry. + /// Indicates whether this log entry is the final entry (flushed after the stream completed) or an intermediate entry + /// (flushed periodically during the stream). + /// + /// For long-lived streams (e.g., TCP connections or long-lived HTTP/2 streams), there may be multiple intermediate + /// entries and only one final entry. + /// + /// If needed, a unique identifier (see :ref:`stream_id `) + /// can be used to correlate all intermediate and final log entries for the same stream. /// /// .. attention:: /// - /// This field is deprecated in favor of ``access_log_type`` for better indication of the - /// type of the access log record. + /// This field is deprecated in favor of ``access_log_type``, which provides a clearer indication of the log entry + /// type. #[deprecated] #[prost(bool, tag = "27")] pub intermediate_log_entry: bool, /// If downstream connection in listener failed due to transport socket (e.g. TLS handshake), provides the /// failure reason from the transport socket. The format of this field depends on the configured downstream - /// transport socket. Common TLS failures are in :ref:`TLS trouble shooting `. + /// transport socket. Common TLS failures are in :ref:`TLS troubleshooting `. #[prost(string, tag = "28")] pub downstream_transport_failure_reason: ::prost::alloc::string::String, /// For HTTP: Total number of bytes sent to the downstream by the http stream. - /// For TCP: Total number of bytes sent to the downstream by the tcp proxy. + /// For TCP: Total number of bytes sent to the downstream by the :ref:`TCP Proxy `. #[prost(uint64, tag = "29")] pub downstream_wire_bytes_sent: u64, /// For HTTP: Total number of bytes received from the downstream by the http stream. Envoy over counts sizes of received HTTP/1.1 pipelined requests by adding up bytes of requests in the pipeline to the one currently being processed. - /// For TCP: Total number of bytes received from the downstream by the tcp proxy. + /// For TCP: Total number of bytes received from the downstream by the :ref:`TCP Proxy `. #[prost(uint64, tag = "30")] pub downstream_wire_bytes_received: u64, /// For HTTP: Total number of bytes sent to the upstream by the http stream. This value accumulates during upstream retries. - /// For TCP: Total number of bytes sent to the upstream by the tcp proxy. + /// For TCP: Total number of bytes sent to the upstream by the :ref:`TCP Proxy `. #[prost(uint64, tag = "31")] pub upstream_wire_bytes_sent: u64, /// For HTTP: Total number of bytes received from the upstream by the http stream. - /// For TCP: Total number of bytes sent to the upstream by the tcp proxy. + /// For TCP: Total number of bytes sent to the upstream by the :ref:`TCP Proxy `. #[prost(uint64, tag = "32")] pub upstream_wire_bytes_received: u64, /// The type of the access log, which indicates when the log was recorded. @@ -338,7 +341,7 @@ pub struct ResponseFlags { /// Indicates there was no healthy upstream. #[prost(bool, tag = "2")] pub no_healthy_upstream: bool, - /// Indicates an there was an upstream request timeout. + /// Indicates there was an upstream request timeout. #[prost(bool, tag = "3")] pub upstream_request_timeout: bool, /// Indicates local codec level reset was sent on the stream. @@ -399,7 +402,7 @@ pub struct ResponseFlags { /// Indicates that a filter configuration is not available. #[prost(bool, tag = "22")] pub no_filter_config_found: bool, - /// Indicates that request or connection exceeded the downstream connection duration. + /// Indicates that the request or connection exceeded the downstream connection duration. #[prost(bool, tag = "23")] pub duration_timeout: bool, /// Indicates there was an HTTP protocol error in the upstream response. @@ -678,7 +681,7 @@ pub struct HttpRequestProperties { /// do not already have a request ID. #[prost(string, tag = "9")] pub request_id: ::prost::alloc::string::String, - /// Value of the ``X-Envoy-Original-Path`` request header. + /// Value of the ``x-envoy-original-path`` request header. #[prost(string, tag = "10")] pub original_path: ::prost::alloc::string::String, /// Size of the HTTP request headers in bytes. diff --git a/src/generated/envoy.data.tap.v3.rs b/src/generated/envoy.data.tap.v3.rs index 4b3cd5c..b4cec5f 100644 --- a/src/generated/envoy.data.tap.v3.rs +++ b/src/generated/envoy.data.tap.v3.rs @@ -169,6 +169,7 @@ impl ::prost::Name for HttpStreamedTraceSegment { } } /// Event in a socket trace. +/// \[#next-free-field: 6\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SocketEvent { /// Timestamp for event. @@ -176,6 +177,9 @@ pub struct SocketEvent { pub timestamp: ::core::option::Option< super::super::super::super::google::protobuf::Timestamp, >, + /// Connection information per event + #[prost(message, optional, tag = "5")] + pub connection: ::core::option::Option, /// Read or write with content as bytes string. #[prost(oneof = "socket_event::EventSelector", tags = "2, 3, 4")] pub event_selector: ::core::option::Option, @@ -290,6 +294,22 @@ impl ::prost::Name for SocketBufferedTrace { "type.googleapis.com/envoy.data.tap.v3.SocketBufferedTrace".into() } } +/// A message for the sequence of observed events +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SocketEvents { + #[prost(message, repeated, tag = "1")] + pub events: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for SocketEvents { + const NAME: &'static str = "SocketEvents"; + const PACKAGE: &'static str = "envoy.data.tap.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.data.tap.v3.SocketEvents".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.data.tap.v3.SocketEvents".into() + } +} /// A streamed socket trace segment. Multiple segments make up a full trace. #[derive(Clone, PartialEq, ::prost::Message)] pub struct SocketStreamedTraceSegment { @@ -297,7 +317,7 @@ pub struct SocketStreamedTraceSegment { /// for long term stable uniqueness. Matches connection IDs used in Envoy logs. #[prost(uint64, tag = "1")] pub trace_id: u64, - #[prost(oneof = "socket_streamed_trace_segment::MessagePiece", tags = "2, 3")] + #[prost(oneof = "socket_streamed_trace_segment::MessagePiece", tags = "2, 3, 4")] pub message_piece: ::core::option::Option< socket_streamed_trace_segment::MessagePiece, >, @@ -312,6 +332,9 @@ pub mod socket_streamed_trace_segment { /// Socket event. #[prost(message, tag = "3")] Event(super::SocketEvent), + /// Sequence of observed events. + #[prost(message, tag = "4")] + Events(super::SocketEvents), } } impl ::prost::Name for SocketStreamedTraceSegment { diff --git a/src/generated/envoy.data.tap.v3.serde.rs b/src/generated/envoy.data.tap.v3.serde.rs index 8a6dfd9..b432871 100644 --- a/src/generated/envoy.data.tap.v3.serde.rs +++ b/src/generated/envoy.data.tap.v3.serde.rs @@ -871,6 +871,9 @@ impl serde::Serialize for SocketEvent { if self.timestamp.is_some() { len += 1; } + if self.connection.is_some() { + len += 1; + } if self.event_selector.is_some() { len += 1; } @@ -878,6 +881,9 @@ impl serde::Serialize for SocketEvent { if let Some(v) = self.timestamp.as_ref() { struct_ser.serialize_field("timestamp", v)?; } + if let Some(v) = self.connection.as_ref() { + struct_ser.serialize_field("connection", v)?; + } if let Some(v) = self.event_selector.as_ref() { match v { socket_event::EventSelector::Read(v) => { @@ -902,6 +908,7 @@ impl<'de> serde::Deserialize<'de> for SocketEvent { { const FIELDS: &[&str] = &[ "timestamp", + "connection", "read", "write", "closed", @@ -910,6 +917,7 @@ impl<'de> serde::Deserialize<'de> for SocketEvent { #[allow(clippy::enum_variant_names)] enum GeneratedField { Timestamp, + Connection, Read, Write, Closed, @@ -935,6 +943,7 @@ impl<'de> serde::Deserialize<'de> for SocketEvent { { match value { "timestamp" => Ok(GeneratedField::Timestamp), + "connection" => Ok(GeneratedField::Connection), "read" => Ok(GeneratedField::Read), "write" => Ok(GeneratedField::Write), "closed" => Ok(GeneratedField::Closed), @@ -958,6 +967,7 @@ impl<'de> serde::Deserialize<'de> for SocketEvent { V: serde::de::MapAccess<'de>, { let mut timestamp__ = None; + let mut connection__ = None; let mut event_selector__ = None; while let Some(k) = map_.next_key()? { match k { @@ -967,6 +977,12 @@ impl<'de> serde::Deserialize<'de> for SocketEvent { } timestamp__ = map_.next_value()?; } + GeneratedField::Connection => { + if connection__.is_some() { + return Err(serde::de::Error::duplicate_field("connection")); + } + connection__ = map_.next_value()?; + } GeneratedField::Read => { if event_selector__.is_some() { return Err(serde::de::Error::duplicate_field("read")); @@ -992,6 +1008,7 @@ impl<'de> serde::Deserialize<'de> for SocketEvent { } Ok(SocketEvent { timestamp: timestamp__, + connection: connection__, event_selector: event_selector__, }) } @@ -1270,6 +1287,97 @@ impl<'de> serde::Deserialize<'de> for socket_event::Write { deserializer.deserialize_struct("envoy.data.tap.v3.SocketEvent.Write", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for SocketEvents { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.events.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.data.tap.v3.SocketEvents", len)?; + if !self.events.is_empty() { + struct_ser.serialize_field("events", &self.events)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SocketEvents { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "events", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Events, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "events" => Ok(GeneratedField::Events), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SocketEvents; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.data.tap.v3.SocketEvents") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut events__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Events => { + if events__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + events__ = Some(map_.next_value()?); + } + } + } + Ok(SocketEvents { + events: events__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.data.tap.v3.SocketEvents", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for SocketStreamedTraceSegment { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1298,6 +1406,9 @@ impl serde::Serialize for SocketStreamedTraceSegment { socket_streamed_trace_segment::MessagePiece::Event(v) => { struct_ser.serialize_field("event", v)?; } + socket_streamed_trace_segment::MessagePiece::Events(v) => { + struct_ser.serialize_field("events", v)?; + } } } struct_ser.end() @@ -1314,6 +1425,7 @@ impl<'de> serde::Deserialize<'de> for SocketStreamedTraceSegment { "traceId", "connection", "event", + "events", ]; #[allow(clippy::enum_variant_names)] @@ -1321,6 +1433,7 @@ impl<'de> serde::Deserialize<'de> for SocketStreamedTraceSegment { TraceId, Connection, Event, + Events, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1345,6 +1458,7 @@ impl<'de> serde::Deserialize<'de> for SocketStreamedTraceSegment { "traceId" | "trace_id" => Ok(GeneratedField::TraceId), "connection" => Ok(GeneratedField::Connection), "event" => Ok(GeneratedField::Event), + "events" => Ok(GeneratedField::Events), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1388,6 +1502,13 @@ impl<'de> serde::Deserialize<'de> for SocketStreamedTraceSegment { return Err(serde::de::Error::duplicate_field("event")); } message_piece__ = map_.next_value::<::std::option::Option<_>>()?.map(socket_streamed_trace_segment::MessagePiece::Event) +; + } + GeneratedField::Events => { + if message_piece__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + message_piece__ = map_.next_value::<::std::option::Option<_>>()?.map(socket_streamed_trace_segment::MessagePiece::Events) ; } } diff --git a/src/generated/envoy.extensions.clusters.aggregate.v3.rs b/src/generated/envoy.extensions.clusters.aggregate.v3.rs index 9a985e1..c17e3f9 100644 --- a/src/generated/envoy.extensions.clusters.aggregate.v3.rs +++ b/src/generated/envoy.extensions.clusters.aggregate.v3.rs @@ -19,3 +19,32 @@ impl ::prost::Name for ClusterConfig { "type.googleapis.com/envoy.extensions.clusters.aggregate.v3.ClusterConfig".into() } } +/// Configures an aggregate cluster whose +/// :ref:`ClusterConfig ` +/// is to be fetched from a separate xDS resource. +/// \[#extension: envoy.clusters.aggregate_resource\] +/// \[#not-implemented-hide:\] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AggregateClusterResource { + /// Configuration source specifier for the ClusterConfig resource. + /// Only the aggregated protocol variants are supported; if configured + /// otherwise, the cluster resource will be NACKed. + #[prost(message, optional, tag = "1")] + pub config_source: ::core::option::Option< + super::super::super::super::config::core::v3::ConfigSource, + >, + /// The name of the ClusterConfig resource to subscribe to. + #[prost(string, tag = "2")] + pub resource_name: ::prost::alloc::string::String, +} +impl ::prost::Name for AggregateClusterResource { + const NAME: &'static str = "AggregateClusterResource"; + const PACKAGE: &'static str = "envoy.extensions.clusters.aggregate.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.extensions.clusters.aggregate.v3.AggregateClusterResource".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.extensions.clusters.aggregate.v3.AggregateClusterResource" + .into() + } +} diff --git a/src/generated/envoy.extensions.clusters.aggregate.v3.serde.rs b/src/generated/envoy.extensions.clusters.aggregate.v3.serde.rs index 876e1ed..8ecda74 100644 --- a/src/generated/envoy.extensions.clusters.aggregate.v3.serde.rs +++ b/src/generated/envoy.extensions.clusters.aggregate.v3.serde.rs @@ -1,3 +1,113 @@ +impl serde::Serialize for AggregateClusterResource { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.config_source.is_some() { + len += 1; + } + if !self.resource_name.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.extensions.clusters.aggregate.v3.AggregateClusterResource", len)?; + if let Some(v) = self.config_source.as_ref() { + struct_ser.serialize_field("config_source", v)?; + } + if !self.resource_name.is_empty() { + struct_ser.serialize_field("resource_name", &self.resource_name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AggregateClusterResource { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "config_source", + "configSource", + "resource_name", + "resourceName", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConfigSource, + ResourceName, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "configSource" | "config_source" => Ok(GeneratedField::ConfigSource), + "resourceName" | "resource_name" => Ok(GeneratedField::ResourceName), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AggregateClusterResource; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.extensions.clusters.aggregate.v3.AggregateClusterResource") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut config_source__ = None; + let mut resource_name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConfigSource => { + if config_source__.is_some() { + return Err(serde::de::Error::duplicate_field("configSource")); + } + config_source__ = map_.next_value()?; + } + GeneratedField::ResourceName => { + if resource_name__.is_some() { + return Err(serde::de::Error::duplicate_field("resourceName")); + } + resource_name__ = Some(map_.next_value()?); + } + } + } + Ok(AggregateClusterResource { + config_source: config_source__, + resource_name: resource_name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.extensions.clusters.aggregate.v3.AggregateClusterResource", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for ClusterConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.extensions.common.ratelimit.v3.rs b/src/generated/envoy.extensions.common.ratelimit.v3.rs index cfd7f28..1792eb6 100644 --- a/src/generated/envoy.extensions.common.ratelimit.v3.rs +++ b/src/generated/envoy.extensions.common.ratelimit.v3.rs @@ -52,6 +52,12 @@ pub struct RateLimitDescriptor { /// Optional rate limit override to supply to the ratelimit service. #[prost(message, optional, tag = "2")] pub limit: ::core::option::Option, + /// Optional hits_addend for the rate limit descriptor. If set the value will override the + /// request level hits_addend. + #[prost(message, optional, tag = "3")] + pub hits_addend: ::core::option::Option< + super::super::super::super::super::google::protobuf::UInt64Value, + >, } /// Nested message and enum types in `RateLimitDescriptor`. pub mod rate_limit_descriptor { @@ -60,7 +66,9 @@ pub mod rate_limit_descriptor { /// Descriptor key. #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, - /// Descriptor value. + /// Descriptor value. Blank value is treated as wildcard to create dynamic token buckets for each unique value. + /// Blank Values as wild card is currently supported only with envoy server instance level HTTP local rate limiting + /// and will not work if HTTP local rate limiting is enabled per connection level. #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } @@ -114,6 +122,13 @@ impl ::prost::Name for RateLimitDescriptor { .into() } } +/// Configuration used to enable local rate limiting. +/// +/// .. note:: +/// The ``LocalRateLimitDescriptor`` is used to configure a local rate limit rule with a token +/// bucket algorithm. The ``RateLimitDescriptor`` is used to represent a list of symbols that +/// are used to match against the rate limit rule. +/// #[derive(Clone, PartialEq, ::prost::Message)] pub struct LocalRateLimitDescriptor { /// Descriptor entries. @@ -136,6 +151,28 @@ impl ::prost::Name for LocalRateLimitDescriptor { .into() } } +/// Configuration used to enable local cluster level rate limiting where the token buckets +/// will be shared across all the Envoy instances in the local cluster. +/// A share will be calculated based on the membership of the local cluster dynamically +/// and the configuration. When the limiter refilling the token bucket, the share will be +/// applied. By default, the token bucket will be shared evenly. +/// +/// See :ref:`local cluster name +/// ` for more context +/// about local cluster. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct LocalClusterRateLimit {} +impl ::prost::Name for LocalClusterRateLimit { + const NAME: &'static str = "LocalClusterRateLimit"; + const PACKAGE: &'static str = "envoy.extensions.common.ratelimit.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit" + .into() + } +} /// Defines the version of the standard to use for X-RateLimit headers. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] diff --git a/src/generated/envoy.extensions.common.ratelimit.v3.serde.rs b/src/generated/envoy.extensions.common.ratelimit.v3.serde.rs index f356269..9aa28dd 100644 --- a/src/generated/envoy.extensions.common.ratelimit.v3.serde.rs +++ b/src/generated/envoy.extensions.common.ratelimit.v3.serde.rs @@ -1,3 +1,74 @@ +impl serde::Serialize for LocalClusterRateLimit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for LocalClusterRateLimit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = LocalClusterRateLimit; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(LocalClusterRateLimit { + }) + } + } + deserializer.deserialize_struct("envoy.extensions.common.ratelimit.v3.LocalClusterRateLimit", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for LocalRateLimitDescriptor { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -121,6 +192,9 @@ impl serde::Serialize for RateLimitDescriptor { if self.limit.is_some() { len += 1; } + if self.hits_addend.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.extensions.common.ratelimit.v3.RateLimitDescriptor", len)?; if !self.entries.is_empty() { struct_ser.serialize_field("entries", &self.entries)?; @@ -128,6 +202,9 @@ impl serde::Serialize for RateLimitDescriptor { if let Some(v) = self.limit.as_ref() { struct_ser.serialize_field("limit", v)?; } + if let Some(v) = self.hits_addend.as_ref() { + struct_ser.serialize_field("hits_addend", v)?; + } struct_ser.end() } } @@ -140,12 +217,15 @@ impl<'de> serde::Deserialize<'de> for RateLimitDescriptor { const FIELDS: &[&str] = &[ "entries", "limit", + "hits_addend", + "hitsAddend", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Entries, Limit, + HitsAddend, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -169,6 +249,7 @@ impl<'de> serde::Deserialize<'de> for RateLimitDescriptor { match value { "entries" => Ok(GeneratedField::Entries), "limit" => Ok(GeneratedField::Limit), + "hitsAddend" | "hits_addend" => Ok(GeneratedField::HitsAddend), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -190,6 +271,7 @@ impl<'de> serde::Deserialize<'de> for RateLimitDescriptor { { let mut entries__ = None; let mut limit__ = None; + let mut hits_addend__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Entries => { @@ -204,11 +286,18 @@ impl<'de> serde::Deserialize<'de> for RateLimitDescriptor { } limit__ = map_.next_value()?; } + GeneratedField::HitsAddend => { + if hits_addend__.is_some() { + return Err(serde::de::Error::duplicate_field("hitsAddend")); + } + hits_addend__ = map_.next_value()?; + } } } Ok(RateLimitDescriptor { entries: entries__.unwrap_or_default(), limit: limit__, + hits_addend: hits_addend__, }) } } diff --git a/src/generated/envoy.extensions.filters.http.ext_proc.v3.rs b/src/generated/envoy.extensions.filters.http.ext_proc.v3.rs index ce326b4..4ee6291 100644 --- a/src/generated/envoy.extensions.filters.http.ext_proc.v3.rs +++ b/src/generated/envoy.extensions.filters.http.ext_proc.v3.rs @@ -3,6 +3,9 @@ #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ProcessingMode { /// How to handle the request header. Default is "SEND". + /// Note this field is ignored in :ref:`mode_override + /// `, since mode + /// overrides can only affect messages exchanged after the request header is processed. #[prost(enumeration = "processing_mode::HeaderSendMode", tag = "1")] pub request_header_mode: i32, /// How to handle the response header. Default is "SEND". @@ -37,9 +40,18 @@ pub mod processing_mode { )] #[repr(i32)] pub enum HeaderSendMode { - /// The default HeaderSendMode depends on which part of the message is being - /// processed. By default, request and response headers are sent, - /// while trailers are skipped. + /// When used to configure the ext_proc filter :ref:`processing_mode + /// `, + /// the default HeaderSendMode depends on which part of the message is being processed. By + /// default, request and response headers are sent, while trailers are skipped. + /// + /// When used in :ref:`mode_override + /// ` or + /// :ref:`allowed_override_modes + /// `, + /// a value of DEFAULT indicates that there is no change from the behavior that is configured for + /// the filter in :ref:`processing_mode + /// `. Default = 0, /// Send the header or trailer. Send = 1, @@ -70,11 +82,12 @@ pub mod processing_mode { } /// Control how the request and response bodies are handled /// When body mutation by external processor is enabled, ext_proc filter will always remove - /// the content length header in three cases below because content length can not be guaranteed + /// the content length header in four cases below because content length can not be guaranteed /// to be set correctly: /// 1) STREAMED BodySendMode: header processing completes before body mutation comes back. /// 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. /// 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. + /// 4) FULL_DUPLEX_STREAMED BodySendMode: header processing completes before body mutation comes back. /// /// In Envoy's http1 codec implementation, removing content length will enable chunked transfer /// encoding whenever feasible. The recipient (either client or server) must be able @@ -111,6 +124,7 @@ pub mod processing_mode { /// chunk. If the body exceeds the configured buffer limit, then the body contents /// up to the buffer limit will be sent. BufferedPartial = 3, + FullDuplexStreamed = 4, } impl BodySendMode { /// String value of the enum field names used in the ProtoBuf definition. @@ -123,6 +137,7 @@ pub mod processing_mode { Self::Streamed => "STREAMED", Self::Buffered => "BUFFERED", Self::BufferedPartial => "BUFFERED_PARTIAL", + Self::FullDuplexStreamed => "FULL_DUPLEX_STREAMED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -132,6 +147,7 @@ pub mod processing_mode { "STREAMED" => Some(Self::Streamed), "BUFFERED" => Some(Self::Buffered), "BUFFERED_PARTIAL" => Some(Self::BufferedPartial), + "FULL_DUPLEX_STREAMED" => Some(Self::FullDuplexStreamed), _ => None, } } diff --git a/src/generated/envoy.extensions.filters.http.ext_proc.v3.serde.rs b/src/generated/envoy.extensions.filters.http.ext_proc.v3.serde.rs index 98cbae1..0711a46 100644 --- a/src/generated/envoy.extensions.filters.http.ext_proc.v3.serde.rs +++ b/src/generated/envoy.extensions.filters.http.ext_proc.v3.serde.rs @@ -203,6 +203,7 @@ impl serde::Serialize for processing_mode::BodySendMode { Self::Streamed => "STREAMED", Self::Buffered => "BUFFERED", Self::BufferedPartial => "BUFFERED_PARTIAL", + Self::FullDuplexStreamed => "FULL_DUPLEX_STREAMED", }; serializer.serialize_str(variant) } @@ -218,6 +219,7 @@ impl<'de> serde::Deserialize<'de> for processing_mode::BodySendMode { "STREAMED", "BUFFERED", "BUFFERED_PARTIAL", + "FULL_DUPLEX_STREAMED", ]; struct GeneratedVisitor; @@ -262,6 +264,7 @@ impl<'de> serde::Deserialize<'de> for processing_mode::BodySendMode { "STREAMED" => Ok(processing_mode::BodySendMode::Streamed), "BUFFERED" => Ok(processing_mode::BodySendMode::Buffered), "BUFFERED_PARTIAL" => Ok(processing_mode::BodySendMode::BufferedPartial), + "FULL_DUPLEX_STREAMED" => Ok(processing_mode::BodySendMode::FullDuplexStreamed), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } diff --git a/src/generated/envoy.extensions.filters.http.router.v3.rs b/src/generated/envoy.extensions.filters.http.router.v3.rs index 7c48290..40387c6 100644 --- a/src/generated/envoy.extensions.filters.http.router.v3.rs +++ b/src/generated/envoy.extensions.filters.http.router.v3.rs @@ -70,11 +70,11 @@ pub struct Router { /// for more details. #[prost(bool, tag = "7")] pub suppress_grpc_request_failure_code_stats: bool, + /// Optional HTTP filters for the upstream HTTP filter chain. + /// /// .. note:: /// Upstream HTTP filters are currently in alpha. /// - /// Optional HTTP filters for the upstream HTTP filter chain. - /// /// These filters will be applied for all requests that pass through the router. /// They will also be applied to shadowed requests. /// Upstream HTTP filters cannot change route or cluster. diff --git a/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.rs b/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.rs index c5aa00c..7edace2 100644 --- a/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.rs +++ b/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.rs @@ -1,5 +1,5 @@ // This file is @generated by prost-build. -/// \[#next-free-field: 58\] +/// \[#next-free-field: 59\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpConnectionManager { /// Supplies the type of codec that the connection manager should use. @@ -28,11 +28,26 @@ pub struct HttpConnectionManager { #[prost(message, optional, tag = "7")] pub tracing: ::core::option::Option, /// Additional settings for HTTP requests handled by the connection manager. These will be - /// applicable to both HTTP1 and HTTP2 requests. + /// applicable to both HTTP/1.1 and HTTP/2 requests. #[prost(message, optional, tag = "35")] pub common_http_protocol_options: ::core::option::Option< super::super::super::super::super::config::core::v3::HttpProtocolOptions, >, + /// If set to ``true``, Envoy will not initiate an immediate drain timer for downstream HTTP/1 connections + /// once :ref:`common_http_protocol_options.max_connection_duration + /// ` is exceeded. + /// Instead, Envoy will wait until the next downstream request arrives, add a ``connection: close`` header + /// to the response, and then gracefully close the connection once the stream has completed. + /// + /// This behavior adheres to `RFC 9112, Section 9.6 <`_.> + /// + /// If set to ``false``, exceeding ``max_connection_duration`` triggers Envoy's default drain behavior for HTTP/1, + /// where the connection is eventually closed after all active streams finish. + /// + /// This option has no effect if ``max_connection_duration`` is not configured. + /// Defaults to ``false``. + #[prost(bool, tag = "58")] + pub http1_safe_max_connection_duration: bool, /// Additional HTTP/1 settings that are passed to the HTTP/1 codec. /// [#comment:TODO: The following fields are ignored when the /// :ref:`header validation configuration ` @@ -48,7 +63,6 @@ pub struct HttpConnectionManager { super::super::super::super::super::config::core::v3::Http2ProtocolOptions, >, /// Additional HTTP/3 settings that are passed directly to the HTTP/3 codec. - /// \[#not-implemented-hide:\] #[prost(message, optional, tag = "44")] pub http3_protocol_options: ::core::option::Option< super::super::super::super::super::config::core::v3::Http3ProtocolOptions, @@ -74,7 +88,16 @@ pub struct HttpConnectionManager { >, /// The maximum request headers size for incoming connections. /// If unconfigured, the default max request headers allowed is 60 KiB. + /// The default value can be overridden by setting runtime key ``envoy.reloadable_features.max_request_headers_size_kb``. /// Requests that exceed this limit will receive a 431 response. + /// + /// .. note:: + /// + /// Currently some protocol codecs impose limits on the maximum size of a single header. + /// + /// * HTTP/2 (when using nghttp2) limits a single header to around 100kb. + /// * HTTP/3 limits a single header to around 1024kb. + /// #[prost(message, optional, tag = "29")] pub max_request_headers_kb: ::core::option::Option< super::super::super::super::super::super::google::protobuf::UInt32Value, @@ -143,9 +166,10 @@ pub struct HttpConnectionManager { /// race with the final GOAWAY frame. During this grace period, Envoy will /// continue to accept new streams. After the grace period, a final GOAWAY /// frame is sent and Envoy will start refusing new streams. Draining occurs - /// both when a connection hits the idle timeout or during general server - /// draining. The default grace period is 5000 milliseconds (5 seconds) if this - /// option is not specified. + /// either when a connection hits the idle timeout, when :ref:`max_connection_duration + /// ` + /// is reached, or during general server draining. The default grace period is + /// 5000 milliseconds (5 seconds) if this option is not specified. #[prost(message, optional, tag = "12")] pub drain_timeout: ::core::option::Option< super::super::super::super::super::super::google::protobuf::Duration, @@ -155,31 +179,34 @@ pub struct HttpConnectionManager { /// during which Envoy will wait for the peer to close (i.e., a TCP FIN/RST is received by Envoy /// from the downstream connection) prior to Envoy closing the socket associated with that /// connection. - /// NOTE: This timeout is enforced even when the socket associated with the downstream connection - /// is pending a flush of the write buffer. However, any progress made writing data to the socket - /// will restart the timer associated with this timeout. This means that the total grace period for - /// a socket in this state will be - /// +. + /// + /// .. note:: + /// + /// This timeout is enforced even when the socket associated with the downstream connection is pending a flush of + /// the write buffer. However, any progress made writing data to the socket will restart the timer associated with + /// this timeout. This means that the total grace period for a socket in this state will be + /// +. /// /// Delaying Envoy's connection close and giving the peer the opportunity to initiate the close /// sequence mitigates a race condition that exists when downstream clients do not drain/process /// data in a connection's receive buffer after a remote close has been detected via a socket - /// write(). This race leads to such clients failing to process the response code sent by Envoy, + /// ``write()``. This race leads to such clients failing to process the response code sent by Envoy, /// which could result in erroneous downstream processing. /// /// If the timeout triggers, Envoy will close the connection's socket. /// /// The default timeout is 1000 ms if this option is not specified. /// - /// .. NOTE:: + /// .. note:: /// To be useful in avoiding the race condition described above, this timeout must be set /// to *at least* +<100ms to account for /// a reasonable "worst" case processing time for a full iteration of Envoy's event loop>. /// - /// .. WARNING:: - /// A value of 0 will completely disable delayed close processing. When disabled, the downstream + /// .. warning:: + /// A value of ``0`` will completely disable delayed close processing. When disabled, the downstream /// connection's socket will be closed immediately after the write flush is completed or will /// never close if the write flush does not complete. + /// #[prost(message, optional, tag = "26")] pub delayed_close_timeout: ::core::option::Option< super::super::super::super::super::super::google::protobuf::Duration, @@ -190,25 +217,32 @@ pub struct HttpConnectionManager { pub access_log: ::prost::alloc::vec::Vec< super::super::super::super::super::config::accesslog::v3::AccessLog, >, + /// The interval to flush the above access logs. + /// /// .. attention:: - /// This field is deprecated in favor of - /// :ref:`access_log_flush_interval - /// `. - /// Note that if both this field and :ref:`access_log_flush_interval - /// ` - /// are specified, the former (deprecated field) is ignored. + /// + /// This field is deprecated in favor of + /// :ref:`access_log_flush_interval + /// `. + /// Note that if both this field and :ref:`access_log_flush_interval + /// ` + /// are specified, the former (deprecated field) is ignored. #[deprecated] #[prost(message, optional, tag = "54")] pub access_log_flush_interval: ::core::option::Option< super::super::super::super::super::super::google::protobuf::Duration, >, + /// If set to true, HCM will flush an access log once when a new HTTP request is received, after the request + /// headers have been evaluated, and before iterating through the HTTP filter chain. + /// /// .. attention:: - /// This field is deprecated in favor of - /// :ref:`flush_access_log_on_new_request - /// `. - /// Note that if both this field and :ref:`flush_access_log_on_new_request - /// ` - /// are specified, the former (deprecated field) is ignored. + /// + /// This field is deprecated in favor of + /// :ref:`flush_access_log_on_new_request + /// `. + /// Note that if both this field and :ref:`flush_access_log_on_new_request + /// ` + /// are specified, the former (deprecated field) is ignored. #[deprecated] #[prost(bool, tag = "55")] pub flush_access_log_on_new_request: bool, @@ -235,20 +269,19 @@ pub struct HttpConnectionManager { /// :ref:`config_http_conn_man_headers_x-forwarded-for` for more information. #[prost(uint32, tag = "19")] pub xff_num_trusted_hops: u32, - /// The configuration for the original IP detection extensions. - /// - /// When configured the extensions will be called along with the request headers - /// and information about the downstream connection, such as the directly connected address. - /// Each extension will then use these parameters to decide the request's effective remote address. - /// If an extension fails to detect the original IP address and isn't configured to reject - /// the request, the HCM will try the remaining extensions until one succeeds or rejects - /// the request. If the request isn't rejected nor any extension succeeds, the HCM will - /// fallback to using the remote address. - /// - /// .. WARNING:: - /// Extensions cannot be used in conjunction with :ref:`use_remote_address + /// Configuration for original IP detection extensions. + /// + /// When these extensions are configured, Envoy will invoke them with the incoming request headers and + /// details about the downstream connection, including the directly connected address. Each extension uses + /// this information to determine the effective remote IP address for the request. If an extension cannot + /// identify the original IP address and isn't set to reject the request, Envoy will sequentially attempt + /// the remaining extensions until one successfully determines the IP or explicitly rejects the request. + /// If all extensions fail without rejection, Envoy defaults to using the directly connected remote address. + /// + /// .. warning:: + /// These extensions cannot be configured simultaneously with :ref:`use_remote_address /// ` - /// nor :ref:`xff_num_trusted_hops + /// or :ref:`xff_num_trusted_hops /// `. /// /// \[#extension-category: envoy.http.original_ip_detection\] @@ -271,6 +304,34 @@ pub struct HttpConnectionManager { /// purposes. If unspecified, only RFC1918 IP addresses will be considered internal. /// See the documentation for :ref:`config_http_conn_man_headers_x-envoy-internal` for more /// information about internal/external addresses. + /// + /// .. warning:: + /// As of Envoy 1.33.0 no IP addresses will be considered trusted. If you have tooling such as probes + /// on your private network which need to be treated as trusted (e.g. changing arbitrary x-envoy headers) + /// you will have to manually include those addresses or CIDR ranges like: + /// + /// .. validated-code-block:: yaml + /// :type-name: envoy.extensions.filters.network.http_connection_manager.v3.InternalAddressConfig + /// + /// cidr_ranges: + /// address_prefix: 10.0.0.0 + /// prefix_len: 8 + /// cidr_ranges: + /// address_prefix: 192.168.0.0 + /// prefix_len: 16 + /// cidr_ranges: + /// address_prefix: 172.16.0.0 + /// prefix_len: 12 + /// cidr_ranges: + /// address_prefix: 127.0.0.1 + /// prefix_len: 32 + /// cidr_ranges: + /// address_prefix: fd00:: + /// prefix_len: 8 + /// cidr_ranges: + /// address_prefix: ::1 + /// prefix_len: 128 + /// #[prost(message, optional, tag = "25")] pub internal_address_config: ::core::option::Option< http_connection_manager::InternalAddressConfig, @@ -575,14 +636,6 @@ pub mod http_connection_manager { >, /// Configuration for an external tracing provider. /// If not specified, no tracing will be performed. - /// - /// .. attention:: - /// Please be aware that ``envoy.tracers.opencensus`` provider can only be configured once - /// in Envoy lifetime. - /// Any attempts to reconfigure it or to use different configurations for different HCM filters - /// will be rejected. - /// Such a constraint is inherent to OpenCensus itself. It cannot be overcome without changes - /// on OpenCensus side. #[prost(message, optional, tag = "9")] pub provider: ::core::option::Option< super::super::super::super::super::super::config::trace::v3::tracing::Http, @@ -733,13 +786,12 @@ pub mod http_connection_manager { /// /// .. warning:: /// - /// The current implementation of upgrade headers does not handle - /// multi-valued upgrade headers. Support for multi-valued headers may be - /// added in the future if needed. + /// The current implementation of upgrade headers does not handle multi-valued upgrade headers. Support for + /// multi-valued headers may be added in the future if needed. /// /// .. warning:: - /// The current implementation of upgrade headers does not work with HTTP/2 - /// upstreams. + /// The current implementation of upgrade headers does not work with HTTP/2 upstreams. + /// #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpgradeConfig { /// The case-insensitive name of this upgrade, e.g. "websocket". @@ -782,7 +834,10 @@ pub mod http_connection_manager { /// `) will apply to the ``:path`` header /// destined for the upstream. /// - /// Note: access logging and tracing will show the original ``:path`` header. + /// .. note:: + /// + /// Access logging and tracing will show the original ``:path`` header. + /// #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathNormalizationOptions { /// \[#not-implemented-hide:\] Normalization applies internally before any processing of requests by @@ -957,9 +1012,8 @@ pub mod http_connection_manager { /// (Envoy does not require HTTP/2 to take place over TLS or to use ALPN. /// Prior knowledge is allowed). Http2 = 2, - /// \[#not-implemented-hide:\] QUIC implementation is not production ready yet. Use this enum with - /// caution to prevent accidental execution of QUIC code. I.e. `!= HTTP2` is no longer sufficient - /// to distinguish HTTP1 and HTTP2 traffic. + /// The connection manager will assume that the client is speaking HTTP/3. + /// This needs to be consistent with listener and transport socket config. Http3 = 3, } impl CodecType { @@ -1086,7 +1140,7 @@ pub mod http_connection_manager { } } } - /// Determines the action for request that contain %2F, %2f, %5C or %5c sequences in the URI path. + /// Determines the action for request that contain ``%2F``, ``%2f``, ``%5C`` or ``%5c`` sequences in the URI path. /// This operation occurs before URL normalization and the merge slashes transformations if they were enabled. #[derive( Clone, @@ -1103,24 +1157,34 @@ pub mod http_connection_manager { pub enum PathWithEscapedSlashesAction { /// Default behavior specific to implementation (i.e. Envoy) of this configuration option. /// Envoy, by default, takes the KEEP_UNCHANGED action. - /// NOTE: the implementation may change the default behavior at-will. + /// + /// .. note:: + /// + /// The implementation may change the default behavior at-will. ImplementationSpecificDefault = 0, /// Keep escaped slashes. KeepUnchanged = 1, /// Reject client request with the 400 status. gRPC requests will be rejected with the INTERNAL (13) error code. - /// The "httpN.downstream_rq_failed_path_normalization" counter is incremented for each rejected request. + /// The ``httpN.downstream_rq_failed_path_normalization`` counter is incremented for each rejected request. RejectRequest = 2, - /// Unescape %2F and %5C sequences and redirect request to the new path if these sequences were present. + /// Unescape ``%2F`` and ``%5C`` sequences and redirect request to the new path if these sequences were present. /// Redirect occurs after path normalization and merge slashes transformations if they were configured. - /// NOTE: gRPC requests will be rejected with the INTERNAL (13) error code. - /// This option minimizes possibility of path confusion exploits by forcing request with unescaped slashes to - /// traverse all parties: downstream client, intermediate proxies, Envoy and upstream server. - /// The "httpN.downstream_rq_redirected_with_normalized_path" counter is incremented for each - /// redirected request. + /// + /// .. note:: + /// + /// gRPC requests will be rejected with the INTERNAL (13) error code. This option minimizes possibility of path + /// confusion exploits by forcing request with unescaped slashes to traverse all parties: downstream client, + /// intermediate proxies, Envoy and upstream server. The ``httpN.downstream_rq_redirected_with_normalized_path`` + /// counter is incremented for each redirected request. + /// UnescapeAndRedirect = 3, - /// Unescape %2F and %5C sequences. - /// Note: this option should not be enabled if intermediaries perform path based access control as - /// it may lead to path confusion vulnerabilities. + /// Unescape ``%2F`` and ``%5C`` sequences. + /// + /// .. note:: + /// + /// This option should not be enabled if intermediaries perform path based access control as it may lead to path + /// confusion vulnerabilities. + /// UnescapeAndForward = 4, } impl PathWithEscapedSlashesAction { diff --git a/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.serde.rs b/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.serde.rs index 64d3d58..63745a4 100644 --- a/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.serde.rs +++ b/src/generated/envoy.extensions.filters.network.http_connection_manager.v3.serde.rs @@ -115,6 +115,9 @@ impl serde::Serialize for HttpConnectionManager { if self.common_http_protocol_options.is_some() { len += 1; } + if self.http1_safe_max_connection_duration { + len += 1; + } if self.http_protocol_options.is_some() { len += 1; } @@ -277,6 +280,9 @@ impl serde::Serialize for HttpConnectionManager { if let Some(v) = self.common_http_protocol_options.as_ref() { struct_ser.serialize_field("common_http_protocol_options", v)?; } + if self.http1_safe_max_connection_duration { + struct_ser.serialize_field("http1_safe_max_connection_duration", &self.http1_safe_max_connection_duration)?; + } if let Some(v) = self.http_protocol_options.as_ref() { struct_ser.serialize_field("http_protocol_options", v)?; } @@ -459,6 +465,8 @@ impl<'de> serde::Deserialize<'de> for HttpConnectionManager { "tracing", "common_http_protocol_options", "commonHttpProtocolOptions", + "http1_safe_max_connection_duration", + "http1SafeMaxConnectionDuration", "http_protocol_options", "httpProtocolOptions", "http2_protocol_options", @@ -565,6 +573,7 @@ impl<'de> serde::Deserialize<'de> for HttpConnectionManager { AddUserAgent, Tracing, CommonHttpProtocolOptions, + Http1SafeMaxConnectionDuration, HttpProtocolOptions, Http2ProtocolOptions, Http3ProtocolOptions, @@ -641,6 +650,7 @@ impl<'de> serde::Deserialize<'de> for HttpConnectionManager { "addUserAgent" | "add_user_agent" => Ok(GeneratedField::AddUserAgent), "tracing" => Ok(GeneratedField::Tracing), "commonHttpProtocolOptions" | "common_http_protocol_options" => Ok(GeneratedField::CommonHttpProtocolOptions), + "http1SafeMaxConnectionDuration" | "http1_safe_max_connection_duration" => Ok(GeneratedField::Http1SafeMaxConnectionDuration), "httpProtocolOptions" | "http_protocol_options" => Ok(GeneratedField::HttpProtocolOptions), "http2ProtocolOptions" | "http2_protocol_options" => Ok(GeneratedField::Http2ProtocolOptions), "http3ProtocolOptions" | "http3_protocol_options" => Ok(GeneratedField::Http3ProtocolOptions), @@ -715,6 +725,7 @@ impl<'de> serde::Deserialize<'de> for HttpConnectionManager { let mut add_user_agent__ = None; let mut tracing__ = None; let mut common_http_protocol_options__ = None; + let mut http1_safe_max_connection_duration__ = None; let mut http_protocol_options__ = None; let mut http2_protocol_options__ = None; let mut http3_protocol_options__ = None; @@ -800,6 +811,12 @@ impl<'de> serde::Deserialize<'de> for HttpConnectionManager { } common_http_protocol_options__ = map_.next_value()?; } + GeneratedField::Http1SafeMaxConnectionDuration => { + if http1_safe_max_connection_duration__.is_some() { + return Err(serde::de::Error::duplicate_field("http1SafeMaxConnectionDuration")); + } + http1_safe_max_connection_duration__ = Some(map_.next_value()?); + } GeneratedField::HttpProtocolOptions => { if http_protocol_options__.is_some() { return Err(serde::de::Error::duplicate_field("httpProtocolOptions")); @@ -1108,6 +1125,7 @@ impl<'de> serde::Deserialize<'de> for HttpConnectionManager { add_user_agent: add_user_agent__, tracing: tracing__, common_http_protocol_options: common_http_protocol_options__, + http1_safe_max_connection_duration: http1_safe_max_connection_duration__.unwrap_or_default(), http_protocol_options: http_protocol_options__, http2_protocol_options: http2_protocol_options__, http3_protocol_options: http3_protocol_options__, diff --git a/src/generated/envoy.extensions.transport_sockets.tls.v3.rs b/src/generated/envoy.extensions.transport_sockets.tls.v3.rs index d909ef0..f090231 100644 --- a/src/generated/envoy.extensions.transport_sockets.tls.v3.rs +++ b/src/generated/envoy.extensions.transport_sockets.tls.v3.rs @@ -1,5 +1,5 @@ // This file is @generated by prost-build. -/// \[#next-free-field: 6\] +/// \[#next-free-field: 7\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TlsParameters { /// Minimum TLS protocol version. By default, it's ``TLSv1_2`` for both clients and servers. @@ -115,6 +115,16 @@ pub struct TlsParameters { /// ecdsa_sha1 #[prost(string, repeated, tag = "5")] pub signature_algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Compliance policies configure various aspects of the TLS based on the given policy. + /// The policies are applied last during configuration and may override the other TLS + /// parameters, or any previous policy. + #[prost( + enumeration = "tls_parameters::CompliancePolicy", + repeated, + packed = "false", + tag = "6" + )] + pub compliance_policies: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `TlsParameters`. pub mod tls_parameters { @@ -168,6 +178,52 @@ pub mod tls_parameters { } } } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum CompliancePolicy { + /// FIPS_202205 configures a TLS connection to use: + /// + /// * TLS 1.2 or 1.3 + /// * For TLS 1.2, only ECDHE_\[RSA|ECDSA\]_WITH_AES_*_GCM_SHA*. + /// * For TLS 1.3, only AES-GCM + /// * P-256 or P-384 for key agreement. + /// * For server signatures, only ``PKCS#1/PSS`` with ``SHA256/384/512``, or ECDSA + /// with P-256 or P-384. + /// + /// .. attention:: + /// + /// Please refer to `BoringSSL policies <`_> + /// for details. + Fips202205 = 0, + } + impl CompliancePolicy { + /// 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::Fips202205 => "FIPS_202205", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FIPS_202205" => Some(Self::Fips202205), + _ => None, + } + } + } } impl ::prost::Name for TlsParameters { const NAME: &'static str = "TlsParameters"; @@ -272,12 +328,13 @@ pub struct TlsCertificate { super::super::super::super::config::core::v3::WatchedDirectory, >, /// BoringSSL private key method provider. This is an alternative to :ref:`private_key - /// ` field. This can't be - /// marked as ``oneof`` due to API compatibility reasons. Setting both :ref:`private_key - /// ` and - /// :ref:`private_key_provider - /// ` fields will result in an - /// error. + /// ` field. + /// When both :ref:`private_key ` and + /// :ref:`private_key_provider ` fields are set, + /// ``private_key_provider`` takes precedence. + /// If ``private_key_provider`` is unavailable and :ref:`fallback + /// ` + /// is enabled, ``private_key`` will be used. #[prost(message, optional, tag = "6")] pub private_key_provider: ::core::option::Option, /// The password to decrypt the TLS private key. If this field is not set, it is assumed that the @@ -358,7 +415,7 @@ impl ::prost::Name for TlsSessionTicketKeys { /// \[#not-implemented-hide:\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CertificateProviderPluginInstance { - /// Provider instance name. If not present, defaults to "default". + /// Provider instance name. /// /// Instance names should generally be defined not in terms of the underlying provider /// implementation (e.g., "file_watcher") but rather in terms of the function of the @@ -391,10 +448,32 @@ pub struct SubjectAltNameMatcher { #[prost(enumeration = "subject_alt_name_matcher::SanType", tag = "1")] pub san_type: i32, /// Matcher for SAN value. + /// + /// If the :ref:`san_type ` + /// is :ref:`DNS ` + /// and the matcher type is :ref:`exact `, DNS wildcards are evaluated + /// according to the rules in + /// For example, ``*.example.com`` would match ``test.example.com`` but not ``example.com`` and not + /// ``a.b.example.com``. + /// + /// The string matching for OTHER_NAME SAN values depends on their ASN.1 type: + /// + /// * OBJECT: Validated against its dotted numeric notation (e.g., "1.2.3.4") + /// * BOOLEAN: Validated against strings "true" or "false" + /// * INTEGER/ENUMERATED: Validated against a string containing the integer value + /// * NULL: Validated against an empty string + /// * Other types: Validated directly against the string value #[prost(message, optional, tag = "2")] pub matcher: ::core::option::Option< super::super::super::super::r#type::matcher::v3::StringMatcher, >, + /// OID Value which is required if OTHER_NAME SAN type is used. + /// For example, UPN OID is 1.3.6.1.4.1.311.20.2.3 + /// (Reference: ). + /// + /// If set for SAN types other than OTHER_NAME, it will be ignored. + #[prost(string, tag = "3")] + pub oid: ::prost::alloc::string::String, } /// Nested message and enum types in `SubjectAltNameMatcher`. pub mod subject_alt_name_matcher { @@ -418,6 +497,7 @@ pub mod subject_alt_name_matcher { Dns = 2, Uri = 3, IpAddress = 4, + OtherName = 5, } impl SanType { /// String value of the enum field names used in the ProtoBuf definition. @@ -431,6 +511,7 @@ pub mod subject_alt_name_matcher { Self::Dns => "DNS", Self::Uri => "URI", Self::IpAddress => "IP_ADDRESS", + Self::OtherName => "OTHER_NAME", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -441,6 +522,7 @@ pub mod subject_alt_name_matcher { "DNS" => Some(Self::Dns), "URI" => Some(Self::Uri), "IP_ADDRESS" => Some(Self::IpAddress), + "OTHER_NAME" => Some(Self::OtherName), _ => None, } } @@ -755,11 +837,19 @@ impl ::prost::Name for CertificateValidationContext { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenericSecret { - /// Secret of generic type and is available to filters. + /// Secret of generic type and is available to filters. It is expected + /// that only only one of secret and secrets is set. #[prost(message, optional, tag = "1")] pub secret: ::core::option::Option< super::super::super::super::config::core::v3::DataSource, >, + /// For cases where multiple associated secrets need to be distributed together. It is expected + /// that only only one of secret and secrets is set. + #[prost(map = "string, message", tag = "2")] + pub secrets: ::std::collections::HashMap< + ::prost::alloc::string::String, + super::super::super::super::config::core::v3::DataSource, + >, } impl ::prost::Name for GenericSecret { const NAME: &'static str = "GenericSecret"; diff --git a/src/generated/envoy.extensions.transport_sockets.tls.v3.serde.rs b/src/generated/envoy.extensions.transport_sockets.tls.v3.serde.rs index bb7b277..02ed574 100644 --- a/src/generated/envoy.extensions.transport_sockets.tls.v3.serde.rs +++ b/src/generated/envoy.extensions.transport_sockets.tls.v3.serde.rs @@ -606,10 +606,16 @@ impl serde::Serialize for GenericSecret { if self.secret.is_some() { len += 1; } + if !self.secrets.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.extensions.transport_sockets.tls.v3.GenericSecret", len)?; if let Some(v) = self.secret.as_ref() { struct_ser.serialize_field("secret", v)?; } + if !self.secrets.is_empty() { + struct_ser.serialize_field("secrets", &self.secrets)?; + } struct_ser.end() } } @@ -621,11 +627,13 @@ impl<'de> serde::Deserialize<'de> for GenericSecret { { const FIELDS: &[&str] = &[ "secret", + "secrets", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Secret, + Secrets, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -648,6 +656,7 @@ impl<'de> serde::Deserialize<'de> for GenericSecret { { match value { "secret" => Ok(GeneratedField::Secret), + "secrets" => Ok(GeneratedField::Secrets), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -668,6 +677,7 @@ impl<'de> serde::Deserialize<'de> for GenericSecret { V: serde::de::MapAccess<'de>, { let mut secret__ = None; + let mut secrets__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Secret => { @@ -676,10 +686,19 @@ impl<'de> serde::Deserialize<'de> for GenericSecret { } secret__ = map_.next_value()?; } + GeneratedField::Secrets => { + if secrets__.is_some() { + return Err(serde::de::Error::duplicate_field("secrets")); + } + secrets__ = Some( + map_.next_value::>()? + ); + } } } Ok(GenericSecret { secret: secret__, + secrets: secrets__.unwrap_or_default(), }) } } @@ -1097,6 +1116,9 @@ impl serde::Serialize for SubjectAltNameMatcher { if self.matcher.is_some() { len += 1; } + if !self.oid.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.extensions.transport_sockets.tls.v3.SubjectAltNameMatcher", len)?; if self.san_type != 0 { let v = subject_alt_name_matcher::SanType::try_from(self.san_type) @@ -1106,6 +1128,9 @@ impl serde::Serialize for SubjectAltNameMatcher { if let Some(v) = self.matcher.as_ref() { struct_ser.serialize_field("matcher", v)?; } + if !self.oid.is_empty() { + struct_ser.serialize_field("oid", &self.oid)?; + } struct_ser.end() } } @@ -1119,12 +1144,14 @@ impl<'de> serde::Deserialize<'de> for SubjectAltNameMatcher { "san_type", "sanType", "matcher", + "oid", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { SanType, Matcher, + Oid, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1148,6 +1175,7 @@ impl<'de> serde::Deserialize<'de> for SubjectAltNameMatcher { match value { "sanType" | "san_type" => Ok(GeneratedField::SanType), "matcher" => Ok(GeneratedField::Matcher), + "oid" => Ok(GeneratedField::Oid), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1169,6 +1197,7 @@ impl<'de> serde::Deserialize<'de> for SubjectAltNameMatcher { { let mut san_type__ = None; let mut matcher__ = None; + let mut oid__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SanType => { @@ -1183,11 +1212,18 @@ impl<'de> serde::Deserialize<'de> for SubjectAltNameMatcher { } matcher__ = map_.next_value()?; } + GeneratedField::Oid => { + if oid__.is_some() { + return Err(serde::de::Error::duplicate_field("oid")); + } + oid__ = Some(map_.next_value()?); + } } } Ok(SubjectAltNameMatcher { san_type: san_type__.unwrap_or_default(), matcher: matcher__, + oid: oid__.unwrap_or_default(), }) } } @@ -1206,6 +1242,7 @@ impl serde::Serialize for subject_alt_name_matcher::SanType { Self::Dns => "DNS", Self::Uri => "URI", Self::IpAddress => "IP_ADDRESS", + Self::OtherName => "OTHER_NAME", }; serializer.serialize_str(variant) } @@ -1222,6 +1259,7 @@ impl<'de> serde::Deserialize<'de> for subject_alt_name_matcher::SanType { "DNS", "URI", "IP_ADDRESS", + "OTHER_NAME", ]; struct GeneratedVisitor; @@ -1267,6 +1305,7 @@ impl<'de> serde::Deserialize<'de> for subject_alt_name_matcher::SanType { "DNS" => Ok(subject_alt_name_matcher::SanType::Dns), "URI" => Ok(subject_alt_name_matcher::SanType::Uri), "IP_ADDRESS" => Ok(subject_alt_name_matcher::SanType::IpAddress), + "OTHER_NAME" => Ok(subject_alt_name_matcher::SanType::OtherName), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -1513,6 +1552,9 @@ impl serde::Serialize for TlsParameters { if !self.signature_algorithms.is_empty() { len += 1; } + if !self.compliance_policies.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.extensions.transport_sockets.tls.v3.TlsParameters", len)?; if self.tls_minimum_protocol_version != 0 { let v = tls_parameters::TlsProtocol::try_from(self.tls_minimum_protocol_version) @@ -1533,6 +1575,13 @@ impl serde::Serialize for TlsParameters { if !self.signature_algorithms.is_empty() { struct_ser.serialize_field("signature_algorithms", &self.signature_algorithms)?; } + if !self.compliance_policies.is_empty() { + let v = self.compliance_policies.iter().cloned().map(|v| { + tls_parameters::CompliancePolicy::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("compliance_policies", &v)?; + } struct_ser.end() } } @@ -1553,6 +1602,8 @@ impl<'de> serde::Deserialize<'de> for TlsParameters { "ecdhCurves", "signature_algorithms", "signatureAlgorithms", + "compliance_policies", + "compliancePolicies", ]; #[allow(clippy::enum_variant_names)] @@ -1562,6 +1613,7 @@ impl<'de> serde::Deserialize<'de> for TlsParameters { CipherSuites, EcdhCurves, SignatureAlgorithms, + CompliancePolicies, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1588,6 +1640,7 @@ impl<'de> serde::Deserialize<'de> for TlsParameters { "cipherSuites" | "cipher_suites" => Ok(GeneratedField::CipherSuites), "ecdhCurves" | "ecdh_curves" => Ok(GeneratedField::EcdhCurves), "signatureAlgorithms" | "signature_algorithms" => Ok(GeneratedField::SignatureAlgorithms), + "compliancePolicies" | "compliance_policies" => Ok(GeneratedField::CompliancePolicies), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1612,6 +1665,7 @@ impl<'de> serde::Deserialize<'de> for TlsParameters { let mut cipher_suites__ = None; let mut ecdh_curves__ = None; let mut signature_algorithms__ = None; + let mut compliance_policies__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::TlsMinimumProtocolVersion => { @@ -1644,6 +1698,12 @@ impl<'de> serde::Deserialize<'de> for TlsParameters { } signature_algorithms__ = Some(map_.next_value()?); } + GeneratedField::CompliancePolicies => { + if compliance_policies__.is_some() { + return Err(serde::de::Error::duplicate_field("compliancePolicies")); + } + compliance_policies__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); + } } } Ok(TlsParameters { @@ -1652,12 +1712,81 @@ impl<'de> serde::Deserialize<'de> for TlsParameters { cipher_suites: cipher_suites__.unwrap_or_default(), ecdh_curves: ecdh_curves__.unwrap_or_default(), signature_algorithms: signature_algorithms__.unwrap_or_default(), + compliance_policies: compliance_policies__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.transport_sockets.tls.v3.TlsParameters", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for tls_parameters::CompliancePolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Fips202205 => "FIPS_202205", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for tls_parameters::CompliancePolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "FIPS_202205", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = tls_parameters::CompliancePolicy; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "FIPS_202205" => Ok(tls_parameters::CompliancePolicy::Fips202205), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for tls_parameters::TlsProtocol { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.r#type.http.v3.rs b/src/generated/envoy.r#type.http.v3.rs index cd17089..b40a116 100644 --- a/src/generated/envoy.r#type.http.v3.rs +++ b/src/generated/envoy.r#type.http.v3.rs @@ -16,6 +16,9 @@ pub struct Cookie { /// If no path is specified here, no path will be set for the cookie. #[prost(string, tag = "3")] pub path: ::prost::alloc::string::String, + /// Additional attributes for the cookie. They will be used when generating a new cookie. + #[prost(message, repeated, tag = "4")] + pub attributes: ::prost::alloc::vec::Vec, } impl ::prost::Name for Cookie { const NAME: &'static str = "Cookie"; @@ -27,6 +30,26 @@ impl ::prost::Name for Cookie { "type.googleapis.com/envoy.type.http.v3.Cookie".into() } } +/// CookieAttribute defines an API for adding additional attributes for a HTTP cookie. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CookieAttribute { + /// The name of the cookie attribute. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// The optional value of the cookie attribute. + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, +} +impl ::prost::Name for CookieAttribute { + const NAME: &'static str = "CookieAttribute"; + const PACKAGE: &'static str = "envoy.type.http.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.type.http.v3.CookieAttribute".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.type.http.v3.CookieAttribute".into() + } +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathTransformation { /// A list of operations to apply. Transformations will be performed in the order that they appear. diff --git a/src/generated/envoy.r#type.http.v3.serde.rs b/src/generated/envoy.r#type.http.v3.serde.rs index b35f074..e5182e4 100644 --- a/src/generated/envoy.r#type.http.v3.serde.rs +++ b/src/generated/envoy.r#type.http.v3.serde.rs @@ -15,6 +15,9 @@ impl serde::Serialize for Cookie { if !self.path.is_empty() { len += 1; } + if !self.attributes.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.r#type.http.v3.Cookie", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; @@ -25,6 +28,9 @@ impl serde::Serialize for Cookie { if !self.path.is_empty() { struct_ser.serialize_field("path", &self.path)?; } + if !self.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; + } struct_ser.end() } } @@ -38,6 +44,7 @@ impl<'de> serde::Deserialize<'de> for Cookie { "name", "ttl", "path", + "attributes", ]; #[allow(clippy::enum_variant_names)] @@ -45,6 +52,7 @@ impl<'de> serde::Deserialize<'de> for Cookie { Name, Ttl, Path, + Attributes, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -69,6 +77,7 @@ impl<'de> serde::Deserialize<'de> for Cookie { "name" => Ok(GeneratedField::Name), "ttl" => Ok(GeneratedField::Ttl), "path" => Ok(GeneratedField::Path), + "attributes" => Ok(GeneratedField::Attributes), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -91,6 +100,7 @@ impl<'de> serde::Deserialize<'de> for Cookie { let mut name__ = None; let mut ttl__ = None; let mut path__ = None; + let mut attributes__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -111,18 +121,133 @@ impl<'de> serde::Deserialize<'de> for Cookie { } path__ = Some(map_.next_value()?); } + GeneratedField::Attributes => { + if attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("attributes")); + } + attributes__ = Some(map_.next_value()?); + } } } Ok(Cookie { name: name__.unwrap_or_default(), ttl: ttl__, path: path__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.r#type.http.v3.Cookie", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for CookieAttribute { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.r#type.http.v3.CookieAttribute", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.value.is_empty() { + struct_ser.serialize_field("value", &self.value)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CookieAttribute { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CookieAttribute; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.r#type.http.v3.CookieAttribute") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = Some(map_.next_value()?); + } + } + } + Ok(CookieAttribute { + name: name__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.r#type.http.v3.CookieAttribute", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for PathTransformation { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.r#type.matcher.v3.rs b/src/generated/envoy.r#type.matcher.v3.rs index d4a8b07..f44edac 100644 --- a/src/generated/envoy.r#type.matcher.v3.rs +++ b/src/generated/envoy.r#type.matcher.v3.rs @@ -1,4 +1,24 @@ // This file is @generated by prost-build. +/// Match an IP against a repeated CIDR range. This matcher is intended to be +/// used in other matchers, for example in the filter state matcher to match a +/// filter state object as an IP. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddressMatcher { + #[prost(message, repeated, tag = "1")] + pub ranges: ::prost::alloc::vec::Vec< + super::super::super::super::xds::core::v3::CidrRange, + >, +} +impl ::prost::Name for AddressMatcher { + const NAME: &'static str = "AddressMatcher"; + const PACKAGE: &'static str = "envoy.type.matcher.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.type.matcher.v3.AddressMatcher".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.type.matcher.v3.AddressMatcher".into() + } +} /// A regex matcher designed for safety when used with untrusted input. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegexMatcher { @@ -113,9 +133,10 @@ impl ::prost::Name for RegexMatchAndSubstitute { /// \[#next-free-field: 9\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StringMatcher { - /// If true, indicates the exact/prefix/suffix/contains matching should be case insensitive. This - /// has no effect for the safe_regex match. - /// For example, the matcher ``data`` will match both input string ``Data`` and ``data`` if set to true. + /// If ``true``, indicates the exact/prefix/suffix/contains matching should be case insensitive. This + /// has no effect for the ``safe_regex`` match. + /// For example, the matcher ``data`` will match both input string ``Data`` and ``data`` if this option + /// is set to ``true``. #[prost(bool, tag = "6")] pub ignore_case: bool, #[prost(oneof = "string_matcher::MatchPattern", tags = "1, 2, 3, 5, 7, 8")] @@ -133,7 +154,10 @@ pub mod string_matcher { #[prost(string, tag = "1")] Exact(::prost::alloc::string::String), /// The input string must have the prefix specified here. - /// Note: empty prefix is not allowed, please use regex instead. + /// + /// .. note:: + /// + /// Empty prefix match is not allowed, please use ``safe_regex`` instead. /// /// Examples: /// @@ -141,7 +165,10 @@ pub mod string_matcher { #[prost(string, tag = "2")] Prefix(::prost::alloc::string::String), /// The input string must have the suffix specified here. - /// Note: empty prefix is not allowed, please use regex instead. + /// + /// .. note:: + /// + /// Empty suffix match is not allowed, please use ``safe_regex`` instead. /// /// Examples: /// @@ -152,7 +179,10 @@ pub mod string_matcher { #[prost(message, tag = "5")] SafeRegex(super::RegexMatcher), /// The input string must have the substring specified here. - /// Note: empty contains match is not allowed, please use regex instead. + /// + /// .. note:: + /// + /// Empty contains match is not allowed, please use ``safe_regex`` instead. /// /// Examples: /// @@ -197,7 +227,7 @@ pub struct FilterStateMatcher { /// The filter state key to retrieve the object. #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, - #[prost(oneof = "filter_state_matcher::Matcher", tags = "2")] + #[prost(oneof = "filter_state_matcher::Matcher", tags = "2, 3")] pub matcher: ::core::option::Option, } /// Nested message and enum types in `FilterStateMatcher`. @@ -207,6 +237,9 @@ pub mod filter_state_matcher { /// Matches the filter state object as a string value. #[prost(message, tag = "2")] StringMatch(super::StringMatcher), + /// Matches the filter state object as a ip Instance. + #[prost(message, tag = "3")] + AddressMatch(super::AddressMatcher), } } impl ::prost::Name for FilterStateMatcher { @@ -467,13 +500,13 @@ impl ::prost::Name for OrMatcher { /// \[#next-major-version: MetadataMatcher should use StructMatcher\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MetadataMatcher { - /// The filter name to retrieve the Struct from the Metadata. + /// The filter name to retrieve the ``Struct`` from the ``Metadata``. #[prost(string, tag = "1")] pub filter: ::prost::alloc::string::String, - /// The path to retrieve the Value from the Struct. + /// The path to retrieve the ``Value`` from the ``Struct``. #[prost(message, repeated, tag = "2")] pub path: ::prost::alloc::vec::Vec, - /// The MetadataMatcher is matched if the value retrieved by path is matched to this value. + /// The ``MetadataMatcher`` is matched if the value retrieved by path is matched to this value. #[prost(message, optional, tag = "3")] pub value: ::core::option::Option, /// If true, the match result will be inverted. @@ -482,9 +515,11 @@ pub struct MetadataMatcher { } /// Nested message and enum types in `MetadataMatcher`. pub mod metadata_matcher { - /// Specifies the segment in a path to retrieve value from Metadata. - /// Note: Currently it's not supported to retrieve a value from a list in Metadata. This means that - /// if the segment key refers to a list, it has to be the last segment in a path. + /// Specifies the segment in a path to retrieve value from ``Metadata``. + /// + /// .. note:: + /// Currently it's not supported to retrieve a value from a list in ``Metadata``. This means that + /// if the segment key refers to a list, it has to be the last segment in a path. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathSegment { #[prost(oneof = "path_segment::Segment", tags = "1")] @@ -494,7 +529,7 @@ pub mod metadata_matcher { pub mod path_segment { #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Segment { - /// If specified, use the key to retrieve the value in a Struct. + /// If specified, use the key to retrieve the value in a ``Struct``. #[prost(string, tag = "1")] Key(::prost::alloc::string::String), } diff --git a/src/generated/envoy.r#type.matcher.v3.serde.rs b/src/generated/envoy.r#type.matcher.v3.serde.rs index ab1e4fa..dc4e1de 100644 --- a/src/generated/envoy.r#type.matcher.v3.serde.rs +++ b/src/generated/envoy.r#type.matcher.v3.serde.rs @@ -1,3 +1,94 @@ +impl serde::Serialize for AddressMatcher { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.ranges.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.r#type.matcher.v3.AddressMatcher", len)?; + if !self.ranges.is_empty() { + struct_ser.serialize_field("ranges", &self.ranges)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AddressMatcher { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ranges", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ranges, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "ranges" => Ok(GeneratedField::Ranges), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AddressMatcher; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.r#type.matcher.v3.AddressMatcher") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut ranges__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Ranges => { + if ranges__.is_some() { + return Err(serde::de::Error::duplicate_field("ranges")); + } + ranges__ = Some(map_.next_value()?); + } + } + } + Ok(AddressMatcher { + ranges: ranges__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.r#type.matcher.v3.AddressMatcher", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for DoubleMatcher { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -129,6 +220,9 @@ impl serde::Serialize for FilterStateMatcher { filter_state_matcher::Matcher::StringMatch(v) => { struct_ser.serialize_field("string_match", v)?; } + filter_state_matcher::Matcher::AddressMatch(v) => { + struct_ser.serialize_field("address_match", v)?; + } } } struct_ser.end() @@ -144,12 +238,15 @@ impl<'de> serde::Deserialize<'de> for FilterStateMatcher { "key", "string_match", "stringMatch", + "address_match", + "addressMatch", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Key, StringMatch, + AddressMatch, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -173,6 +270,7 @@ impl<'de> serde::Deserialize<'de> for FilterStateMatcher { match value { "key" => Ok(GeneratedField::Key), "stringMatch" | "string_match" => Ok(GeneratedField::StringMatch), + "addressMatch" | "address_match" => Ok(GeneratedField::AddressMatch), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -207,6 +305,13 @@ impl<'de> serde::Deserialize<'de> for FilterStateMatcher { return Err(serde::de::Error::duplicate_field("stringMatch")); } matcher__ = map_.next_value::<::std::option::Option<_>>()?.map(filter_state_matcher::Matcher::StringMatch) +; + } + GeneratedField::AddressMatch => { + if matcher__.is_some() { + return Err(serde::de::Error::duplicate_field("addressMatch")); + } + matcher__ = map_.next_value::<::std::option::Option<_>>()?.map(filter_state_matcher::Matcher::AddressMatch) ; } } diff --git a/src/generated/envoy.r#type.metadata.v3.rs b/src/generated/envoy.r#type.metadata.v3.rs index a749df3..c4f1b86 100644 --- a/src/generated/envoy.r#type.metadata.v3.rs +++ b/src/generated/envoy.r#type.metadata.v3.rs @@ -1,8 +1,8 @@ // This file is @generated by prost-build. -/// MetadataKey provides a general interface using ``key`` and ``path`` to retrieve value from -/// :ref:`Metadata `. +/// MetadataKey provides a way to retrieve values from +/// :ref:`Metadata ` using a ``key`` and a ``path``. /// -/// For example, for the following Metadata: +/// For example, consider the following Metadata: /// /// .. code-block:: yaml /// @@ -13,7 +13,7 @@ /// xyz: /// hello: envoy /// -/// The following MetadataKey will retrieve a string value "bar" from the Metadata. +/// The following MetadataKey would retrieve the string value "bar" from the Metadata: /// /// .. code-block:: yaml /// @@ -24,23 +24,25 @@ /// #[derive(Clone, PartialEq, ::prost::Message)] pub struct MetadataKey { - /// The key name of Metadata to retrieve the Struct from the metadata. - /// Typically, it represents a builtin subsystem or custom extension. + /// The key name of the Metadata from which to retrieve the Struct. + /// This typically represents a builtin subsystem or custom extension. #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, - /// The path to retrieve the Value from the Struct. It can be a prefix or a full path, - /// e.g. ``\[prop, xyz\]`` for a struct or ``\[prop, foo\]`` for a string in the example, - /// which depends on the particular scenario. + /// The path used to retrieve a specific Value from the Struct. + /// This can be either a prefix or a full path, depending on the use case. + /// For example, ``\[prop, xyz\]`` would retrieve a struct or ``\[prop, foo\]`` would retrieve a string + /// in the example above. /// - /// Note: Due to that only the key type segment is supported, the path can not specify a list - /// unless the list is the last segment. + /// .. note:: + /// Since only key-type segments are supported, a path cannot specify a list + /// unless the list is the last segment. #[prost(message, repeated, tag = "2")] pub path: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `MetadataKey`. pub mod metadata_key { - /// Specifies the segment in a path to retrieve value from Metadata. - /// Currently it is only supported to specify the key, i.e. field name, as one segment of a path. + /// Specifies a segment in a path for retrieving values from Metadata. + /// Currently, only key-based segments (field names) are supported. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathSegment { #[prost(oneof = "path_segment::Segment", tags = "1")] @@ -50,7 +52,7 @@ pub mod metadata_key { pub mod path_segment { #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Segment { - /// If specified, use the key to retrieve the value in a Struct. + /// If specified, use this key to retrieve the value in a Struct. #[prost(string, tag = "1")] Key(::prost::alloc::string::String), } @@ -76,7 +78,7 @@ impl ::prost::Name for MetadataKey { "type.googleapis.com/envoy.type.metadata.v3.MetadataKey".into() } } -/// Describes what kind of metadata. +/// Describes different types of metadata sources. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MetadataKind { #[prost(oneof = "metadata_kind::Kind", tags = "1, 2, 3, 4")] diff --git a/src/generated/envoy.r#type.v3.rs b/src/generated/envoy.r#type.v3.rs index bd683e7..291695f 100644 --- a/src/generated/envoy.r#type.v3.rs +++ b/src/generated/envoy.r#type.v3.rs @@ -179,61 +179,117 @@ pub enum StatusCode { /// Empty - This code not part of the HTTP status code specification, but it is needed for proto /// `enum` type. Empty = 0, + /// Continue - ``100`` status code. Continue = 100, + /// OK - ``200`` status code. Ok = 200, + /// Created - ``201`` status code. Created = 201, + /// Accepted - ``202`` status code. Accepted = 202, + /// NonAuthoritativeInformation - ``203`` status code. NonAuthoritativeInformation = 203, + /// NoContent - ``204`` status code. NoContent = 204, + /// ResetContent - ``205`` status code. ResetContent = 205, + /// PartialContent - ``206`` status code. PartialContent = 206, + /// MultiStatus - ``207`` status code. MultiStatus = 207, + /// AlreadyReported - ``208`` status code. AlreadyReported = 208, + /// IMUsed - ``226`` status code. ImUsed = 226, + /// MultipleChoices - ``300`` status code. MultipleChoices = 300, + /// MovedPermanently - ``301`` status code. MovedPermanently = 301, + /// Found - ``302`` status code. Found = 302, + /// SeeOther - ``303`` status code. SeeOther = 303, + /// NotModified - ``304`` status code. NotModified = 304, + /// UseProxy - ``305`` status code. UseProxy = 305, + /// TemporaryRedirect - ``307`` status code. TemporaryRedirect = 307, + /// PermanentRedirect - ``308`` status code. PermanentRedirect = 308, + /// BadRequest - ``400`` status code. BadRequest = 400, + /// Unauthorized - ``401`` status code. Unauthorized = 401, + /// PaymentRequired - ``402`` status code. PaymentRequired = 402, + /// Forbidden - ``403`` status code. Forbidden = 403, + /// NotFound - ``404`` status code. NotFound = 404, + /// MethodNotAllowed - ``405`` status code. MethodNotAllowed = 405, + /// NotAcceptable - ``406`` status code. NotAcceptable = 406, + /// ProxyAuthenticationRequired - ``407`` status code. ProxyAuthenticationRequired = 407, + /// RequestTimeout - ``408`` status code. RequestTimeout = 408, + /// Conflict - ``409`` status code. Conflict = 409, + /// Gone - ``410`` status code. Gone = 410, + /// LengthRequired - ``411`` status code. LengthRequired = 411, + /// PreconditionFailed - ``412`` status code. PreconditionFailed = 412, + /// PayloadTooLarge - ``413`` status code. PayloadTooLarge = 413, + /// URITooLong - ``414`` status code. UriTooLong = 414, + /// UnsupportedMediaType - ``415`` status code. UnsupportedMediaType = 415, + /// RangeNotSatisfiable - ``416`` status code. RangeNotSatisfiable = 416, + /// ExpectationFailed - ``417`` status code. ExpectationFailed = 417, + /// MisdirectedRequest - ``421`` status code. MisdirectedRequest = 421, + /// UnprocessableEntity - ``422`` status code. UnprocessableEntity = 422, + /// Locked - ``423`` status code. Locked = 423, + /// FailedDependency - ``424`` status code. FailedDependency = 424, + /// UpgradeRequired - ``426`` status code. UpgradeRequired = 426, + /// PreconditionRequired - ``428`` status code. PreconditionRequired = 428, + /// TooManyRequests - ``429`` status code. TooManyRequests = 429, + /// RequestHeaderFieldsTooLarge - ``431`` status code. RequestHeaderFieldsTooLarge = 431, + /// InternalServerError - ``500`` status code. InternalServerError = 500, + /// NotImplemented - ``501`` status code. NotImplemented = 501, + /// BadGateway - ``502`` status code. BadGateway = 502, + /// ServiceUnavailable - ``503`` status code. ServiceUnavailable = 503, + /// GatewayTimeout - ``504`` status code. GatewayTimeout = 504, + /// HTTPVersionNotSupported - ``505`` status code. HttpVersionNotSupported = 505, + /// VariantAlsoNegotiates - ``506`` status code. VariantAlsoNegotiates = 506, + /// InsufficientStorage - ``507`` status code. InsufficientStorage = 507, + /// LoopDetected - ``508`` status code. LoopDetected = 508, + /// NotExtended - ``510`` status code. NotExtended = 510, + /// NetworkAuthenticationRequired - ``511`` status code. NetworkAuthenticationRequired = 511, } impl StatusCode { diff --git a/src/generated/envoy.service.accesslog.v3.rs b/src/generated/envoy.service.accesslog.v3.rs index 249e90d..379f553 100644 --- a/src/generated/envoy.service.accesslog.v3.rs +++ b/src/generated/envoy.service.accesslog.v3.rs @@ -128,7 +128,7 @@ pub mod access_log_service_client { } impl AccessLogServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -149,13 +149,13 @@ pub mod access_log_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { AccessLogServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -323,7 +323,7 @@ pub mod access_log_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -385,7 +385,9 @@ pub mod access_log_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.auth.v3.rs b/src/generated/envoy.service.auth.v3.rs index 56f570f..3b8df22 100644 --- a/src/generated/envoy.service.auth.v3.rs +++ b/src/generated/envoy.service.auth.v3.rs @@ -6,7 +6,7 @@ /// of the ``AttributeContext``. The ``AttributeContext`` is a collection of individual attributes /// supported by Envoy authorization system. /// [#comment: The following items are left out of this proto -/// Request.Auth field for jwt tokens +/// Request.Auth field for JWTs /// Request.Api for api management /// Origin peer that originated the request /// Caching Protocol @@ -448,7 +448,7 @@ pub mod authorization_client { } impl AuthorizationClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -469,13 +469,13 @@ pub mod authorization_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { AuthorizationClient::new(InterceptedService::new(inner, interceptor)) @@ -623,7 +623,7 @@ pub mod authorization_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -680,7 +680,9 @@ pub mod authorization_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.cluster.v3.rs b/src/generated/envoy.service.cluster.v3.rs index add8d5f..c2ad821 100644 --- a/src/generated/envoy.service.cluster.v3.rs +++ b/src/generated/envoy.service.cluster.v3.rs @@ -31,7 +31,7 @@ pub mod cluster_discovery_service_client { } impl ClusterDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -52,13 +52,13 @@ pub mod cluster_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { ClusterDiscoveryServiceClient::new( @@ -325,7 +325,7 @@ pub mod cluster_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -500,7 +500,9 @@ pub mod cluster_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.discovery.v3.rs b/src/generated/envoy.service.discovery.v3.rs index ec43e5b..277669d 100644 --- a/src/generated/envoy.service.discovery.v3.rs +++ b/src/generated/envoy.service.discovery.v3.rs @@ -47,17 +47,41 @@ impl ::prost::Name for ResourceName { "type.googleapis.com/envoy.service.discovery.v3.ResourceName".into() } } +/// \[#not-implemented-hide:\] +/// An error associated with a specific resource name, returned to the +/// client by the server. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceError { + /// The name of the resource. + #[prost(message, optional, tag = "1")] + pub resource_name: ::core::option::Option, + /// The error reported for the resource. + #[prost(message, optional, tag = "2")] + pub error_detail: ::core::option::Option< + super::super::super::super::google::rpc::Status, + >, +} +impl ::prost::Name for ResourceError { + const NAME: &'static str = "ResourceError"; + const PACKAGE: &'static str = "envoy.service.discovery.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.service.discovery.v3.ResourceError".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.service.discovery.v3.ResourceError".into() + } +} /// A DiscoveryRequest requests a set of versioned resources of the same type for /// a given Envoy node on some API. /// \[#next-free-field: 8\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DiscoveryRequest { - /// The version_info provided in the request messages will be the version_info + /// The ``version_info`` provided in the request messages will be the ``version_info`` /// received with the most recent successfully processed response or empty on /// the first request. It is expected that no new request is sent after a /// response is received until the Envoy instance is ready to ACK/NACK the new /// configuration. ACK/NACK takes place by returning the new API config version - /// as applied or the previous API config version respectively. Each type_url + /// as applied or the previous API config version respectively. Each ``type_url`` /// (see below) has an independent version associated with it. #[prost(string, tag = "1")] pub version_info: ::prost::alloc::string::String, @@ -66,10 +90,10 @@ pub struct DiscoveryRequest { pub node: ::core::option::Option, /// List of resources to subscribe to, e.g. list of cluster names or a route /// configuration name. If this is empty, all resources for the API are - /// returned. LDS/CDS may have empty resource_names, which will cause all + /// returned. LDS/CDS may have empty ``resource_names``, which will cause all /// resources for the Envoy instance to be returned. The LDS and CDS responses /// will then imply a number of resources that need to be fetched via EDS/RDS, - /// which will be explicitly enumerated in resource_names. + /// which will be explicitly enumerated in ``resource_names``. #[prost(string, repeated, tag = "3")] pub resource_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// \[#not-implemented-hide:\] @@ -77,21 +101,27 @@ pub struct DiscoveryRequest { /// parameters along with each resource name. Clients that populate this /// field must be able to handle responses from the server where resources /// are wrapped in a Resource message. - /// Note that it is legal for a request to have some resources listed - /// in ``resource_names`` and others in ``resource_locators``. + /// + /// .. note:: + /// It is legal for a request to have some resources listed + /// in ``resource_names`` and others in ``resource_locators``. + /// #[prost(message, repeated, tag = "7")] pub resource_locators: ::prost::alloc::vec::Vec, /// Type of the resource that is being requested, e.g. - /// "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit + /// ``type.googleapis.com/envoy.api.v2.ClusterLoadAssignment``. This is implicit /// in requests made via singleton xDS APIs such as CDS, LDS, etc. but is /// required for ADS. #[prost(string, tag = "4")] pub type_url: ::prost::alloc::string::String, - /// nonce corresponding to DiscoveryResponse being ACK/NACKed. See above - /// discussion on version_info and the DiscoveryResponse nonce comment. This - /// may be empty only if 1) this is a non-persistent-stream xDS such as HTTP, - /// or 2) the client has not yet accepted an update in this xDS stream (unlike - /// delta, where it is populated only for new explicit ACKs). + /// nonce corresponding to ``DiscoveryResponse`` being ACK/NACKed. See above + /// discussion on ``version_info`` and the ``DiscoveryResponse`` nonce comment. This + /// may be empty only if: + /// + /// * This is a non-persistent-stream xDS such as HTTP, or + /// * The client has not yet accepted an update in this xDS stream (unlike + /// delta, where it is populated only for new explicit ACKs). + /// #[prost(string, tag = "5")] pub response_nonce: ::prost::alloc::string::String, /// This is populated when the previous :ref:`DiscoveryResponse ` @@ -113,7 +143,7 @@ impl ::prost::Name for DiscoveryRequest { "type.googleapis.com/envoy.service.discovery.v3.DiscoveryRequest".into() } } -/// \[#next-free-field: 7\] +/// \[#next-free-field: 8\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DiscoveryResponse { /// The version of the response data. @@ -127,30 +157,34 @@ pub struct DiscoveryResponse { /// \[#not-implemented-hide:\] /// Canary is used to support two Envoy command line flags: /// - /// * --terminate-on-canary-transition-failure. When set, Envoy is able to + /// * ``--terminate-on-canary-transition-failure``. When set, Envoy is able to /// terminate if it detects that configuration is stuck at canary. Consider /// this example sequence of updates: - /// - Management server applies a canary config successfully. - /// - Management server rolls back to a production config. - /// - Envoy rejects the new production config. + /// + /// * Management server applies a canary config successfully. + /// * Management server rolls back to a production config. + /// * Envoy rejects the new production config. + /// /// Since there is no sensible way to continue receiving configuration /// updates, Envoy will then terminate and apply production config from a /// clean slate. - /// * --dry-run-canary. When set, a canary response will never be applied, only + /// + /// * ``--dry-run-canary``. When set, a canary response will never be applied, only /// validated via a dry run. + /// #[prost(bool, tag = "3")] pub canary: bool, /// Type URL for resources. Identifies the xDS API when muxing over ADS. - /// Must be consistent with the type_url in the 'resources' repeated Any (if non-empty). + /// Must be consistent with the ``type_url`` in the 'resources' repeated Any (if non-empty). #[prost(string, tag = "4")] pub type_url: ::prost::alloc::string::String, /// For gRPC based subscriptions, the nonce provides a way to explicitly ack a - /// specific DiscoveryResponse in a following DiscoveryRequest. Additional + /// specific ``DiscoveryResponse`` in a following ``DiscoveryRequest``. Additional /// messages may have been sent by Envoy to the management server for the - /// previous version on the stream prior to this DiscoveryResponse, that were + /// previous version on the stream prior to this ``DiscoveryResponse``, that were /// unprocessed at response send time. The nonce allows the management server - /// to ignore any further DiscoveryRequests for the previous version until a - /// DiscoveryRequest bearing the nonce. The nonce is optional and is not + /// to ignore any further ``DiscoveryRequests`` for the previous version until a + /// ``DiscoveryRequest`` bearing the nonce. The nonce is optional and is not /// required for non-stream based xDS implementations. #[prost(string, tag = "5")] pub nonce: ::prost::alloc::string::String, @@ -159,6 +193,13 @@ pub struct DiscoveryResponse { pub control_plane: ::core::option::Option< super::super::super::config::core::v3::ControlPlane, >, + /// \[#not-implemented-hide:\] + /// Errors associated with specific resources. Clients are expected to + /// remember the most recent error for a given resource across responses; + /// the error condition is not considered to be cleared until a response is + /// received that contains the resource in the 'resources' field. + #[prost(message, repeated, tag = "7")] + pub resource_errors: ::prost::alloc::vec::Vec, } impl ::prost::Name for DiscoveryResponse { const NAME: &'static str = "DiscoveryResponse"; @@ -183,25 +224,28 @@ impl ::prost::Name for DiscoveryResponse { /// connected to it. /// /// In Delta xDS the nonce field is required and used to pair -/// DeltaDiscoveryResponse to a DeltaDiscoveryRequest ACK or NACK. -/// Optionally, a response message level system_version_info is present for +/// ``DeltaDiscoveryResponse`` to a ``DeltaDiscoveryRequest`` ACK or NACK. +/// Optionally, a response message level ``system_version_info`` is present for /// debugging purposes only. /// -/// DeltaDiscoveryRequest plays two independent roles. Any DeltaDiscoveryRequest -/// can be either or both of: \[1\] informing the server of what resources the -/// client has gained/lost interest in (using resource_names_subscribe and -/// resource_names_unsubscribe), or \[2\] (N)ACKing an earlier resource update from -/// the server (using response_nonce, with presence of error_detail making it a NACK). -/// Additionally, the first message (for a given type_url) of a reconnected gRPC stream +/// ``DeltaDiscoveryRequest`` plays two independent roles. Any ``DeltaDiscoveryRequest`` +/// can be either or both of: +/// +/// * Informing the server of what resources the client has gained/lost interest in +/// (using ``resource_names_subscribe`` and ``resource_names_unsubscribe``), or +/// * (N)ACKing an earlier resource update from the server (using ``response_nonce``, +/// with presence of ``error_detail`` making it a NACK). +/// +/// Additionally, the first message (for a given ``type_url``) of a reconnected gRPC stream /// has a third role: informing the server of the resources (and their versions) -/// that the client already possesses, using the initial_resource_versions field. +/// that the client already possesses, using the ``initial_resource_versions`` field. /// /// As with state-of-the-world, when multiple resource types are multiplexed (ADS), -/// all requests/acknowledgments/updates are logically walled off by type_url: +/// all requests/acknowledgments/updates are logically walled off by ``type_url``: /// a Cluster ACK exists in a completely separate world from a prior Route NACK. -/// In particular, initial_resource_versions being sent at the "start" of every -/// gRPC stream actually entails a message for each type_url, each with its own -/// initial_resource_versions. +/// In particular, ``initial_resource_versions`` being sent at the "start" of every +/// gRPC stream actually entails a message for each ``type_url``, each with its own +/// ``initial_resource_versions``. /// \[#next-free-field: 10\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeltaDiscoveryRequest { @@ -216,23 +260,24 @@ pub struct DeltaDiscoveryRequest { pub type_url: ::prost::alloc::string::String, /// DeltaDiscoveryRequests allow the client to add or remove individual /// resources to the set of tracked resources in the context of a stream. - /// All resource names in the resource_names_subscribe list are added to the - /// set of tracked resources and all resource names in the resource_names_unsubscribe + /// All resource names in the ``resource_names_subscribe`` list are added to the + /// set of tracked resources and all resource names in the ``resource_names_unsubscribe`` /// list are removed from the set of tracked resources. /// - /// *Unlike* state-of-the-world xDS, an empty resource_names_subscribe or - /// resource_names_unsubscribe list simply means that no resources are to be + /// *Unlike* state-of-the-world xDS, an empty ``resource_names_subscribe`` or + /// ``resource_names_unsubscribe`` list simply means that no resources are to be /// added or removed to the resource list. /// *Like* state-of-the-world xDS, the server must send updates for all tracked /// resources, but can also send updates for resources the client has not subscribed to. /// - /// NOTE: the server must respond with all resources listed in resource_names_subscribe, - /// even if it believes the client has the most recent version of them. The reason: - /// the client may have dropped them, but then regained interest before it had a chance - /// to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd. + /// .. note:: + /// The server must respond with all resources listed in ``resource_names_subscribe``, + /// even if it believes the client has the most recent version of them. The reason: + /// the client may have dropped them, but then regained interest before it had a chance + /// to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd. /// - /// These two fields can be set in any DeltaDiscoveryRequest, including ACKs - /// and initial_resource_versions. + /// These two fields can be set in any ``DeltaDiscoveryRequest``, including ACKs + /// and ``initial_resource_versions``. /// /// A list of Resource names to add to the list of tracked resources. #[prost(string, repeated, tag = "3")] @@ -247,23 +292,32 @@ pub struct DeltaDiscoveryRequest { /// \[#not-implemented-hide:\] /// Alternative to ``resource_names_subscribe`` field that allows specifying dynamic parameters /// along with each resource name. - /// Note that it is legal for a request to have some resources listed - /// in ``resource_names_subscribe`` and others in ``resource_locators_subscribe``. + /// + /// .. note:: + /// It is legal for a request to have some resources listed + /// in ``resource_names_subscribe`` and others in ``resource_locators_subscribe``. + /// #[prost(message, repeated, tag = "8")] pub resource_locators_subscribe: ::prost::alloc::vec::Vec, /// \[#not-implemented-hide:\] /// Alternative to ``resource_names_unsubscribe`` field that allows specifying dynamic parameters /// along with each resource name. - /// Note that it is legal for a request to have some resources listed - /// in ``resource_names_unsubscribe`` and others in ``resource_locators_unsubscribe``. + /// + /// .. note:: + /// It is legal for a request to have some resources listed + /// in ``resource_names_unsubscribe`` and others in ``resource_locators_unsubscribe``. + /// #[prost(message, repeated, tag = "9")] pub resource_locators_unsubscribe: ::prost::alloc::vec::Vec, /// Informs the server of the versions of the resources the xDS client knows of, to enable the /// client to continue the same logical xDS session even in the face of gRPC stream reconnection. - /// It will not be populated: \[1\] in the very first stream of a session, since the client will - /// not yet have any resources, \[2\] in any message after the first in a stream (for a given - /// type_url), since the server will already be correctly tracking the client's state. - /// (In ADS, the first message *of each type_url* of a reconnected stream populates this map.) + /// It will not be populated: + /// + /// * In the very first stream of a session, since the client will not yet have any resources. + /// * In any message after the first in a stream (for a given ``type_url``), since the server will + /// already be correctly tracking the client's state. + /// + /// (In ADS, the first message ``of each type_url`` of a reconnected stream populates this map.) /// The map's keys are names of xDS resources known to the xDS client. /// The map's values are opaque resource versions. #[prost(map = "string, string", tag = "5")] @@ -271,10 +325,10 @@ pub struct DeltaDiscoveryRequest { ::prost::alloc::string::String, ::prost::alloc::string::String, >, - /// When the DeltaDiscoveryRequest is a ACK or NACK message in response - /// to a previous DeltaDiscoveryResponse, the response_nonce must be the - /// nonce in the DeltaDiscoveryResponse. - /// Otherwise (unlike in DiscoveryRequest) response_nonce must be omitted. + /// When the ``DeltaDiscoveryRequest`` is a ACK or NACK message in response + /// to a previous ``DeltaDiscoveryResponse``, the ``response_nonce`` must be the + /// nonce in the ``DeltaDiscoveryResponse``. + /// Otherwise (unlike in ``DiscoveryRequest``) ``response_nonce`` must be omitted. #[prost(string, tag = "6")] pub response_nonce: ::prost::alloc::string::String, /// This is populated when the previous :ref:`DiscoveryResponse ` @@ -295,31 +349,31 @@ impl ::prost::Name for DeltaDiscoveryRequest { "type.googleapis.com/envoy.service.discovery.v3.DeltaDiscoveryRequest".into() } } -/// \[#next-free-field: 9\] +/// \[#next-free-field: 10\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeltaDiscoveryResponse { /// The version of the response data (used for debugging). #[prost(string, tag = "1")] pub system_version_info: ::prost::alloc::string::String, /// The response resources. These are typed resources, whose types must match - /// the type_url field. + /// the ``type_url`` field. #[prost(message, repeated, tag = "2")] pub resources: ::prost::alloc::vec::Vec, /// Type URL for resources. Identifies the xDS API when muxing over ADS. - /// Must be consistent with the type_url in the Any within 'resources' if 'resources' is non-empty. + /// Must be consistent with the ``type_url`` in the Any within 'resources' if 'resources' is non-empty. #[prost(string, tag = "4")] pub type_url: ::prost::alloc::string::String, - /// Resources names of resources that have be deleted and to be removed from the xDS Client. + /// Resource names of resources that have been deleted and to be removed from the xDS Client. /// Removed resources for missing resources can be ignored. #[prost(string, repeated, tag = "6")] pub removed_resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Alternative to removed_resources that allows specifying which variant of + /// Alternative to ``removed_resources`` that allows specifying which variant of /// a resource is being removed. This variant must be used for any resource /// for which dynamic parameter constraints were sent to the client. #[prost(message, repeated, tag = "8")] pub removed_resource_names: ::prost::alloc::vec::Vec, - /// The nonce provides a way for DeltaDiscoveryRequests to uniquely - /// reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. + /// The nonce provides a way for ``DeltaDiscoveryRequests`` to uniquely + /// reference a ``DeltaDiscoveryResponse`` when (N)ACKing. The nonce is required. #[prost(string, tag = "5")] pub nonce: ::prost::alloc::string::String, /// \[#not-implemented-hide:\] @@ -328,6 +382,15 @@ pub struct DeltaDiscoveryResponse { pub control_plane: ::core::option::Option< super::super::super::config::core::v3::ControlPlane, >, + /// \[#not-implemented-hide:\] + /// Errors associated with specific resources. + /// + /// .. note:: + /// A resource in this field with a status of NOT_FOUND should be treated the same as + /// a resource listed in the ``removed_resources`` or ``removed_resource_names`` fields. + /// + #[prost(message, repeated, tag = "9")] + pub resource_errors: ::prost::alloc::vec::Vec, } impl ::prost::Name for DeltaDiscoveryResponse { const NAME: &'static str = "DeltaDiscoveryResponse"; @@ -342,7 +405,7 @@ impl ::prost::Name for DeltaDiscoveryResponse { /// A set of dynamic parameter constraints associated with a variant of an individual xDS resource. /// These constraints determine whether the resource matches a subscription based on the set of /// dynamic parameters in the subscription, as specified in the -/// :ref:`ResourceLocator.dynamic_parameters` +/// :ref:`ResourceLocator.dynamic_parameters ` /// field. This allows xDS implementations (clients, servers, and caching proxies) to determine /// which variant of a resource is appropriate for a given client. #[derive(Clone, PartialEq, ::prost::Message)] @@ -478,7 +541,7 @@ pub struct Resource { /// configuration for the resource will be removed. /// /// The TTL can be refreshed or changed by sending a response that doesn't change the resource - /// version. In this case the resource field does not need to be populated, which allows for + /// version. In this case the ``resource`` field does not need to be populated, which allows for /// light-weight "heartbeat" updates to keep a resource with a TTL alive. /// /// The TTL feature is meant to support configurations that should be removed in the event of @@ -507,8 +570,11 @@ pub mod resource { #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CacheControl { /// If true, xDS proxies may not cache this resource. - /// Note that this does not apply to clients other than xDS proxies, which must cache resources - /// for their own use, regardless of the value of this field. + /// + /// .. note:: + /// This does not apply to clients other than xDS proxies, which must cache resources + /// for their own use, regardless of the value of this field. + /// #[prost(bool, tag = "1")] pub do_not_cache: bool, } @@ -570,7 +636,7 @@ pub mod aggregated_discovery_service_client { } impl AggregatedDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -591,13 +657,13 @@ pub mod aggregated_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { AggregatedDiscoveryServiceClient::new( @@ -811,7 +877,7 @@ pub mod aggregated_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -932,7 +998,9 @@ pub mod aggregated_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.discovery.v3.serde.rs b/src/generated/envoy.service.discovery.v3.serde.rs index e2df3a0..17aef6a 100644 --- a/src/generated/envoy.service.discovery.v3.serde.rs +++ b/src/generated/envoy.service.discovery.v3.serde.rs @@ -335,6 +335,9 @@ impl serde::Serialize for DeltaDiscoveryResponse { if self.control_plane.is_some() { len += 1; } + if !self.resource_errors.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.service.discovery.v3.DeltaDiscoveryResponse", len)?; if !self.system_version_info.is_empty() { struct_ser.serialize_field("system_version_info", &self.system_version_info)?; @@ -357,6 +360,9 @@ impl serde::Serialize for DeltaDiscoveryResponse { if let Some(v) = self.control_plane.as_ref() { struct_ser.serialize_field("control_plane", v)?; } + if !self.resource_errors.is_empty() { + struct_ser.serialize_field("resource_errors", &self.resource_errors)?; + } struct_ser.end() } } @@ -379,6 +385,8 @@ impl<'de> serde::Deserialize<'de> for DeltaDiscoveryResponse { "nonce", "control_plane", "controlPlane", + "resource_errors", + "resourceErrors", ]; #[allow(clippy::enum_variant_names)] @@ -390,6 +398,7 @@ impl<'de> serde::Deserialize<'de> for DeltaDiscoveryResponse { RemovedResourceNames, Nonce, ControlPlane, + ResourceErrors, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -418,6 +427,7 @@ impl<'de> serde::Deserialize<'de> for DeltaDiscoveryResponse { "removedResourceNames" | "removed_resource_names" => Ok(GeneratedField::RemovedResourceNames), "nonce" => Ok(GeneratedField::Nonce), "controlPlane" | "control_plane" => Ok(GeneratedField::ControlPlane), + "resourceErrors" | "resource_errors" => Ok(GeneratedField::ResourceErrors), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -444,6 +454,7 @@ impl<'de> serde::Deserialize<'de> for DeltaDiscoveryResponse { let mut removed_resource_names__ = None; let mut nonce__ = None; let mut control_plane__ = None; + let mut resource_errors__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SystemVersionInfo => { @@ -488,6 +499,12 @@ impl<'de> serde::Deserialize<'de> for DeltaDiscoveryResponse { } control_plane__ = map_.next_value()?; } + GeneratedField::ResourceErrors => { + if resource_errors__.is_some() { + return Err(serde::de::Error::duplicate_field("resourceErrors")); + } + resource_errors__ = Some(map_.next_value()?); + } } } Ok(DeltaDiscoveryResponse { @@ -498,6 +515,7 @@ impl<'de> serde::Deserialize<'de> for DeltaDiscoveryResponse { removed_resource_names: removed_resource_names__.unwrap_or_default(), nonce: nonce__.unwrap_or_default(), control_plane: control_plane__, + resource_errors: resource_errors__.unwrap_or_default(), }) } } @@ -729,6 +747,9 @@ impl serde::Serialize for DiscoveryResponse { if self.control_plane.is_some() { len += 1; } + if !self.resource_errors.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("envoy.service.discovery.v3.DiscoveryResponse", len)?; if !self.version_info.is_empty() { struct_ser.serialize_field("version_info", &self.version_info)?; @@ -748,6 +769,9 @@ impl serde::Serialize for DiscoveryResponse { if let Some(v) = self.control_plane.as_ref() { struct_ser.serialize_field("control_plane", v)?; } + if !self.resource_errors.is_empty() { + struct_ser.serialize_field("resource_errors", &self.resource_errors)?; + } struct_ser.end() } } @@ -767,6 +791,8 @@ impl<'de> serde::Deserialize<'de> for DiscoveryResponse { "nonce", "control_plane", "controlPlane", + "resource_errors", + "resourceErrors", ]; #[allow(clippy::enum_variant_names)] @@ -777,6 +803,7 @@ impl<'de> serde::Deserialize<'de> for DiscoveryResponse { TypeUrl, Nonce, ControlPlane, + ResourceErrors, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -804,6 +831,7 @@ impl<'de> serde::Deserialize<'de> for DiscoveryResponse { "typeUrl" | "type_url" => Ok(GeneratedField::TypeUrl), "nonce" => Ok(GeneratedField::Nonce), "controlPlane" | "control_plane" => Ok(GeneratedField::ControlPlane), + "resourceErrors" | "resource_errors" => Ok(GeneratedField::ResourceErrors), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -829,6 +857,7 @@ impl<'de> serde::Deserialize<'de> for DiscoveryResponse { let mut type_url__ = None; let mut nonce__ = None; let mut control_plane__ = None; + let mut resource_errors__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::VersionInfo => { @@ -867,6 +896,12 @@ impl<'de> serde::Deserialize<'de> for DiscoveryResponse { } control_plane__ = map_.next_value()?; } + GeneratedField::ResourceErrors => { + if resource_errors__.is_some() { + return Err(serde::de::Error::duplicate_field("resourceErrors")); + } + resource_errors__ = Some(map_.next_value()?); + } } } Ok(DiscoveryResponse { @@ -876,6 +911,7 @@ impl<'de> serde::Deserialize<'de> for DiscoveryResponse { type_url: type_url__.unwrap_or_default(), nonce: nonce__.unwrap_or_default(), control_plane: control_plane__, + resource_errors: resource_errors__.unwrap_or_default(), }) } } @@ -1611,6 +1647,116 @@ impl<'de> serde::Deserialize<'de> for resource::CacheControl { deserializer.deserialize_struct("envoy.service.discovery.v3.Resource.CacheControl", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for ResourceError { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.resource_name.is_some() { + len += 1; + } + if self.error_detail.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.discovery.v3.ResourceError", len)?; + if let Some(v) = self.resource_name.as_ref() { + struct_ser.serialize_field("resource_name", v)?; + } + if let Some(v) = self.error_detail.as_ref() { + struct_ser.serialize_field("error_detail", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ResourceError { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "resource_name", + "resourceName", + "error_detail", + "errorDetail", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ResourceName, + ErrorDetail, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "resourceName" | "resource_name" => Ok(GeneratedField::ResourceName), + "errorDetail" | "error_detail" => Ok(GeneratedField::ErrorDetail), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ResourceError; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.discovery.v3.ResourceError") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut resource_name__ = None; + let mut error_detail__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ResourceName => { + if resource_name__.is_some() { + return Err(serde::de::Error::duplicate_field("resourceName")); + } + resource_name__ = map_.next_value()?; + } + GeneratedField::ErrorDetail => { + if error_detail__.is_some() { + return Err(serde::de::Error::duplicate_field("errorDetail")); + } + error_detail__ = map_.next_value()?; + } + } + } + Ok(ResourceError { + resource_name: resource_name__, + error_detail: error_detail__, + }) + } + } + deserializer.deserialize_struct("envoy.service.discovery.v3.ResourceError", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for ResourceLocator { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.service.endpoint.v3.rs b/src/generated/envoy.service.endpoint.v3.rs index 3fb4293..e2c0b65 100644 --- a/src/generated/envoy.service.endpoint.v3.rs +++ b/src/generated/envoy.service.endpoint.v3.rs @@ -30,7 +30,7 @@ pub mod endpoint_discovery_service_client { } impl EndpointDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -51,13 +51,13 @@ pub mod endpoint_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { EndpointDiscoveryServiceClient::new( @@ -327,7 +327,7 @@ pub mod endpoint_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -502,7 +502,9 @@ pub mod endpoint_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( @@ -569,7 +571,7 @@ pub mod locality_endpoint_discovery_service_client { } impl LocalityEndpointDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -590,13 +592,13 @@ pub mod locality_endpoint_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { LocalityEndpointDiscoveryServiceClient::new( @@ -775,7 +777,7 @@ pub mod locality_endpoint_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -847,7 +849,9 @@ pub mod locality_endpoint_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.event_reporting.v3.rs b/src/generated/envoy.service.event_reporting.v3.rs index 6a1abf0..d1589a6 100644 --- a/src/generated/envoy.service.event_reporting.v3.rs +++ b/src/generated/envoy.service.event_reporting.v3.rs @@ -90,7 +90,7 @@ pub mod event_reporting_service_client { } impl EventReportingServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -111,13 +111,13 @@ pub mod event_reporting_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { EventReportingServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -288,7 +288,7 @@ pub mod event_reporting_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -350,7 +350,9 @@ pub mod event_reporting_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.ext_proc.v3.rs b/src/generated/envoy.service.ext_proc.v3.rs index 5068df8..a12b204 100644 --- a/src/generated/envoy.service.ext_proc.v3.rs +++ b/src/generated/envoy.service.ext_proc.v3.rs @@ -1,7 +1,44 @@ // This file is @generated by prost-build. +/// This message specifies the filter protocol configurations which will be sent to the ext_proc +/// server in a :ref:`ProcessingRequest `. +/// If the server does not support these protocol configurations, it may choose to close the gRPC stream. +/// If the server supports these protocol configurations, it should respond based on the API specifications. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ProtocolConfiguration { + /// Specify the filter configuration :ref:`request_body_mode + /// ` + #[prost( + enumeration = "super::super::super::extensions::filters::http::ext_proc::v3::processing_mode::BodySendMode", + tag = "1" + )] + pub request_body_mode: i32, + /// Specify the filter configuration :ref:`response_body_mode + /// ` + #[prost( + enumeration = "super::super::super::extensions::filters::http::ext_proc::v3::processing_mode::BodySendMode", + tag = "2" + )] + pub response_body_mode: i32, + /// Specify the filter configuration :ref:`send_body_without_waiting_for_header_response + /// ` + /// If the client is waiting for a header response from the server, setting ``true`` means the client will send body to the server + /// as they arrive. Setting ``false`` means the client will buffer the arrived data and not send it to the server immediately. + #[prost(bool, tag = "3")] + pub send_body_without_waiting_for_header_response: bool, +} +impl ::prost::Name for ProtocolConfiguration { + const NAME: &'static str = "ProtocolConfiguration"; + const PACKAGE: &'static str = "envoy.service.ext_proc.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.service.ext_proc.v3.ProtocolConfiguration".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.service.ext_proc.v3.ProtocolConfiguration".into() + } +} /// This represents the different types of messages that Envoy can send /// to an external processing server. -/// \[#next-free-field: 11\] +/// \[#next-free-field: 12\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProcessingRequest { /// Dynamic metadata associated with the request. @@ -31,6 +68,10 @@ pub struct ProcessingRequest { /// #[prost(bool, tag = "10")] pub observability_mode: bool, + /// Specify the filter protocol configurations to be sent to the server. + /// ``protocol_config`` is only encoded in the first ``ProcessingRequest`` message from the client to the server. + #[prost(message, optional, tag = "11")] + pub protocol_config: ::core::option::Option, /// Each request message will include one of the following sub-messages. Which /// ones are set for a particular HTTP request/response depend on the /// processing mode. @@ -88,8 +129,15 @@ impl ::prost::Name for ProcessingRequest { "type.googleapis.com/envoy.service.ext_proc.v3.ProcessingRequest".into() } } -/// For every ProcessingRequest received by the server with the ``observability_mode`` field -/// set to false, the server must send back exactly one ProcessingResponse message. +/// This represents the different types of messages the server may send back to Envoy +/// when the ``observability_mode`` field in the received ProcessingRequest is set to false. +/// +/// * If the corresponding ``BodySendMode`` in the +/// :ref:`processing_mode ` +/// is not set to ``FULL_DUPLEX_STREAMED``, then for every received ProcessingRequest, +/// the server must send back exactly one ProcessingResponse message. +/// * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined +/// for this mode to send the ProcessingResponse messages. /// \[#next-free-field: 11\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProcessingResponse { @@ -109,7 +157,10 @@ pub struct ProcessingResponse { /// It is also ignored by Envoy when the ext_proc filter config /// :ref:`allow_mode_override /// ` - /// is set to false. + /// is set to false, or + /// :ref:`send_body_without_waiting_for_header_response + /// ` + /// is set to true. #[prost(message, optional, tag = "9")] pub mode_override: ::core::option::Option< super::super::super::extensions::filters::http::ext_proc::v3::ProcessingMode, @@ -131,11 +182,13 @@ pub struct ProcessingResponse { pub override_message_timeout: ::core::option::Option< super::super::super::super::google::protobuf::Duration, >, + /// The response type that is sent by the server. #[prost(oneof = "processing_response::Response", tags = "1, 2, 3, 4, 5, 6, 7")] pub response: ::core::option::Option, } /// Nested message and enum types in `ProcessingResponse`. pub mod processing_response { + /// The response type that is sent by the server. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { /// The server must send back this message in response to a message with the @@ -189,12 +242,8 @@ impl ::prost::Name for ProcessingResponse { pub struct HttpHeaders { /// The HTTP request headers. All header keys will be /// lower-cased, because HTTP header keys are case-insensitive. - /// The ``headers`` encoding is based on the runtime guard - /// envoy_reloadable_features_send_header_raw_value setting. - /// When it is true, the header value is encoded in the + /// The header value is encoded in the /// :ref:`raw_value ` field. - /// When it is false, the header value is encoded in the - /// :ref:`value ` field. #[prost(message, optional, tag = "1")] pub headers: ::core::option::Option< super::super::super::config::core::v3::HeaderMap, @@ -208,7 +257,7 @@ pub struct HttpHeaders { ::prost::alloc::string::String, super::super::super::super::google::protobuf::Struct, >, - /// If true, then there is no message body associated with this + /// If ``true``, then there is no message body associated with this /// request or response. #[prost(bool, tag = "3")] pub end_of_stream: bool, @@ -223,11 +272,16 @@ impl ::prost::Name for HttpHeaders { "type.googleapis.com/envoy.service.ext_proc.v3.HttpHeaders".into() } } -/// This message contains the message body that Envoy sends to the external server. +/// This message is sent to the external server when the HTTP request and +/// response bodies are received. #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpBody { + /// The contents of the body in the HTTP request/response. Note that in + /// streaming mode multiple ``HttpBody`` messages may be sent. #[prost(bytes = "vec", tag = "1")] pub body: ::prost::alloc::vec::Vec, + /// If ``true``, this will be the last ``HttpBody`` message that will be sent and no + /// trailers will be sent for the current request/response. #[prost(bool, tag = "2")] pub end_of_stream: bool, } @@ -241,15 +295,12 @@ impl ::prost::Name for HttpBody { "type.googleapis.com/envoy.service.ext_proc.v3.HttpBody".into() } } -/// This message contains the trailers. +/// This message is sent to the external server when the HTTP request and +/// response trailers are received. #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpTrailers { - /// The ``trailers`` encoding is based on the runtime guard - /// envoy_reloadable_features_send_header_raw_value setting. - /// When it is true, the header value is encoded in the + /// The header value is encoded in the /// :ref:`raw_value ` field. - /// When it is false, the header value is encoded in the - /// :ref:`value ` field. #[prost(message, optional, tag = "1")] pub trailers: ::core::option::Option< super::super::super::config::core::v3::HeaderMap, @@ -265,9 +316,12 @@ impl ::prost::Name for HttpTrailers { "type.googleapis.com/envoy.service.ext_proc.v3.HttpTrailers".into() } } -/// This message must be sent in response to an HttpHeaders message. +/// This message is sent by the external server to Envoy after ``HttpHeaders`` was +/// sent to it. #[derive(Clone, PartialEq, ::prost::Message)] pub struct HeadersResponse { + /// Details the modifications (if any) to be made by Envoy to the current + /// request/response. #[prost(message, optional, tag = "1")] pub response: ::core::option::Option, } @@ -281,37 +335,42 @@ impl ::prost::Name for HeadersResponse { "type.googleapis.com/envoy.service.ext_proc.v3.HeadersResponse".into() } } -/// This message must be sent in response to an HttpTrailers message. +/// This message is sent by the external server to Envoy after ``HttpBody`` was +/// sent to it. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct TrailersResponse { - /// Instructions on how to manipulate the trailers +pub struct BodyResponse { + /// Details the modifications (if any) to be made by Envoy to the current + /// request/response. #[prost(message, optional, tag = "1")] - pub header_mutation: ::core::option::Option, + pub response: ::core::option::Option, } -impl ::prost::Name for TrailersResponse { - const NAME: &'static str = "TrailersResponse"; +impl ::prost::Name for BodyResponse { + const NAME: &'static str = "BodyResponse"; const PACKAGE: &'static str = "envoy.service.ext_proc.v3"; fn full_name() -> ::prost::alloc::string::String { - "envoy.service.ext_proc.v3.TrailersResponse".into() + "envoy.service.ext_proc.v3.BodyResponse".into() } fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.service.ext_proc.v3.TrailersResponse".into() + "type.googleapis.com/envoy.service.ext_proc.v3.BodyResponse".into() } } -/// This message must be sent in response to an HttpBody message. +/// This message is sent by the external server to Envoy after ``HttpTrailers`` was +/// sent to it. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct BodyResponse { +pub struct TrailersResponse { + /// Details the modifications (if any) to be made by Envoy to the current + /// request/response trailers. #[prost(message, optional, tag = "1")] - pub response: ::core::option::Option, + pub header_mutation: ::core::option::Option, } -impl ::prost::Name for BodyResponse { - const NAME: &'static str = "BodyResponse"; +impl ::prost::Name for TrailersResponse { + const NAME: &'static str = "TrailersResponse"; const PACKAGE: &'static str = "envoy.service.ext_proc.v3"; fn full_name() -> ::prost::alloc::string::String { - "envoy.service.ext_proc.v3.BodyResponse".into() + "envoy.service.ext_proc.v3.TrailersResponse".into() } fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.service.ext_proc.v3.BodyResponse".into() + "type.googleapis.com/envoy.service.ext_proc.v3.TrailersResponse".into() } } /// This message contains common fields between header and body responses. @@ -340,12 +399,8 @@ pub struct CommonResponse { /// Add new trailers to the message. This may be used when responding to either a /// HttpHeaders or HttpBody message, but only if this message is returned /// along with the CONTINUE_AND_REPLACE status. - /// The ``trailers`` encoding is based on the runtime guard - /// envoy_reloadable_features_send_header_raw_value setting. - /// When it is true, the header value is encoded in the + /// The header value is encoded in the /// :ref:`raw_value ` field. - /// When it is false, the header value is encoded in the - /// :ref:`value ` field. #[prost(message, optional, tag = "4")] pub trailers: ::core::option::Option< super::super::super::config::core::v3::HeaderMap, @@ -359,6 +414,7 @@ pub struct CommonResponse { } /// Nested message and enum types in `CommonResponse`. pub mod common_response { + /// The status of the response. #[derive( Clone, Copy, @@ -430,7 +486,7 @@ impl ::prost::Name for CommonResponse { /// \[#next-free-field: 6\] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ImmediateResponse { - /// The response code to return + /// The response code to return. #[prost(message, optional, tag = "1")] pub status: ::core::option::Option, /// Apply changes to the default headers, which will include content-type. @@ -462,7 +518,7 @@ impl ::prost::Name for ImmediateResponse { /// This message specifies a gRPC status for an ImmediateResponse message. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GrpcStatus { - /// The actual gRPC status + /// The actual gRPC status. #[prost(uint32, tag = "1")] pub status: u32, } @@ -483,12 +539,8 @@ pub struct HeaderMutation { /// Add or replace HTTP headers. Attempts to set the value of /// any ``x-envoy`` header, and attempts to set the ``:method``, /// ``:authority``, ``:scheme``, or ``host`` headers will be ignored. - /// The ``set_headers`` encoding is based on the runtime guard - /// envoy_reloadable_features_send_header_raw_value setting. - /// When it is true, the header value is encoded in the + /// The header value is encoded in the /// :ref:`raw_value ` field. - /// When it is false, the header value is encoded in the - /// :ref:`value ` field. #[prost(message, repeated, tag = "1")] pub set_headers: ::prost::alloc::vec::Vec< super::super::super::config::core::v3::HeaderValueOption, @@ -508,23 +560,58 @@ impl ::prost::Name for HeaderMutation { "type.googleapis.com/envoy.service.ext_proc.v3.HeaderMutation".into() } } -/// Replace the entire message body chunk received in the corresponding -/// HttpBody message with this new body, or clear the body. +/// The body response message corresponding to FULL_DUPLEX_STREAMED body mode. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamedBodyResponse { + /// The body response chunk that will be passed to the upstream/downstream by Envoy. + #[prost(bytes = "vec", tag = "1")] + pub body: ::prost::alloc::vec::Vec, + /// The server sets this flag to true if it has received a body request with + /// :ref:`end_of_stream ` set to true, + /// and this is the last chunk of body responses. + #[prost(bool, tag = "2")] + pub end_of_stream: bool, +} +impl ::prost::Name for StreamedBodyResponse { + const NAME: &'static str = "StreamedBodyResponse"; + const PACKAGE: &'static str = "envoy.service.ext_proc.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.service.ext_proc.v3.StreamedBodyResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.service.ext_proc.v3.StreamedBodyResponse".into() + } +} +/// This message specifies the body mutation the server sends to Envoy. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BodyMutation { - #[prost(oneof = "body_mutation::Mutation", tags = "1, 2")] + /// The type of mutation for the body. + #[prost(oneof = "body_mutation::Mutation", tags = "1, 2, 3")] pub mutation: ::core::option::Option, } /// Nested message and enum types in `BodyMutation`. pub mod body_mutation { + /// The type of mutation for the body. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Mutation { - /// The entire body to replace + /// The entire body to replace. + /// Should only be used when the corresponding ``BodySendMode`` in the + /// :ref:`processing_mode ` + /// is not set to ``FULL_DUPLEX_STREAMED``. #[prost(bytes, tag = "1")] Body(::prost::alloc::vec::Vec), - /// Clear the corresponding body chunk + /// Clear the corresponding body chunk. + /// Should only be used when the corresponding ``BodySendMode`` in the + /// :ref:`processing_mode ` + /// is not set to ``FULL_DUPLEX_STREAMED``. + /// Clear the corresponding body chunk. #[prost(bool, tag = "2")] ClearBody(bool), + /// Must be used when the corresponding ``BodySendMode`` in the + /// :ref:`processing_mode ` + /// is set to ``FULL_DUPLEX_STREAMED``. + #[prost(message, tag = "3")] + StreamedResponse(super::StreamedBodyResponse), } } impl ::prost::Name for BodyMutation { @@ -548,13 +635,38 @@ pub mod external_processor_client { )] use tonic::codegen::*; use tonic::codegen::http::Uri; + /// A service that can access and modify HTTP requests and responses + /// as part of a filter chain. + /// The overall external processing protocol works like this: + /// + /// 1. Envoy sends to the service information about the HTTP request. + /// 2. The service sends back a ProcessingResponse message that directs Envoy + /// to either stop processing, continue without it, or send it the + /// next chunk of the message body. + /// 3. If so requested, Envoy sends the server the message body in chunks, + /// or the entire body at once. In either case, the server may send back + /// a ProcessingResponse for each message it receives, or wait for certain amount + /// of body chunks received before streams back the ProcessingResponse messages. + /// 4. If so requested, Envoy sends the server the HTTP trailers, + /// and the server sends back a ProcessingResponse. + /// 5. At this point, request processing is done, and we pick up again + /// at step 1 when Envoy receives a response from the upstream server. + /// 6. At any point above, if the server closes the gRPC stream cleanly, + /// then Envoy proceeds without consulting the server. + /// 7. At any point above, if the server closes the gRPC stream with an error, + /// then Envoy returns a 500 error to the client, unless the filter + /// was configured to ignore errors. + /// + /// In other words, the process is a request/response conversation, but + /// using a gRPC stream to make it easier for the server to + /// maintain state. #[derive(Debug, Clone)] pub struct ExternalProcessorClient { inner: tonic::client::Grpc, } impl ExternalProcessorClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -575,13 +687,13 @@ pub mod external_processor_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { ExternalProcessorClient::new(InterceptedService::new(inner, interceptor)) @@ -680,6 +792,31 @@ pub mod external_processor_server { request: tonic::Request>, ) -> std::result::Result, tonic::Status>; } + /// A service that can access and modify HTTP requests and responses + /// as part of a filter chain. + /// The overall external processing protocol works like this: + /// + /// 1. Envoy sends to the service information about the HTTP request. + /// 2. The service sends back a ProcessingResponse message that directs Envoy + /// to either stop processing, continue without it, or send it the + /// next chunk of the message body. + /// 3. If so requested, Envoy sends the server the message body in chunks, + /// or the entire body at once. In either case, the server may send back + /// a ProcessingResponse for each message it receives, or wait for certain amount + /// of body chunks received before streams back the ProcessingResponse messages. + /// 4. If so requested, Envoy sends the server the HTTP trailers, + /// and the server sends back a ProcessingResponse. + /// 5. At this point, request processing is done, and we pick up again + /// at step 1 when Envoy receives a response from the upstream server. + /// 6. At any point above, if the server closes the gRPC stream cleanly, + /// then Envoy proceeds without consulting the server. + /// 7. At any point above, if the server closes the gRPC stream with an error, + /// then Envoy returns a 500 error to the client, unless the filter + /// was configured to ignore errors. + /// + /// In other words, the process is a request/response conversation, but + /// using a gRPC stream to make it easier for the server to + /// maintain state. #[derive(Debug)] pub struct ExternalProcessorServer { inner: Arc, @@ -745,7 +882,7 @@ pub mod external_processor_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -806,7 +943,9 @@ pub mod external_processor_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.ext_proc.v3.serde.rs b/src/generated/envoy.service.ext_proc.v3.serde.rs index d98269d..c2bb0c2 100644 --- a/src/generated/envoy.service.ext_proc.v3.serde.rs +++ b/src/generated/envoy.service.ext_proc.v3.serde.rs @@ -20,6 +20,9 @@ impl serde::Serialize for BodyMutation { body_mutation::Mutation::ClearBody(v) => { struct_ser.serialize_field("clear_body", v)?; } + body_mutation::Mutation::StreamedResponse(v) => { + struct_ser.serialize_field("streamed_response", v)?; + } } } struct_ser.end() @@ -35,12 +38,15 @@ impl<'de> serde::Deserialize<'de> for BodyMutation { "body", "clear_body", "clearBody", + "streamed_response", + "streamedResponse", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Body, ClearBody, + StreamedResponse, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -64,6 +70,7 @@ impl<'de> serde::Deserialize<'de> for BodyMutation { match value { "body" => Ok(GeneratedField::Body), "clearBody" | "clear_body" => Ok(GeneratedField::ClearBody), + "streamedResponse" | "streamed_response" => Ok(GeneratedField::StreamedResponse), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -98,6 +105,13 @@ impl<'de> serde::Deserialize<'de> for BodyMutation { } mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(body_mutation::Mutation::ClearBody); } + GeneratedField::StreamedResponse => { + if mutation__.is_some() { + return Err(serde::de::Error::duplicate_field("streamedResponse")); + } + mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(body_mutation::Mutation::StreamedResponse) +; + } } } Ok(BodyMutation { @@ -1241,6 +1255,9 @@ impl serde::Serialize for ProcessingRequest { if self.observability_mode { len += 1; } + if self.protocol_config.is_some() { + len += 1; + } if self.request.is_some() { len += 1; } @@ -1254,6 +1271,9 @@ impl serde::Serialize for ProcessingRequest { if self.observability_mode { struct_ser.serialize_field("observability_mode", &self.observability_mode)?; } + if let Some(v) = self.protocol_config.as_ref() { + struct_ser.serialize_field("protocol_config", v)?; + } if let Some(v) = self.request.as_ref() { match v { processing_request::Request::RequestHeaders(v) => { @@ -1291,6 +1311,8 @@ impl<'de> serde::Deserialize<'de> for ProcessingRequest { "attributes", "observability_mode", "observabilityMode", + "protocol_config", + "protocolConfig", "request_headers", "requestHeaders", "response_headers", @@ -1310,6 +1332,7 @@ impl<'de> serde::Deserialize<'de> for ProcessingRequest { MetadataContext, Attributes, ObservabilityMode, + ProtocolConfig, RequestHeaders, ResponseHeaders, RequestBody, @@ -1340,6 +1363,7 @@ impl<'de> serde::Deserialize<'de> for ProcessingRequest { "metadataContext" | "metadata_context" => Ok(GeneratedField::MetadataContext), "attributes" => Ok(GeneratedField::Attributes), "observabilityMode" | "observability_mode" => Ok(GeneratedField::ObservabilityMode), + "protocolConfig" | "protocol_config" => Ok(GeneratedField::ProtocolConfig), "requestHeaders" | "request_headers" => Ok(GeneratedField::RequestHeaders), "responseHeaders" | "response_headers" => Ok(GeneratedField::ResponseHeaders), "requestBody" | "request_body" => Ok(GeneratedField::RequestBody), @@ -1368,6 +1392,7 @@ impl<'de> serde::Deserialize<'de> for ProcessingRequest { let mut metadata_context__ = None; let mut attributes__ = None; let mut observability_mode__ = None; + let mut protocol_config__ = None; let mut request__ = None; while let Some(k) = map_.next_key()? { match k { @@ -1391,6 +1416,12 @@ impl<'de> serde::Deserialize<'de> for ProcessingRequest { } observability_mode__ = Some(map_.next_value()?); } + GeneratedField::ProtocolConfig => { + if protocol_config__.is_some() { + return Err(serde::de::Error::duplicate_field("protocolConfig")); + } + protocol_config__ = map_.next_value()?; + } GeneratedField::RequestHeaders => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("requestHeaders")); @@ -1439,6 +1470,7 @@ impl<'de> serde::Deserialize<'de> for ProcessingRequest { metadata_context: metadata_context__, attributes: attributes__.unwrap_or_default(), observability_mode: observability_mode__.unwrap_or_default(), + protocol_config: protocol_config__, request: request__, }) } @@ -1681,6 +1713,251 @@ impl<'de> serde::Deserialize<'de> for ProcessingResponse { deserializer.deserialize_struct("envoy.service.ext_proc.v3.ProcessingResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for ProtocolConfiguration { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.request_body_mode != 0 { + len += 1; + } + if self.response_body_mode != 0 { + len += 1; + } + if self.send_body_without_waiting_for_header_response { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.ext_proc.v3.ProtocolConfiguration", len)?; + if self.request_body_mode != 0 { + let v = super::super::super::extensions::filters::http::ext_proc::v3::processing_mode::BodySendMode::try_from(self.request_body_mode) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.request_body_mode)))?; + struct_ser.serialize_field("request_body_mode", &v)?; + } + if self.response_body_mode != 0 { + let v = super::super::super::extensions::filters::http::ext_proc::v3::processing_mode::BodySendMode::try_from(self.response_body_mode) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.response_body_mode)))?; + struct_ser.serialize_field("response_body_mode", &v)?; + } + if self.send_body_without_waiting_for_header_response { + struct_ser.serialize_field("send_body_without_waiting_for_header_response", &self.send_body_without_waiting_for_header_response)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ProtocolConfiguration { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "request_body_mode", + "requestBodyMode", + "response_body_mode", + "responseBodyMode", + "send_body_without_waiting_for_header_response", + "sendBodyWithoutWaitingForHeaderResponse", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RequestBodyMode, + ResponseBodyMode, + SendBodyWithoutWaitingForHeaderResponse, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "requestBodyMode" | "request_body_mode" => Ok(GeneratedField::RequestBodyMode), + "responseBodyMode" | "response_body_mode" => Ok(GeneratedField::ResponseBodyMode), + "sendBodyWithoutWaitingForHeaderResponse" | "send_body_without_waiting_for_header_response" => Ok(GeneratedField::SendBodyWithoutWaitingForHeaderResponse), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProtocolConfiguration; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.ext_proc.v3.ProtocolConfiguration") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut request_body_mode__ = None; + let mut response_body_mode__ = None; + let mut send_body_without_waiting_for_header_response__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RequestBodyMode => { + if request_body_mode__.is_some() { + return Err(serde::de::Error::duplicate_field("requestBodyMode")); + } + request_body_mode__ = Some(map_.next_value::()? as i32); + } + GeneratedField::ResponseBodyMode => { + if response_body_mode__.is_some() { + return Err(serde::de::Error::duplicate_field("responseBodyMode")); + } + response_body_mode__ = Some(map_.next_value::()? as i32); + } + GeneratedField::SendBodyWithoutWaitingForHeaderResponse => { + if send_body_without_waiting_for_header_response__.is_some() { + return Err(serde::de::Error::duplicate_field("sendBodyWithoutWaitingForHeaderResponse")); + } + send_body_without_waiting_for_header_response__ = Some(map_.next_value()?); + } + } + } + Ok(ProtocolConfiguration { + request_body_mode: request_body_mode__.unwrap_or_default(), + response_body_mode: response_body_mode__.unwrap_or_default(), + send_body_without_waiting_for_header_response: send_body_without_waiting_for_header_response__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.service.ext_proc.v3.ProtocolConfiguration", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StreamedBodyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.body.is_empty() { + len += 1; + } + if self.end_of_stream { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.ext_proc.v3.StreamedBodyResponse", len)?; + if !self.body.is_empty() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("body", pbjson::private::base64::encode(&self.body).as_str())?; + } + if self.end_of_stream { + struct_ser.serialize_field("end_of_stream", &self.end_of_stream)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StreamedBodyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "body", + "end_of_stream", + "endOfStream", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Body, + EndOfStream, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "body" => Ok(GeneratedField::Body), + "endOfStream" | "end_of_stream" => Ok(GeneratedField::EndOfStream), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StreamedBodyResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.ext_proc.v3.StreamedBodyResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut body__ = None; + let mut end_of_stream__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Body => { + if body__.is_some() { + return Err(serde::de::Error::duplicate_field("body")); + } + body__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::EndOfStream => { + if end_of_stream__.is_some() { + return Err(serde::de::Error::duplicate_field("endOfStream")); + } + end_of_stream__ = Some(map_.next_value()?); + } + } + } + Ok(StreamedBodyResponse { + body: body__.unwrap_or_default(), + end_of_stream: end_of_stream__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.service.ext_proc.v3.StreamedBodyResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for TrailersResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/envoy.service.extension.v3.rs b/src/generated/envoy.service.extension.v3.rs index 1c88ab2..cb3db1c 100644 --- a/src/generated/envoy.service.extension.v3.rs +++ b/src/generated/envoy.service.extension.v3.rs @@ -25,6 +25,30 @@ pub mod extension_config_discovery_service_client { )] use tonic::codegen::*; use tonic::codegen::http::Uri; + /// A service that supports dynamic configuration updates for a specific filter. + /// Currently, ECDS is supported for network filters, HTTP filters, UDP session filters, and listener filters. + /// Please check :ref:`Extension Config Discovery Service (ECDS) API `. + /// + /// The overall extension config discovery service works as follows: + /// + /// #. A filter (:ref:`Downstream Network `, + /// :ref:`Upstream Network `, + /// :ref:`Listener `, + /// :ref:`UDP Session `, + /// or :ref:`HTTP `) + /// contains a (:ref:`ExtensionConfigSource config discovery `) configuration. This configuration + /// includes a :ref:`config_source `, + /// from which the filter configuration will be fetched. + /// #. The client then registers for a resource using the filter name as the ``resource_name``. + /// #. The xDS server sends back the filter's configuration. + /// #. The client stores the configuration that will be used in the next instantiation of the filter chain, + /// i.e., for the next requests. Whenever an updated filter configuration arrives, it will be taken into + /// account in the following instantiation of the filter chain. + /// + /// .. note:: + /// Filters that are configured using ECDS are warmed. For more details see + /// :ref:`ExtensionConfigSource `. + /// /// Return extension configurations. #[derive(Debug, Clone)] pub struct ExtensionConfigDiscoveryServiceClient { @@ -32,7 +56,7 @@ pub mod extension_config_discovery_service_client { } impl ExtensionConfigDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -53,13 +77,13 @@ pub mod extension_config_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { ExtensionConfigDiscoveryServiceClient::new( @@ -259,6 +283,30 @@ pub mod extension_config_discovery_service_server { tonic::Status, >; } + /// A service that supports dynamic configuration updates for a specific filter. + /// Currently, ECDS is supported for network filters, HTTP filters, UDP session filters, and listener filters. + /// Please check :ref:`Extension Config Discovery Service (ECDS) API `. + /// + /// The overall extension config discovery service works as follows: + /// + /// #. A filter (:ref:`Downstream Network `, + /// :ref:`Upstream Network `, + /// :ref:`Listener `, + /// :ref:`UDP Session `, + /// or :ref:`HTTP `) + /// contains a (:ref:`ExtensionConfigSource config discovery `) configuration. This configuration + /// includes a :ref:`config_source `, + /// from which the filter configuration will be fetched. + /// #. The client then registers for a resource using the filter name as the ``resource_name``. + /// #. The xDS server sends back the filter's configuration. + /// #. The client stores the configuration that will be used in the next instantiation of the filter chain, + /// i.e., for the next requests. Whenever an updated filter configuration arrives, it will be taken into + /// account in the following instantiation of the filter chain. + /// + /// .. note:: + /// Filters that are configured using ECDS are warmed. For more details see + /// :ref:`ExtensionConfigSource `. + /// /// Return extension configurations. #[derive(Debug)] pub struct ExtensionConfigDiscoveryServiceServer { @@ -326,7 +374,7 @@ pub mod extension_config_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -507,7 +555,9 @@ pub mod extension_config_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.health.v3.rs b/src/generated/envoy.service.health.v3.rs index 6e9e797..d2d8f0a 100644 --- a/src/generated/envoy.service.health.v3.rs +++ b/src/generated/envoy.service.health.v3.rs @@ -305,7 +305,7 @@ pub mod health_discovery_service_client { } impl HealthDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -326,13 +326,13 @@ pub mod health_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { HealthDiscoveryServiceClient::new( @@ -615,7 +615,7 @@ pub mod health_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -735,7 +735,9 @@ pub mod health_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.listener.v3.rs b/src/generated/envoy.service.listener.v3.rs index 8734065..6054875 100644 --- a/src/generated/envoy.service.listener.v3.rs +++ b/src/generated/envoy.service.listener.v3.rs @@ -34,7 +34,7 @@ pub mod listener_discovery_service_client { } impl ListenerDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -55,13 +55,13 @@ pub mod listener_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { ListenerDiscoveryServiceClient::new( @@ -331,7 +331,7 @@ pub mod listener_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -506,7 +506,9 @@ pub mod listener_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.load_stats.v3.rs b/src/generated/envoy.service.load_stats.v3.rs index 2b6e970..837c7bd 100644 --- a/src/generated/envoy.service.load_stats.v3.rs +++ b/src/generated/envoy.service.load_stats.v3.rs @@ -78,7 +78,7 @@ pub mod load_reporting_service_client { } impl LoadReportingServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -99,13 +99,13 @@ pub mod load_reporting_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { LoadReportingServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -321,7 +321,7 @@ pub mod load_reporting_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -386,7 +386,9 @@ pub mod load_reporting_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.metrics.v3.rs b/src/generated/envoy.service.metrics.v3.rs index e9021c9..df7bd0f 100644 --- a/src/generated/envoy.service.metrics.v3.rs +++ b/src/generated/envoy.service.metrics.v3.rs @@ -74,7 +74,7 @@ pub mod metrics_service_client { } impl MetricsServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -95,13 +95,13 @@ pub mod metrics_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { MetricsServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -262,7 +262,7 @@ pub mod metrics_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -322,7 +322,9 @@ pub mod metrics_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.network_ext_proc.v3.rs b/src/generated/envoy.service.network_ext_proc.v3.rs new file mode 100644 index 0000000..bd24b8f --- /dev/null +++ b/src/generated/envoy.service.network_ext_proc.v3.rs @@ -0,0 +1,533 @@ +// This file is @generated by prost-build. +/// The payload data from network layer +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Data { + /// The raw payload data + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, + /// 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, +} +impl ::prost::Name for Data { + const NAME: &'static str = "Data"; + const PACKAGE: &'static str = "envoy.service.network_ext_proc.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.service.network_ext_proc.v3.Data".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.service.network_ext_proc.v3.Data".into() + } +} +/// 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. +#[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, + /// 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, + /// 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, + >, +} +impl ::prost::Name for ProcessingRequest { + const NAME: &'static str = "ProcessingRequest"; + const PACKAGE: &'static str = "envoy.service.network_ext_proc.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.service.network_ext_proc.v3.ProcessingRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.service.network_ext_proc.v3.ProcessingRequest".into() + } +} +/// 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\] +#[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, + /// 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, + /// 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 { + Self::Unknown => "UNKNOWN", + Self::Unmodified => "UNMODIFIED", + Self::Modified => "MODIFIED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + 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 { + Self::Continue => "CONTINUE", + Self::Close => "CLOSE", + Self::CloseRst => "CLOSE_RST", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CONTINUE" => Some(Self::Continue), + "CLOSE" => Some(Self::Close), + "CLOSE_RST" => Some(Self::CloseRst), + _ => None, + } + } + } +} +impl ::prost::Name for ProcessingResponse { + const NAME: &'static str = "ProcessingResponse"; + const PACKAGE: &'static str = "envoy.service.network_ext_proc.v3"; + fn full_name() -> ::prost::alloc::string::String { + "envoy.service.network_ext_proc.v3.ProcessingResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "type.googleapis.com/envoy.service.network_ext_proc.v3.ProcessingResponse".into() + } +} +/// Generated client implementations. +pub mod network_external_processor_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// NetworkExternalProcessor service defines the contract between Envoy and + /// external processing servers for L4 network traffic. + #[derive(Debug, Clone)] + pub struct NetworkExternalProcessorClient { + inner: tonic::client::Grpc, + } + impl NetworkExternalProcessorClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> NetworkExternalProcessorClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, + { + NetworkExternalProcessorClient::new( + InterceptedService::new(inner, interceptor), + ) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// Process establishes a bidirectional stream between Envoy and the external + /// processing server. Envoy sends ProcessingRequests containing network data + /// and the server responds with ProcessingResponses containing processing + /// decisions and potentially modified data. + /// + /// The server should handle processing timeout properly to avoid blocking + /// network traffic for extended periods. Any uncaught exceptions will + /// be treated as errors and will terminate the stream. + /// + /// Implementation note: The server should process requests in the order + /// they are received to maintain proper sequencing of network traffic. + pub async fn process( + &mut self, + request: impl tonic::IntoStreamingRequest, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/envoy.service.network_ext_proc.v3.NetworkExternalProcessor/Process", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "envoy.service.network_ext_proc.v3.NetworkExternalProcessor", + "Process", + ), + ); + self.inner.streaming(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod network_external_processor_server { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with NetworkExternalProcessorServer. + #[async_trait] + pub trait NetworkExternalProcessor: std::marker::Send + std::marker::Sync + 'static { + /// Server streaming response type for the Process method. + type ProcessStream: tonic::codegen::tokio_stream::Stream< + Item = std::result::Result, + > + + std::marker::Send + + 'static; + /// Process establishes a bidirectional stream between Envoy and the external + /// processing server. Envoy sends ProcessingRequests containing network data + /// and the server responds with ProcessingResponses containing processing + /// decisions and potentially modified data. + /// + /// The server should handle processing timeout properly to avoid blocking + /// network traffic for extended periods. Any uncaught exceptions will + /// be treated as errors and will terminate the stream. + /// + /// Implementation note: The server should process requests in the order + /// they are received to maintain proper sequencing of network traffic. + async fn process( + &self, + request: tonic::Request>, + ) -> std::result::Result, tonic::Status>; + } + /// NetworkExternalProcessor service defines the contract between Envoy and + /// external processing servers for L4 network traffic. + #[derive(Debug)] + pub struct NetworkExternalProcessorServer { + inner: Arc, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + impl NetworkExternalProcessorServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> + for NetworkExternalProcessorServer + where + T: NetworkExternalProcessor, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + match req.uri().path() { + "/envoy.service.network_ext_proc.v3.NetworkExternalProcessor/Process" => { + #[allow(non_camel_case_types)] + struct ProcessSvc(pub Arc); + impl< + T: NetworkExternalProcessor, + > tonic::server::StreamingService + for ProcessSvc { + type Response = super::ProcessingResponse; + type ResponseStream = T::ProcessStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::process(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = ProcessSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + let mut response = http::Response::new( + tonic::body::Body::default(), + ); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) + }) + } + } + } + } + impl Clone for NetworkExternalProcessorServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "envoy.service.network_ext_proc.v3.NetworkExternalProcessor"; + impl tonic::server::NamedService for NetworkExternalProcessorServer { + const NAME: &'static str = SERVICE_NAME; + } +} diff --git a/src/generated/envoy.service.network_ext_proc.v3.serde.rs b/src/generated/envoy.service.network_ext_proc.v3.serde.rs new file mode 100644 index 0000000..65d0a9a --- /dev/null +++ b/src/generated/envoy.service.network_ext_proc.v3.serde.rs @@ -0,0 +1,556 @@ +impl serde::Serialize for Data { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + if self.end_of_stream { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.network_ext_proc.v3.Data", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if self.end_of_stream { + struct_ser.serialize_field("end_of_stream", &self.end_of_stream)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Data { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + "end_of_stream", + "endOfStream", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + EndOfStream, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + "endOfStream" | "end_of_stream" => Ok(GeneratedField::EndOfStream), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Data; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.network_ext_proc.v3.Data") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + let mut end_of_stream__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::EndOfStream => { + if end_of_stream__.is_some() { + return Err(serde::de::Error::duplicate_field("endOfStream")); + } + end_of_stream__ = Some(map_.next_value()?); + } + } + } + Ok(Data { + data: data__.unwrap_or_default(), + end_of_stream: end_of_stream__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.service.network_ext_proc.v3.Data", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProcessingRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.read_data.is_some() { + len += 1; + } + if self.write_data.is_some() { + len += 1; + } + if self.metadata.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.network_ext_proc.v3.ProcessingRequest", len)?; + if let Some(v) = self.read_data.as_ref() { + struct_ser.serialize_field("read_data", v)?; + } + if let Some(v) = self.write_data.as_ref() { + struct_ser.serialize_field("write_data", v)?; + } + if let Some(v) = self.metadata.as_ref() { + struct_ser.serialize_field("metadata", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ProcessingRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "read_data", + "readData", + "write_data", + "writeData", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ReadData, + WriteData, + Metadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "readData" | "read_data" => Ok(GeneratedField::ReadData), + "writeData" | "write_data" => Ok(GeneratedField::WriteData), + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProcessingRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.network_ext_proc.v3.ProcessingRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut read_data__ = None; + let mut write_data__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ReadData => { + if read_data__.is_some() { + return Err(serde::de::Error::duplicate_field("readData")); + } + read_data__ = map_.next_value()?; + } + GeneratedField::WriteData => { + if write_data__.is_some() { + return Err(serde::de::Error::duplicate_field("writeData")); + } + write_data__ = map_.next_value()?; + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = map_.next_value()?; + } + } + } + Ok(ProcessingRequest { + read_data: read_data__, + write_data: write_data__, + metadata: metadata__, + }) + } + } + deserializer.deserialize_struct("envoy.service.network_ext_proc.v3.ProcessingRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProcessingResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.read_data.is_some() { + len += 1; + } + if self.write_data.is_some() { + len += 1; + } + if self.data_processing_status != 0 { + len += 1; + } + if self.connection_status != 0 { + len += 1; + } + if self.dynamic_metadata.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.network_ext_proc.v3.ProcessingResponse", len)?; + if let Some(v) = self.read_data.as_ref() { + struct_ser.serialize_field("read_data", v)?; + } + if let Some(v) = self.write_data.as_ref() { + struct_ser.serialize_field("write_data", v)?; + } + if self.data_processing_status != 0 { + let v = processing_response::DataProcessedStatus::try_from(self.data_processing_status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.data_processing_status)))?; + struct_ser.serialize_field("data_processing_status", &v)?; + } + if self.connection_status != 0 { + let v = processing_response::ConnectionStatus::try_from(self.connection_status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.connection_status)))?; + struct_ser.serialize_field("connection_status", &v)?; + } + if let Some(v) = self.dynamic_metadata.as_ref() { + struct_ser.serialize_field("dynamic_metadata", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ProcessingResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "read_data", + "readData", + "write_data", + "writeData", + "data_processing_status", + "dataProcessingStatus", + "connection_status", + "connectionStatus", + "dynamic_metadata", + "dynamicMetadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ReadData, + WriteData, + DataProcessingStatus, + ConnectionStatus, + DynamicMetadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "readData" | "read_data" => Ok(GeneratedField::ReadData), + "writeData" | "write_data" => Ok(GeneratedField::WriteData), + "dataProcessingStatus" | "data_processing_status" => Ok(GeneratedField::DataProcessingStatus), + "connectionStatus" | "connection_status" => Ok(GeneratedField::ConnectionStatus), + "dynamicMetadata" | "dynamic_metadata" => Ok(GeneratedField::DynamicMetadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProcessingResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.network_ext_proc.v3.ProcessingResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut read_data__ = None; + let mut write_data__ = None; + let mut data_processing_status__ = None; + let mut connection_status__ = None; + let mut dynamic_metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ReadData => { + if read_data__.is_some() { + return Err(serde::de::Error::duplicate_field("readData")); + } + read_data__ = map_.next_value()?; + } + GeneratedField::WriteData => { + if write_data__.is_some() { + return Err(serde::de::Error::duplicate_field("writeData")); + } + write_data__ = map_.next_value()?; + } + GeneratedField::DataProcessingStatus => { + if data_processing_status__.is_some() { + return Err(serde::de::Error::duplicate_field("dataProcessingStatus")); + } + data_processing_status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::ConnectionStatus => { + if connection_status__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionStatus")); + } + connection_status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::DynamicMetadata => { + if dynamic_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("dynamicMetadata")); + } + dynamic_metadata__ = map_.next_value()?; + } + } + } + Ok(ProcessingResponse { + read_data: read_data__, + write_data: write_data__, + data_processing_status: data_processing_status__.unwrap_or_default(), + connection_status: connection_status__.unwrap_or_default(), + dynamic_metadata: dynamic_metadata__, + }) + } + } + deserializer.deserialize_struct("envoy.service.network_ext_proc.v3.ProcessingResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for processing_response::ConnectionStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Continue => "CONTINUE", + Self::Close => "CLOSE", + Self::CloseRst => "CLOSE_RST", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for processing_response::ConnectionStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "CONTINUE", + "CLOSE", + "CLOSE_RST", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = processing_response::ConnectionStatus; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "CONTINUE" => Ok(processing_response::ConnectionStatus::Continue), + "CLOSE" => Ok(processing_response::ConnectionStatus::Close), + "CLOSE_RST" => Ok(processing_response::ConnectionStatus::CloseRst), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for processing_response::DataProcessedStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "UNKNOWN", + Self::Unmodified => "UNMODIFIED", + Self::Modified => "MODIFIED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for processing_response::DataProcessedStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UNKNOWN", + "UNMODIFIED", + "MODIFIED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = processing_response::DataProcessedStatus; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "UNKNOWN" => Ok(processing_response::DataProcessedStatus::Unknown), + "UNMODIFIED" => Ok(processing_response::DataProcessedStatus::Unmodified), + "MODIFIED" => Ok(processing_response::DataProcessedStatus::Modified), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/src/generated/envoy.service.rate_limit_quota.v3.rs b/src/generated/envoy.service.rate_limit_quota.v3.rs index d8a5ceb..21ae607 100644 --- a/src/generated/envoy.service.rate_limit_quota.v3.rs +++ b/src/generated/envoy.service.rate_limit_quota.v3.rs @@ -310,7 +310,7 @@ pub mod rate_limit_quota_service_client { } impl RateLimitQuotaServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -331,13 +331,13 @@ pub mod rate_limit_quota_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { RateLimitQuotaServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -504,7 +504,7 @@ pub mod rate_limit_quota_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -571,7 +571,9 @@ pub mod rate_limit_quota_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.ratelimit.v3.rs b/src/generated/envoy.service.ratelimit.v3.rs index 9effd0a..1503649 100644 --- a/src/generated/envoy.service.ratelimit.v3.rs +++ b/src/generated/envoy.service.ratelimit.v3.rs @@ -21,6 +21,8 @@ pub struct RateLimitRequest { >, /// Rate limit requests can optionally specify the number of hits a request adds to the matched /// limit. If the value is not set in the message, a request increases the matched limit by 1. + /// This value can be overridden by setting filter state value ``envoy.ratelimit.hits_addend`` + /// to the desired number. Invalid number (< 0) or number will be ignored. #[prost(uint32, tag = "3")] pub hits_addend: u32, } @@ -127,6 +129,8 @@ pub mod rate_limit_response { Hour = 3, /// The time unit representing a day. Day = 4, + /// The time unit representing a week. + Week = 7, /// The time unit representing a month. Month = 5, /// The time unit representing a year. @@ -144,6 +148,7 @@ pub mod rate_limit_response { Self::Minute => "MINUTE", Self::Hour => "HOUR", Self::Day => "DAY", + Self::Week => "WEEK", Self::Month => "MONTH", Self::Year => "YEAR", } @@ -156,6 +161,7 @@ pub mod rate_limit_response { "MINUTE" => Some(Self::Minute), "HOUR" => Some(Self::Hour), "DAY" => Some(Self::Day), + "WEEK" => Some(Self::Week), "MONTH" => Some(Self::Month), "YEAR" => Some(Self::Year), _ => None, @@ -348,7 +354,7 @@ pub mod rate_limit_service_client { } impl RateLimitServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -369,13 +375,13 @@ pub mod rate_limit_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { RateLimitServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -530,7 +536,7 @@ pub mod rate_limit_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -589,7 +595,9 @@ pub mod rate_limit_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.ratelimit.v3.serde.rs b/src/generated/envoy.service.ratelimit.v3.serde.rs index 341efd2..0c49707 100644 --- a/src/generated/envoy.service.ratelimit.v3.serde.rs +++ b/src/generated/envoy.service.ratelimit.v3.serde.rs @@ -845,6 +845,7 @@ impl serde::Serialize for rate_limit_response::rate_limit::Unit { Self::Minute => "MINUTE", Self::Hour => "HOUR", Self::Day => "DAY", + Self::Week => "WEEK", Self::Month => "MONTH", Self::Year => "YEAR", }; @@ -863,6 +864,7 @@ impl<'de> serde::Deserialize<'de> for rate_limit_response::rate_limit::Unit { "MINUTE", "HOUR", "DAY", + "WEEK", "MONTH", "YEAR", ]; @@ -910,6 +912,7 @@ impl<'de> serde::Deserialize<'de> for rate_limit_response::rate_limit::Unit { "MINUTE" => Ok(rate_limit_response::rate_limit::Unit::Minute), "HOUR" => Ok(rate_limit_response::rate_limit::Unit::Hour), "DAY" => Ok(rate_limit_response::rate_limit::Unit::Day), + "WEEK" => Ok(rate_limit_response::rate_limit::Unit::Week), "MONTH" => Ok(rate_limit_response::rate_limit::Unit::Month), "YEAR" => Ok(rate_limit_response::rate_limit::Unit::Year), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), diff --git a/src/generated/envoy.service.trace.v3.rs b/src/generated/envoy.service.redis_auth.v3.rs similarity index 64% rename from src/generated/envoy.service.trace.v3.rs rename to src/generated/envoy.service.redis_auth.v3.rs index db0a64e..23023e8 100644 --- a/src/generated/envoy.service.trace.v3.rs +++ b/src/generated/envoy.service.redis_auth.v3.rs @@ -1,63 +1,53 @@ // This file is @generated by prost-build. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct StreamTracesResponse {} -impl ::prost::Name for StreamTracesResponse { - const NAME: &'static str = "StreamTracesResponse"; - const PACKAGE: &'static str = "envoy.service.trace.v3"; +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RedisProxyExternalAuthRequest { + /// Username, if applicable. Otherwise, empty. + #[prost(string, tag = "1")] + pub username: ::prost::alloc::string::String, + /// Password sent with the AUTH command. + #[prost(string, tag = "2")] + pub password: ::prost::alloc::string::String, +} +impl ::prost::Name for RedisProxyExternalAuthRequest { + const NAME: &'static str = "RedisProxyExternalAuthRequest"; + const PACKAGE: &'static str = "envoy.service.redis_auth.v3"; fn full_name() -> ::prost::alloc::string::String { - "envoy.service.trace.v3.StreamTracesResponse".into() + "envoy.service.redis_auth.v3.RedisProxyExternalAuthRequest".into() } fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.service.trace.v3.StreamTracesResponse".into() + "type.googleapis.com/envoy.service.redis_auth.v3.RedisProxyExternalAuthRequest" + .into() } } #[derive(Clone, PartialEq, ::prost::Message)] -pub struct StreamTracesMessage { - /// Identifier data effectively is a structured metadata. - /// As a performance optimization this will only be sent in the first message - /// on the stream. +pub struct RedisProxyExternalAuthResponse { + /// Status of the authentication check. #[prost(message, optional, tag = "1")] - pub identifier: ::core::option::Option, - /// A list of Span entries - #[prost(message, repeated, tag = "2")] - pub spans: ::prost::alloc::vec::Vec< - super::super::super::super::opencensus::proto::trace::v1::Span, + pub status: ::core::option::Option, + /// Optional expiration time for the authentication. + /// If set, the authentication will be valid until this time. + /// If not set, the authentication will be valid indefinitely. + #[prost(message, optional, tag = "2")] + pub expiration: ::core::option::Option< + super::super::super::super::google::protobuf::Timestamp, >, + /// Optional message to be sent back to the client. + #[prost(string, tag = "3")] + pub message: ::prost::alloc::string::String, } -/// Nested message and enum types in `StreamTracesMessage`. -pub mod stream_traces_message { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Identifier { - /// The node sending the access log messages over the stream. - #[prost(message, optional, tag = "1")] - pub node: ::core::option::Option< - super::super::super::super::config::core::v3::Node, - >, - } - impl ::prost::Name for Identifier { - const NAME: &'static str = "Identifier"; - const PACKAGE: &'static str = "envoy.service.trace.v3"; - fn full_name() -> ::prost::alloc::string::String { - "envoy.service.trace.v3.StreamTracesMessage.Identifier".into() - } - fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.service.trace.v3.StreamTracesMessage.Identifier" - .into() - } - } -} -impl ::prost::Name for StreamTracesMessage { - const NAME: &'static str = "StreamTracesMessage"; - const PACKAGE: &'static str = "envoy.service.trace.v3"; +impl ::prost::Name for RedisProxyExternalAuthResponse { + const NAME: &'static str = "RedisProxyExternalAuthResponse"; + const PACKAGE: &'static str = "envoy.service.redis_auth.v3"; fn full_name() -> ::prost::alloc::string::String { - "envoy.service.trace.v3.StreamTracesMessage".into() + "envoy.service.redis_auth.v3.RedisProxyExternalAuthResponse".into() } fn type_url() -> ::prost::alloc::string::String { - "type.googleapis.com/envoy.service.trace.v3.StreamTracesMessage".into() + "type.googleapis.com/envoy.service.redis_auth.v3.RedisProxyExternalAuthResponse" + .into() } } /// Generated client implementations. -pub mod trace_service_client { +pub mod redis_proxy_external_auth_client { #![allow( unused_variables, dead_code, @@ -67,15 +57,14 @@ pub mod trace_service_client { )] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Service for streaming traces to server that consumes the trace data. It - /// uses OpenCensus data model as a standard to represent trace information. + /// A generic interface for performing external password authentication on incoming AUTH commands. #[derive(Debug, Clone)] - pub struct TraceServiceClient { + pub struct RedisProxyExternalAuthClient { inner: tonic::client::Grpc, } - impl TraceServiceClient + impl RedisProxyExternalAuthClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -91,21 +80,23 @@ pub mod trace_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> TraceServiceClient> + ) -> RedisProxyExternalAuthClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { - TraceServiceClient::new(InterceptedService::new(inner, interceptor)) + RedisProxyExternalAuthClient::new( + InterceptedService::new(inner, interceptor), + ) } /// Compress requests with the given encoding. /// @@ -138,16 +129,13 @@ pub mod trace_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Envoy will connect and send StreamTracesMessage messages forever. It does - /// not expect any response to be sent as nothing would be done in the case - /// of failure. - pub async fn stream_traces( + /// Performs authentication check based on the data sent with the AUTH request. + /// Returns either an OK status or an error status. + pub async fn authenticate( &mut self, - request: impl tonic::IntoStreamingRequest< - Message = super::StreamTracesMessage, - >, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -160,22 +148,22 @@ pub mod trace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/envoy.service.trace.v3.TraceService/StreamTraces", + "/envoy.service.redis_auth.v3.RedisProxyExternalAuth/Authenticate", ); - let mut req = request.into_streaming_request(); + let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "envoy.service.trace.v3.TraceService", - "StreamTraces", + "envoy.service.redis_auth.v3.RedisProxyExternalAuth", + "Authenticate", ), ); - self.inner.client_streaming(req, path, codec).await + self.inner.unary(req, path, codec).await } } } /// Generated server implementations. -pub mod trace_service_server { +pub mod redis_proxy_external_auth_server { #![allow( unused_variables, dead_code, @@ -184,31 +172,29 @@ pub mod trace_service_server { clippy::let_unit_value, )] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with TraceServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with RedisProxyExternalAuthServer. #[async_trait] - pub trait TraceService: std::marker::Send + std::marker::Sync + 'static { - /// Envoy will connect and send StreamTracesMessage messages forever. It does - /// not expect any response to be sent as nothing would be done in the case - /// of failure. - async fn stream_traces( + pub trait RedisProxyExternalAuth: std::marker::Send + std::marker::Sync + 'static { + /// Performs authentication check based on the data sent with the AUTH request. + /// Returns either an OK status or an error status. + async fn authenticate( &self, - request: tonic::Request>, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Service for streaming traces to server that consumes the trace data. It - /// uses OpenCensus data model as a standard to represent trace information. + /// A generic interface for performing external password authentication on incoming AUTH commands. #[derive(Debug)] - pub struct TraceServiceServer { + pub struct RedisProxyExternalAuthServer { inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl TraceServiceServer { + impl RedisProxyExternalAuthServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -259,13 +245,14 @@ pub mod trace_service_server { self } } - impl tonic::codegen::Service> for TraceServiceServer + impl tonic::codegen::Service> + for RedisProxyExternalAuthServer where - T: TraceService, + T: RedisProxyExternalAuth, B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -276,27 +263,26 @@ pub mod trace_service_server { } fn call(&mut self, req: http::Request) -> Self::Future { match req.uri().path() { - "/envoy.service.trace.v3.TraceService/StreamTraces" => { + "/envoy.service.redis_auth.v3.RedisProxyExternalAuth/Authenticate" => { #[allow(non_camel_case_types)] - struct StreamTracesSvc(pub Arc); + struct AuthenticateSvc(pub Arc); impl< - T: TraceService, - > tonic::server::ClientStreamingService - for StreamTracesSvc { - type Response = super::StreamTracesResponse; + T: RedisProxyExternalAuth, + > tonic::server::UnaryService + for AuthenticateSvc { + type Response = super::RedisProxyExternalAuthResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - tonic::Streaming, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::stream_traces(&inner, request).await + ::authenticate(&inner, request) + .await }; Box::pin(fut) } @@ -307,7 +293,7 @@ pub mod trace_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let method = StreamTracesSvc(inner); + let method = AuthenticateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -318,14 +304,16 @@ pub mod trace_service_server { max_decoding_message_size, max_encoding_message_size, ); - let res = grpc.client_streaming(method, req).await; + let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( @@ -343,7 +331,7 @@ pub mod trace_service_server { } } } - impl Clone for TraceServiceServer { + impl Clone for RedisProxyExternalAuthServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -356,8 +344,8 @@ pub mod trace_service_server { } } /// Generated gRPC service name - pub const SERVICE_NAME: &str = "envoy.service.trace.v3.TraceService"; - impl tonic::server::NamedService for TraceServiceServer { + pub const SERVICE_NAME: &str = "envoy.service.redis_auth.v3.RedisProxyExternalAuth"; + impl tonic::server::NamedService for RedisProxyExternalAuthServer { const NAME: &'static str = SERVICE_NAME; } } diff --git a/src/generated/envoy.service.redis_auth.v3.serde.rs b/src/generated/envoy.service.redis_auth.v3.serde.rs new file mode 100644 index 0000000..4f78323 --- /dev/null +++ b/src/generated/envoy.service.redis_auth.v3.serde.rs @@ -0,0 +1,233 @@ +impl serde::Serialize for RedisProxyExternalAuthRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.username.is_empty() { + len += 1; + } + if !self.password.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.redis_auth.v3.RedisProxyExternalAuthRequest", len)?; + if !self.username.is_empty() { + struct_ser.serialize_field("username", &self.username)?; + } + if !self.password.is_empty() { + struct_ser.serialize_field("password", &self.password)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RedisProxyExternalAuthRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "username", + "password", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Username, + Password, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "username" => Ok(GeneratedField::Username), + "password" => Ok(GeneratedField::Password), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RedisProxyExternalAuthRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.redis_auth.v3.RedisProxyExternalAuthRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut username__ = None; + let mut password__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Username => { + if username__.is_some() { + return Err(serde::de::Error::duplicate_field("username")); + } + username__ = Some(map_.next_value()?); + } + GeneratedField::Password => { + if password__.is_some() { + return Err(serde::de::Error::duplicate_field("password")); + } + password__ = Some(map_.next_value()?); + } + } + } + Ok(RedisProxyExternalAuthRequest { + username: username__.unwrap_or_default(), + password: password__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.service.redis_auth.v3.RedisProxyExternalAuthRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RedisProxyExternalAuthResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.status.is_some() { + len += 1; + } + if self.expiration.is_some() { + len += 1; + } + if !self.message.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("envoy.service.redis_auth.v3.RedisProxyExternalAuthResponse", len)?; + if let Some(v) = self.status.as_ref() { + struct_ser.serialize_field("status", v)?; + } + if let Some(v) = self.expiration.as_ref() { + struct_ser.serialize_field("expiration", v)?; + } + if !self.message.is_empty() { + struct_ser.serialize_field("message", &self.message)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RedisProxyExternalAuthResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "status", + "expiration", + "message", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Status, + Expiration, + Message, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "status" => Ok(GeneratedField::Status), + "expiration" => Ok(GeneratedField::Expiration), + "message" => Ok(GeneratedField::Message), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RedisProxyExternalAuthResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct envoy.service.redis_auth.v3.RedisProxyExternalAuthResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut status__ = None; + let mut expiration__ = None; + let mut message__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = map_.next_value()?; + } + GeneratedField::Expiration => { + if expiration__.is_some() { + return Err(serde::de::Error::duplicate_field("expiration")); + } + expiration__ = map_.next_value()?; + } + GeneratedField::Message => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("message")); + } + message__ = Some(map_.next_value()?); + } + } + } + Ok(RedisProxyExternalAuthResponse { + status: status__, + expiration: expiration__, + message: message__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("envoy.service.redis_auth.v3.RedisProxyExternalAuthResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/generated/envoy.service.route.v3.rs b/src/generated/envoy.service.route.v3.rs index 841a183..ef22be1 100644 --- a/src/generated/envoy.service.route.v3.rs +++ b/src/generated/envoy.service.route.v3.rs @@ -35,7 +35,7 @@ pub mod route_discovery_service_client { } impl RouteDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -56,13 +56,13 @@ pub mod route_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { RouteDiscoveryServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -228,7 +228,7 @@ pub mod virtual_host_discovery_service_client { } impl VirtualHostDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -249,13 +249,13 @@ pub mod virtual_host_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { VirtualHostDiscoveryServiceClient::new( @@ -460,7 +460,7 @@ pub mod route_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -626,7 +626,9 @@ pub mod route_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( @@ -772,7 +774,7 @@ pub mod virtual_host_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -842,7 +844,9 @@ pub mod virtual_host_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( @@ -916,7 +920,7 @@ pub mod scoped_routes_discovery_service_client { } impl ScopedRoutesDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -937,13 +941,13 @@ pub mod scoped_routes_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { ScopedRoutesDiscoveryServiceClient::new( @@ -1216,7 +1220,7 @@ pub mod scoped_routes_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1397,7 +1401,9 @@ pub mod scoped_routes_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.runtime.v3.rs b/src/generated/envoy.service.runtime.v3.rs index bf3b225..d236cf2 100644 --- a/src/generated/envoy.service.runtime.v3.rs +++ b/src/generated/envoy.service.runtime.v3.rs @@ -53,7 +53,7 @@ pub mod runtime_discovery_service_client { } impl RuntimeDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -74,13 +74,13 @@ pub mod runtime_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { RuntimeDiscoveryServiceClient::new( @@ -347,7 +347,7 @@ pub mod runtime_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -522,7 +522,9 @@ pub mod runtime_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.secret.v3.rs b/src/generated/envoy.service.secret.v3.rs index 8b5623d..b3218ef 100644 --- a/src/generated/envoy.service.secret.v3.rs +++ b/src/generated/envoy.service.secret.v3.rs @@ -30,7 +30,7 @@ pub mod secret_discovery_service_client { } impl SecretDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -51,13 +51,13 @@ pub mod secret_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { SecretDiscoveryServiceClient::new( @@ -323,7 +323,7 @@ pub mod secret_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -498,7 +498,9 @@ pub mod secret_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.status.v3.rs b/src/generated/envoy.service.status.v3.rs index cee0eba..f8252b5 100644 --- a/src/generated/envoy.service.status.v3.rs +++ b/src/generated/envoy.service.status.v3.rs @@ -248,6 +248,10 @@ pub enum ClientConfigStatus { /// config dump is not the NACKed version, but the most recent accepted one. If /// no config is accepted yet, the attached config dump will be empty. ClientNacked = 3, + /// Client received an error from the control plane. The attached config + /// dump is the most recent accepted one. If no config is accepted yet, + /// the attached config dump will be empty. + ClientReceivedError = 4, } impl ClientConfigStatus { /// String value of the enum field names used in the ProtoBuf definition. @@ -260,6 +264,7 @@ impl ClientConfigStatus { Self::ClientRequested => "CLIENT_REQUESTED", Self::ClientAcked => "CLIENT_ACKED", Self::ClientNacked => "CLIENT_NACKED", + Self::ClientReceivedError => "CLIENT_RECEIVED_ERROR", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -269,6 +274,7 @@ impl ClientConfigStatus { "CLIENT_REQUESTED" => Some(Self::ClientRequested), "CLIENT_ACKED" => Some(Self::ClientAcked), "CLIENT_NACKED" => Some(Self::ClientNacked), + "CLIENT_RECEIVED_ERROR" => Some(Self::ClientReceivedError), _ => None, } } @@ -293,7 +299,7 @@ pub mod client_status_discovery_service_client { } impl ClientStatusDiscoveryServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -314,13 +320,13 @@ pub mod client_status_discovery_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { ClientStatusDiscoveryServiceClient::new( @@ -523,7 +529,7 @@ pub mod client_status_discovery_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -641,7 +647,9 @@ pub mod client_status_discovery_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.status.v3.serde.rs b/src/generated/envoy.service.status.v3.serde.rs index a98bc39..daa1086 100644 --- a/src/generated/envoy.service.status.v3.serde.rs +++ b/src/generated/envoy.service.status.v3.serde.rs @@ -393,6 +393,7 @@ impl serde::Serialize for ClientConfigStatus { Self::ClientRequested => "CLIENT_REQUESTED", Self::ClientAcked => "CLIENT_ACKED", Self::ClientNacked => "CLIENT_NACKED", + Self::ClientReceivedError => "CLIENT_RECEIVED_ERROR", }; serializer.serialize_str(variant) } @@ -408,6 +409,7 @@ impl<'de> serde::Deserialize<'de> for ClientConfigStatus { "CLIENT_REQUESTED", "CLIENT_ACKED", "CLIENT_NACKED", + "CLIENT_RECEIVED_ERROR", ]; struct GeneratedVisitor; @@ -452,6 +454,7 @@ impl<'de> serde::Deserialize<'de> for ClientConfigStatus { "CLIENT_REQUESTED" => Ok(ClientConfigStatus::ClientRequested), "CLIENT_ACKED" => Ok(ClientConfigStatus::ClientAcked), "CLIENT_NACKED" => Ok(ClientConfigStatus::ClientNacked), + "CLIENT_RECEIVED_ERROR" => Ok(ClientConfigStatus::ClientReceivedError), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } diff --git a/src/generated/envoy.service.tap.v3.rs b/src/generated/envoy.service.tap.v3.rs index 5a7a4de..844aaea 100644 --- a/src/generated/envoy.service.tap.v3.rs +++ b/src/generated/envoy.service.tap.v3.rs @@ -83,7 +83,7 @@ pub mod tap_sink_service_client { } impl TapSinkServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, @@ -104,13 +104,13 @@ pub mod tap_sink_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , + http::Request, >>::Error: Into + std::marker::Send + std::marker::Sync, { TapSinkServiceClient::new(InterceptedService::new(inner, interceptor)) @@ -268,7 +268,7 @@ pub mod tap_sink_service_server { B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -328,7 +328,9 @@ pub mod tap_sink_service_server { } _ => { Box::pin(async move { - let mut response = http::Response::new(empty_body()); + let mut response = http::Response::new( + tonic::body::Body::default(), + ); let headers = response.headers_mut(); headers .insert( diff --git a/src/generated/envoy.service.trace.v3.serde.rs b/src/generated/envoy.service.trace.v3.serde.rs deleted file mode 100644 index 81b83a4..0000000 --- a/src/generated/envoy.service.trace.v3.serde.rs +++ /dev/null @@ -1,270 +0,0 @@ -impl serde::Serialize for StreamTracesMessage { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.identifier.is_some() { - len += 1; - } - if !self.spans.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("envoy.service.trace.v3.StreamTracesMessage", len)?; - if let Some(v) = self.identifier.as_ref() { - struct_ser.serialize_field("identifier", v)?; - } - if !self.spans.is_empty() { - struct_ser.serialize_field("spans", &self.spans)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StreamTracesMessage { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "identifier", - "spans", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Identifier, - Spans, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "identifier" => Ok(GeneratedField::Identifier), - "spans" => Ok(GeneratedField::Spans), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamTracesMessage; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct envoy.service.trace.v3.StreamTracesMessage") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut identifier__ = None; - let mut spans__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Identifier => { - if identifier__.is_some() { - return Err(serde::de::Error::duplicate_field("identifier")); - } - identifier__ = map_.next_value()?; - } - GeneratedField::Spans => { - if spans__.is_some() { - return Err(serde::de::Error::duplicate_field("spans")); - } - spans__ = Some(map_.next_value()?); - } - } - } - Ok(StreamTracesMessage { - identifier: identifier__, - spans: spans__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("envoy.service.trace.v3.StreamTracesMessage", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for stream_traces_message::Identifier { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.node.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("envoy.service.trace.v3.StreamTracesMessage.Identifier", len)?; - if let Some(v) = self.node.as_ref() { - struct_ser.serialize_field("node", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for stream_traces_message::Identifier { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "node", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Node, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "node" => Ok(GeneratedField::Node), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = stream_traces_message::Identifier; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct envoy.service.trace.v3.StreamTracesMessage.Identifier") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut node__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Node => { - if node__.is_some() { - return Err(serde::de::Error::duplicate_field("node")); - } - node__ = map_.next_value()?; - } - } - } - Ok(stream_traces_message::Identifier { - node: node__, - }) - } - } - deserializer.deserialize_struct("envoy.service.trace.v3.StreamTracesMessage.Identifier", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StreamTracesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("envoy.service.trace.v3.StreamTracesResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StreamTracesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - Err(serde::de::Error::unknown_field(value, FIELDS)) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamTracesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct envoy.service.trace.v3.StreamTracesResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(StreamTracesResponse { - }) - } - } - deserializer.deserialize_struct("envoy.service.trace.v3.StreamTracesResponse", FIELDS, GeneratedVisitor) - } -} diff --git a/src/generated/google.api.expr.v1alpha1.rs b/src/generated/google.api.expr.v1alpha1.rs index 6948c05..da07100 100644 --- a/src/generated/google.api.expr.v1alpha1.rs +++ b/src/generated/google.api.expr.v1alpha1.rs @@ -26,14 +26,16 @@ impl ::prost::Name for ParsedExpr { /// operators with the exception of the '.' operator are modelled as function /// calls. This makes it easy to represent new operators into the existing AST. /// -/// All references within expressions must resolve to a [Decl][google.api.expr.v1alpha1.Decl] provided at -/// type-check for an expression to be valid. A reference may either be a bare -/// identifier `name` or a qualified identifier `google.api.name`. References -/// may either refer to a value or a function declaration. +/// All references within expressions must resolve to a +/// [Decl][google.api.expr.v1alpha1.Decl] provided at type-check for an +/// expression to be valid. A reference may either be a bare identifier `name` or +/// a qualified identifier `google.api.name`. References may either refer to a +/// value or a function declaration. /// /// For example, the expression `google.api.name.startsWith('expr')` references -/// the declaration `google.api.name` within a [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and -/// the function declaration `startsWith`. +/// the declaration `google.api.name` within a +/// [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the +/// function declaration `startsWith`. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Expr { /// Required. An id assigned to this node by the parser which is unique in a @@ -53,7 +55,8 @@ pub mod expr { /// Required. Holds a single, unqualified identifier, possibly preceded by a /// '.'. /// - /// Qualified names are represented by the [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. + /// Qualified names are represented by the + /// [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } @@ -251,12 +254,50 @@ pub mod expr { /// messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the /// macro tests whether the property is set to its default. For map and struct /// types, the macro tests whether the property `x` is defined on `m`. + /// + /// Comprehensions for the standard environment macros evaluation can be best + /// visualized as the following pseudocode: + /// + /// ``` + /// let `accu_var` = `accu_init` + /// for (let `iter_var` in `iter_range`) { + /// if (!`loop_condition`) { + /// break + /// } + /// `accu_var` = `loop_step` + /// } + /// return `result` + /// ``` + /// + /// Comprehensions for the optional V2 macros which support map-to-map + /// translation differ slightly from the standard environment macros in that + /// they expose both the key or index in addition to the value for each list + /// or map entry: + /// + /// ``` + /// let `accu_var` = `accu_init` + /// for (let `iter_var`, `iter_var2` in `iter_range`) { + /// if (!`loop_condition`) { + /// break + /// } + /// `accu_var` = `loop_step` + /// } + /// return `result` + /// ``` #[derive(Clone, PartialEq, ::prost::Message)] pub struct Comprehension { - /// The name of the iteration variable. + /// The name of the first iteration variable. + /// When the iter_range is a list, this variable is the list element. + /// When the iter_range is a map, this variable is the map entry key. #[prost(string, tag = "1")] pub iter_var: ::prost::alloc::string::String, - /// The range over which var iterates. + /// The name of the second iteration variable, empty if not set. + /// When the iter_range is a list, this variable is the integer index. + /// When the iter_range is a map, this variable is the map entry value. + /// This field is only set for comprehension v2 macros. + #[prost(string, tag = "8")] + pub iter_var2: ::prost::alloc::string::String, + /// The range over which the comprehension iterates. #[prost(message, optional, boxed, tag = "2")] pub iter_range: ::core::option::Option<::prost::alloc::boxed::Box>, /// The name of the variable used for accumulation of the result. @@ -265,7 +306,7 @@ pub mod expr { /// The initial value of the accumulator. #[prost(message, optional, boxed, tag = "4")] pub accu_init: ::core::option::Option<::prost::alloc::boxed::Box>, - /// An expression which can contain iter_var and accu_var. + /// An expression which can contain iter_var, iter_var2, and accu_var. /// /// Returns false when the result has been computed and may be used as /// a hint to short-circuit the remainder of the comprehension. @@ -273,7 +314,7 @@ pub mod expr { pub loop_condition: ::core::option::Option< ::prost::alloc::boxed::Box, >, - /// An expression which can contain iter_var and accu_var. + /// An expression which can contain iter_var, iter_var2, and accu_var. /// /// Computes the next value of accu_var. #[prost(message, optional, boxed, tag = "6")] @@ -339,7 +380,8 @@ impl ::prost::Name for Expr { /// primitives. /// /// Lists and structs are not included as constants as these aggregate types may -/// contain [Expr][google.api.expr.v1alpha1.Expr] elements which require evaluation and are thus not constant. +/// contain [Expr][google.api.expr.v1alpha1.Expr] elements which require +/// evaluation and are thus not constant. /// /// Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, /// `true`, `null`. @@ -435,6 +477,119 @@ pub struct SourceInfo { /// value is the call `Expr` that was replaced. #[prost(map = "int64, message", tag = "5")] pub macro_calls: ::std::collections::HashMap, + /// A list of tags for extensions that were used while parsing or type checking + /// the source expression. For example, optimizations that require special + /// runtime support may be specified. + /// + /// These are used to check feature support between components in separate + /// implementations. This can be used to either skip redundant work or + /// report an error if the extension is unsupported. + #[prost(message, repeated, tag = "6")] + pub extensions: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `SourceInfo`. +pub mod source_info { + /// An extension that was requested for the source expression. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Extension { + /// Identifier for the extension. Example: constant_folding + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// If set, the listed components must understand the extension for the + /// expression to evaluate correctly. + /// + /// This field has set semantics, repeated values should be deduplicated. + #[prost(enumeration = "extension::Component", repeated, tag = "2")] + pub affected_components: ::prost::alloc::vec::Vec, + /// Version info. May be skipped if it isn't meaningful for the extension. + /// (for example constant_folding might always be v0.0). + #[prost(message, optional, tag = "3")] + pub version: ::core::option::Option, + } + /// Nested message and enum types in `Extension`. + pub mod extension { + /// Version + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct Version { + /// Major version changes indicate different required support level from + /// the required components. + #[prost(int64, tag = "1")] + pub major: i64, + /// Minor version changes must not change the observed behavior from + /// existing implementations, but may be provided informationally. + #[prost(int64, tag = "2")] + pub minor: i64, + } + impl ::prost::Name for Version { + const NAME: &'static str = "Version"; + const PACKAGE: &'static str = "google.api.expr.v1alpha1"; + fn full_name() -> ::prost::alloc::string::String { + "google.api.expr.v1alpha1.SourceInfo.Extension.Version".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/google.api.expr.v1alpha1.SourceInfo.Extension.Version".into() + } + } + /// CEL component specifier. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Component { + /// Unspecified, default. + Unspecified = 0, + /// Parser. Converts a CEL string to an AST. + Parser = 1, + /// Type checker. Checks that references in an AST are defined and types + /// agree. + TypeChecker = 2, + /// Runtime. Evaluates a parsed and optionally checked CEL AST against a + /// context. + Runtime = 3, + } + impl Component { + /// 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::Unspecified => "COMPONENT_UNSPECIFIED", + Self::Parser => "COMPONENT_PARSER", + Self::TypeChecker => "COMPONENT_TYPE_CHECKER", + Self::Runtime => "COMPONENT_RUNTIME", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "COMPONENT_UNSPECIFIED" => Some(Self::Unspecified), + "COMPONENT_PARSER" => Some(Self::Parser), + "COMPONENT_TYPE_CHECKER" => Some(Self::TypeChecker), + "COMPONENT_RUNTIME" => Some(Self::Runtime), + _ => None, + } + } + } + } + impl ::prost::Name for Extension { + const NAME: &'static str = "Extension"; + const PACKAGE: &'static str = "google.api.expr.v1alpha1"; + fn full_name() -> ::prost::alloc::string::String { + "google.api.expr.v1alpha1.SourceInfo.Extension".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/google.api.expr.v1alpha1.SourceInfo.Extension".into() + } + } } impl ::prost::Name for SourceInfo { const NAME: &'static str = "SourceInfo"; diff --git a/src/generated/google.api.expr.v1alpha1.serde.rs b/src/generated/google.api.expr.v1alpha1.serde.rs index b02b375..d1c1f51 100644 --- a/src/generated/google.api.expr.v1alpha1.serde.rs +++ b/src/generated/google.api.expr.v1alpha1.serde.rs @@ -1237,6 +1237,9 @@ impl serde::Serialize for expr::Comprehension { if !self.iter_var.is_empty() { len += 1; } + if !self.iter_var2.is_empty() { + len += 1; + } if self.iter_range.is_some() { len += 1; } @@ -1259,6 +1262,9 @@ impl serde::Serialize for expr::Comprehension { if !self.iter_var.is_empty() { struct_ser.serialize_field("iter_var", &self.iter_var)?; } + if !self.iter_var2.is_empty() { + struct_ser.serialize_field("iter_var2", &self.iter_var2)?; + } if let Some(v) = self.iter_range.as_ref() { struct_ser.serialize_field("iter_range", v)?; } @@ -1289,6 +1295,8 @@ impl<'de> serde::Deserialize<'de> for expr::Comprehension { const FIELDS: &[&str] = &[ "iter_var", "iterVar", + "iter_var2", + "iterVar2", "iter_range", "iterRange", "accu_var", @@ -1305,6 +1313,7 @@ impl<'de> serde::Deserialize<'de> for expr::Comprehension { #[allow(clippy::enum_variant_names)] enum GeneratedField { IterVar, + IterVar2, IterRange, AccuVar, AccuInit, @@ -1333,6 +1342,7 @@ impl<'de> serde::Deserialize<'de> for expr::Comprehension { { match value { "iterVar" | "iter_var" => Ok(GeneratedField::IterVar), + "iterVar2" | "iter_var2" => Ok(GeneratedField::IterVar2), "iterRange" | "iter_range" => Ok(GeneratedField::IterRange), "accuVar" | "accu_var" => Ok(GeneratedField::AccuVar), "accuInit" | "accu_init" => Ok(GeneratedField::AccuInit), @@ -1359,6 +1369,7 @@ impl<'de> serde::Deserialize<'de> for expr::Comprehension { V: serde::de::MapAccess<'de>, { let mut iter_var__ = None; + let mut iter_var2__ = None; let mut iter_range__ = None; let mut accu_var__ = None; let mut accu_init__ = None; @@ -1373,6 +1384,12 @@ impl<'de> serde::Deserialize<'de> for expr::Comprehension { } iter_var__ = Some(map_.next_value()?); } + GeneratedField::IterVar2 => { + if iter_var2__.is_some() { + return Err(serde::de::Error::duplicate_field("iterVar2")); + } + iter_var2__ = Some(map_.next_value()?); + } GeneratedField::IterRange => { if iter_range__.is_some() { return Err(serde::de::Error::duplicate_field("iterRange")); @@ -1413,6 +1430,7 @@ impl<'de> serde::Deserialize<'de> for expr::Comprehension { } Ok(expr::Comprehension { iter_var: iter_var__.unwrap_or_default(), + iter_var2: iter_var2__.unwrap_or_default(), iter_range: iter_range__, accu_var: accu_var__.unwrap_or_default(), accu_init: accu_init__, @@ -2287,6 +2305,9 @@ impl serde::Serialize for SourceInfo { if !self.macro_calls.is_empty() { len += 1; } + if !self.extensions.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.api.expr.v1alpha1.SourceInfo", len)?; if !self.syntax_version.is_empty() { struct_ser.serialize_field("syntax_version", &self.syntax_version)?; @@ -2303,6 +2324,9 @@ impl serde::Serialize for SourceInfo { if !self.macro_calls.is_empty() { struct_ser.serialize_field("macro_calls", &self.macro_calls)?; } + if !self.extensions.is_empty() { + struct_ser.serialize_field("extensions", &self.extensions)?; + } struct_ser.end() } } @@ -2321,6 +2345,7 @@ impl<'de> serde::Deserialize<'de> for SourceInfo { "positions", "macro_calls", "macroCalls", + "extensions", ]; #[allow(clippy::enum_variant_names)] @@ -2330,6 +2355,7 @@ impl<'de> serde::Deserialize<'de> for SourceInfo { LineOffsets, Positions, MacroCalls, + Extensions, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -2356,6 +2382,7 @@ impl<'de> serde::Deserialize<'de> for SourceInfo { "lineOffsets" | "line_offsets" => Ok(GeneratedField::LineOffsets), "positions" => Ok(GeneratedField::Positions), "macroCalls" | "macro_calls" => Ok(GeneratedField::MacroCalls), + "extensions" => Ok(GeneratedField::Extensions), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2380,6 +2407,7 @@ impl<'de> serde::Deserialize<'de> for SourceInfo { let mut line_offsets__ = None; let mut positions__ = None; let mut macro_calls__ = None; + let mut extensions__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SyntaxVersion => { @@ -2421,6 +2449,12 @@ impl<'de> serde::Deserialize<'de> for SourceInfo { .into_iter().map(|(k,v)| (k.0, v)).collect() ); } + GeneratedField::Extensions => { + if extensions__.is_some() { + return Err(serde::de::Error::duplicate_field("extensions")); + } + extensions__ = Some(map_.next_value()?); + } } } Ok(SourceInfo { @@ -2429,12 +2463,336 @@ impl<'de> serde::Deserialize<'de> for SourceInfo { line_offsets: line_offsets__.unwrap_or_default(), positions: positions__.unwrap_or_default(), macro_calls: macro_calls__.unwrap_or_default(), + extensions: extensions__.unwrap_or_default(), }) } } deserializer.deserialize_struct("google.api.expr.v1alpha1.SourceInfo", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for source_info::Extension { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.id.is_empty() { + len += 1; + } + if !self.affected_components.is_empty() { + len += 1; + } + if self.version.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.api.expr.v1alpha1.SourceInfo.Extension", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.affected_components.is_empty() { + let v = self.affected_components.iter().cloned().map(|v| { + source_info::extension::Component::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("affected_components", &v)?; + } + if let Some(v) = self.version.as_ref() { + struct_ser.serialize_field("version", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for source_info::Extension { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "affected_components", + "affectedComponents", + "version", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + AffectedComponents, + Version, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "id" => Ok(GeneratedField::Id), + "affectedComponents" | "affected_components" => Ok(GeneratedField::AffectedComponents), + "version" => Ok(GeneratedField::Version), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = source_info::Extension; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct google.api.expr.v1alpha1.SourceInfo.Extension") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut affected_components__ = None; + let mut version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + GeneratedField::AffectedComponents => { + if affected_components__.is_some() { + return Err(serde::de::Error::duplicate_field("affectedComponents")); + } + affected_components__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = map_.next_value()?; + } + } + } + Ok(source_info::Extension { + id: id__.unwrap_or_default(), + affected_components: affected_components__.unwrap_or_default(), + version: version__, + }) + } + } + deserializer.deserialize_struct("google.api.expr.v1alpha1.SourceInfo.Extension", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for source_info::extension::Component { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "COMPONENT_UNSPECIFIED", + Self::Parser => "COMPONENT_PARSER", + Self::TypeChecker => "COMPONENT_TYPE_CHECKER", + Self::Runtime => "COMPONENT_RUNTIME", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for source_info::extension::Component { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "COMPONENT_UNSPECIFIED", + "COMPONENT_PARSER", + "COMPONENT_TYPE_CHECKER", + "COMPONENT_RUNTIME", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = source_info::extension::Component; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "COMPONENT_UNSPECIFIED" => Ok(source_info::extension::Component::Unspecified), + "COMPONENT_PARSER" => Ok(source_info::extension::Component::Parser), + "COMPONENT_TYPE_CHECKER" => Ok(source_info::extension::Component::TypeChecker), + "COMPONENT_RUNTIME" => Ok(source_info::extension::Component::Runtime), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for source_info::extension::Version { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.major != 0 { + len += 1; + } + if self.minor != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.api.expr.v1alpha1.SourceInfo.Extension.Version", len)?; + if self.major != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("major", ToString::to_string(&self.major).as_str())?; + } + if self.minor != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("minor", ToString::to_string(&self.minor).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for source_info::extension::Version { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "major", + "minor", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Major, + Minor, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "major" => Ok(GeneratedField::Major), + "minor" => Ok(GeneratedField::Minor), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = source_info::extension::Version; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct google.api.expr.v1alpha1.SourceInfo.Extension.Version") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut major__ = None; + let mut minor__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Major => { + if major__.is_some() { + return Err(serde::de::Error::duplicate_field("major")); + } + major__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Minor => { + if minor__.is_some() { + return Err(serde::de::Error::duplicate_field("minor")); + } + minor__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(source_info::extension::Version { + major: major__.unwrap_or_default(), + minor: minor__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.api.expr.v1alpha1.SourceInfo.Extension.Version", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for SourcePosition { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/google.api.rs b/src/generated/google.api.rs index 7debc7f..7580938 100644 --- a/src/generated/google.api.rs +++ b/src/generated/google.api.rs @@ -28,7 +28,7 @@ impl ::prost::Name for Http { "/google.api.Http".into() } } -/// # gRPC Transcoding +/// gRPC Transcoding /// /// gRPC Transcoding is a feature for mapping between a gRPC method and one or /// more HTTP REST endpoints. It allows developers to build a single API service @@ -69,9 +69,8 @@ impl ::prost::Name for Http { /// /// This enables an HTTP REST to gRPC mapping as below: /// -/// HTTP | gRPC -/// -----|----- -/// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +/// - HTTP: `GET /v1/messages/123456` +/// - gRPC: `GetMessage(name: "messages/123456")` /// /// Any fields in the request message which are not bound by the path template /// automatically become HTTP query parameters if there is no HTTP request body. @@ -95,11 +94,9 @@ impl ::prost::Name for Http { /// /// This enables a HTTP JSON to RPC mapping as below: /// -/// HTTP | gRPC -/// -----|----- -/// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -/// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -/// "foo"))` +/// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` +/// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: +/// SubMessage(subfield: "foo"))` /// /// Note that fields which are mapped to URL query parameters must have a /// primitive type or a repeated primitive type or a non-repeated message type. @@ -129,10 +126,8 @@ impl ::prost::Name for Http { /// representation of the JSON in the request body is determined by /// protos JSON encoding: /// -/// HTTP | gRPC -/// -----|----- -/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -/// "123456" message { text: "Hi!" })` +/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +/// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` /// /// The special name `*` can be used in the body mapping to define that /// every field not bound by the path template should be mapped to the @@ -155,10 +150,8 @@ impl ::prost::Name for Http { /// /// The following HTTP JSON to RPC mapping is enabled: /// -/// HTTP | gRPC -/// -----|----- -/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -/// "123456" text: "Hi!")` +/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +/// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` /// /// Note that when using `*` in the body mapping, it is not possible to /// have HTTP parameters, as all fields not bound by the path end in @@ -186,29 +179,32 @@ impl ::prost::Name for Http { /// /// This enables the following two alternative HTTP JSON to RPC mappings: /// -/// HTTP | gRPC -/// -----|----- -/// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -/// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -/// "123456")` +/// - HTTP: `GET /v1/messages/123456` +/// - gRPC: `GetMessage(message_id: "123456")` /// -/// ## Rules for HTTP mapping +/// - HTTP: `GET /v1/users/me/messages/123456` +/// - gRPC: `GetMessage(user_id: "me" message_id: "123456")` +/// +/// Rules for HTTP mapping /// /// 1. Leaf request fields (recursive expansion nested messages in the request /// message) are classified into three categories: /// - Fields referred by the path template. They are passed via the URL path. -/// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +/// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They +/// are passed via the HTTP /// request body. /// - All other fields are passed via the URL query parameters, and the /// parameter name is the field path in the request message. A repeated /// field can be represented as multiple query parameters under the same /// name. -/// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +/// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL +/// query parameter, all fields /// are passed via URL path and HTTP request body. -/// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +/// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP +/// request body, all /// fields are passed via URL path and URL query parameters. /// -/// ### Path template syntax +/// Path template syntax /// /// Template = "/" Segments \[ Verb \] ; /// Segments = Segment { "/" Segment } ; @@ -247,7 +243,7 @@ impl ::prost::Name for Http { /// Document]() as /// `{+var}`. /// -/// ## Using gRPC API Service Configuration +/// Using gRPC API Service Configuration /// /// gRPC API Service Configuration (service config) is a configuration language /// for configuring a gRPC service to become a user-facing product. The @@ -262,15 +258,14 @@ impl ::prost::Name for Http { /// specified in the service config will override any matching transcoding /// configuration in the proto. /// -/// Example: +/// The following example selects a gRPC method and applies an `HttpRule` to it: /// /// http: /// rules: -/// # Selects a gRPC method and applies HttpRule to it. /// - selector: example.v1.Messaging.GetMessage /// get: /v1/messages/{message_id}/{sub.subfield} /// -/// ## Special notes +/// Special notes /// /// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the /// proto to JSON conversion must follow the [proto3 @@ -301,7 +296,8 @@ impl ::prost::Name for Http { pub struct HttpRule { /// Selects a method to which this rule applies. /// - /// Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + /// Refer to [selector][google.api.DocumentationRule.selector] for syntax + /// details. #[prost(string, tag = "1")] pub selector: ::prost::alloc::string::String, /// The name of the request field whose value is mapped to the HTTP request diff --git a/src/generated/google.protobuf.rs b/src/generated/google.protobuf.rs index 561d297..71ad2f9 100644 --- a/src/generated/google.protobuf.rs +++ b/src/generated/google.protobuf.rs @@ -120,6 +120,10 @@ pub struct FileDescriptorProto { /// For Google-internal migration only. Do not use. #[prost(int32, repeated, packed = "false", tag = "11")] pub weak_dependency: ::prost::alloc::vec::Vec, + /// Names of files imported by this file purely for the purpose of providing + /// option extensions. These are excluded from the dependency list above. + #[prost(string, repeated, tag = "15")] + pub option_dependency: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// All top-level definitions in this file. #[prost(message, repeated, tag = "4")] pub message_type: ::prost::alloc::vec::Vec, @@ -141,9 +145,15 @@ pub struct FileDescriptorProto { /// The supported values are "proto2", "proto3", and "editions". /// /// If `edition` is present, this value must be "editions". + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(string, optional, tag = "12")] pub syntax: ::core::option::Option<::prost::alloc::string::String>, /// The edition of the proto file. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(enumeration = "Edition", optional, tag = "14")] pub edition: ::core::option::Option, } @@ -182,6 +192,9 @@ pub struct DescriptorProto { /// A given name may only be reserved once. #[prost(string, repeated, tag = "10")] pub reserved_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Support for `export` and `local` keywords on enums. + #[prost(enumeration = "SymbolVisibility", optional, tag = "11")] + pub visibility: ::core::option::Option, } /// Nested message and enum types in `DescriptorProto`. pub mod descriptor_proto { @@ -607,6 +620,9 @@ pub struct EnumDescriptorProto { /// be reserved once. #[prost(string, repeated, tag = "5")] pub reserved_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Support for `export` and `local` keywords on enums. + #[prost(enumeration = "SymbolVisibility", optional, tag = "6")] + pub visibility: ::core::option::Option, } /// Nested message and enum types in `EnumDescriptorProto`. pub mod enum_descriptor_proto { @@ -828,6 +844,9 @@ pub struct FileOptions { #[prost(string, optional, tag = "45")] pub ruby_package: ::core::option::Option<::prost::alloc::string::String>, /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "50")] pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. @@ -963,6 +982,9 @@ pub struct MessageOptions { #[prost(bool, optional, tag = "11")] pub deprecated_legacy_json_field_conflicts: ::core::option::Option, /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "12")] pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. @@ -981,12 +1003,13 @@ impl ::prost::Name for MessageOptions { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct FieldOptions { + /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. /// The ctype option instructs the C++ code generator to use a different /// representation of the field than it normally would. See the specific /// options below. This option is only implemented to support use of /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of - /// type "bytes" in the open source release -- sorry, we'll try to include - /// other types in a future version! + /// type "bytes" in the open source release. + /// TODO: make ctype actually deprecated. #[prost( enumeration = "field_options::CType", optional, @@ -1075,6 +1098,9 @@ pub struct FieldOptions { #[prost(message, repeated, tag = "20")] pub edition_defaults: ::prost::alloc::vec::Vec, /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "21")] pub features: ::core::option::Option, #[prost(message, optional, tag = "22")] @@ -1224,8 +1250,6 @@ pub mod field_options { } } /// If set to RETENTION_SOURCE, the option will be omitted from the binary. - /// Note: as of January 2023, support for this is in progress and does not yet - /// have an effect (b/264593489). #[derive( Clone, Copy, @@ -1267,8 +1291,7 @@ pub mod field_options { } /// This indicates the types of entities that the field may apply to when used /// as an option. If it is unset, then the field may be freely used as an - /// option on any kind of entity. Note: as of January 2023, support for this is - /// in progress and does not yet have an effect (b/264593489). + /// option on any kind of entity. #[derive( Clone, Copy, @@ -1343,6 +1366,9 @@ impl ::prost::Name for FieldOptions { #[derive(Clone, PartialEq, ::prost::Message)] pub struct OneofOptions { /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "1")] pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. @@ -1381,6 +1407,9 @@ pub struct EnumOptions { #[prost(bool, optional, tag = "6")] pub deprecated_legacy_json_field_conflicts: ::core::option::Option, /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "7")] pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. @@ -1406,6 +1435,9 @@ pub struct EnumValueOptions { #[prost(bool, optional, tag = "1", default = "false")] pub deprecated: ::core::option::Option, /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "2")] pub features: ::core::option::Option, /// Indicate that fields annotated with this enum value should not be printed @@ -1433,6 +1465,9 @@ impl ::prost::Name for EnumValueOptions { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServiceOptions { /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "34")] pub features: ::core::option::Option, /// Is this service deprecated? @@ -1471,6 +1506,9 @@ pub struct MethodOptions { )] pub idempotency_level: ::core::option::Option, /// Any features defined in the specific edition. + /// WARNING: This field should only be used by protobuf plugins or special + /// cases like the proto compiler. Other uses are discouraged and + /// developers should rely on the protoreflect APIs for their client language. #[prost(message, optional, tag = "35")] pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. @@ -1614,9 +1652,83 @@ pub struct FeatureSet { pub message_encoding: ::core::option::Option, #[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")] pub json_format: ::core::option::Option, + #[prost(enumeration = "feature_set::EnforceNamingStyle", optional, tag = "7")] + pub enforce_naming_style: ::core::option::Option, + #[prost( + enumeration = "feature_set::visibility_feature::DefaultSymbolVisibility", + optional, + tag = "8" + )] + pub default_symbol_visibility: ::core::option::Option, } /// Nested message and enum types in `FeatureSet`. pub mod feature_set { + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct VisibilityFeature {} + /// Nested message and enum types in `VisibilityFeature`. + pub mod visibility_feature { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum DefaultSymbolVisibility { + Unknown = 0, + /// Default pre-EDITION_2024, all UNSET visibility are export. + ExportAll = 1, + /// All top-level symbols default to export, nested default to local. + ExportTopLevel = 2, + /// All symbols default to local. + LocalAll = 3, + /// All symbols local by default. Nested types cannot be exported. + /// With special case caveat for message { enum {} reserved 1 to max; } + /// This is the recommended setting for new protos. + Strict = 4, + } + impl DefaultSymbolVisibility { + /// 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::Unknown => "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", + Self::ExportAll => "EXPORT_ALL", + Self::ExportTopLevel => "EXPORT_TOP_LEVEL", + Self::LocalAll => "LOCAL_ALL", + Self::Strict => "STRICT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => Some(Self::Unknown), + "EXPORT_ALL" => Some(Self::ExportAll), + "EXPORT_TOP_LEVEL" => Some(Self::ExportTopLevel), + "LOCAL_ALL" => Some(Self::LocalAll), + "STRICT" => Some(Self::Strict), + _ => None, + } + } + } + } + impl ::prost::Name for VisibilityFeature { + const NAME: &'static str = "VisibilityFeature"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + "google.protobuf.FeatureSet.VisibilityFeature".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/google.protobuf.FeatureSet.VisibilityFeature".into() + } + } #[derive( Clone, Copy, @@ -1854,6 +1966,45 @@ pub mod feature_set { } } } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum EnforceNamingStyle { + Unknown = 0, + Style2024 = 1, + StyleLegacy = 2, + } + impl EnforceNamingStyle { + /// 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::Unknown => "ENFORCE_NAMING_STYLE_UNKNOWN", + Self::Style2024 => "STYLE2024", + Self::StyleLegacy => "STYLE_LEGACY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ENFORCE_NAMING_STYLE_UNKNOWN" => Some(Self::Unknown), + "STYLE2024" => Some(Self::Style2024), + "STYLE_LEGACY" => Some(Self::StyleLegacy), + _ => None, + } + } + } } impl ::prost::Name for FeatureSet { const NAME: &'static str = "FeatureSet"; @@ -2207,7 +2358,7 @@ pub enum Edition { Edition2023 = 1000, Edition2024 = 1001, /// Placeholder editions for testing feature resolution. These should not be - /// used or relyed on outside of tests. + /// used or relied on outside of tests. Edition1TestOnly = 1, Edition2TestOnly = 2, Edition99997TestOnly = 99997, @@ -2258,6 +2409,40 @@ impl Edition { } } } +/// Describes the 'visibility' of a symbol with respect to the proto import +/// system. Symbols can only be imported when the visibility rules do not prevent +/// it (ex: local symbols cannot be imported). Visibility modifiers can only set +/// on `message` and `enum` as they are the only types available to be referenced +/// from other files. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SymbolVisibility { + VisibilityUnset = 0, + VisibilityLocal = 1, + VisibilityExport = 2, +} +impl SymbolVisibility { + /// 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::VisibilityUnset => "VISIBILITY_UNSET", + Self::VisibilityLocal => "VISIBILITY_LOCAL", + Self::VisibilityExport => "VISIBILITY_EXPORT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VISIBILITY_UNSET" => Some(Self::VisibilityUnset), + "VISIBILITY_LOCAL" => Some(Self::VisibilityLocal), + "VISIBILITY_EXPORT" => Some(Self::VisibilityExport), + _ => None, + } + } +} /// A Timestamp represents a point in time independent of any time zone or local /// calendar, encoded as a count of seconds and fractions of seconds at /// nanosecond resolution. The count is relative to an epoch at UTC midnight on @@ -2375,6 +2560,9 @@ impl ::prost::Name for Timestamp { /// Wrapper message for `double`. /// /// The JSON representation for `DoubleValue` is JSON number. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DoubleValue { /// The double value. @@ -2394,6 +2582,9 @@ impl ::prost::Name for DoubleValue { /// Wrapper message for `float`. /// /// The JSON representation for `FloatValue` is JSON number. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FloatValue { /// The float value. @@ -2413,6 +2604,9 @@ impl ::prost::Name for FloatValue { /// Wrapper message for `int64`. /// /// The JSON representation for `Int64Value` is JSON string. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Int64Value { /// The int64 value. @@ -2432,6 +2626,9 @@ impl ::prost::Name for Int64Value { /// Wrapper message for `uint64`. /// /// The JSON representation for `UInt64Value` is JSON string. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UInt64Value { /// The uint64 value. @@ -2451,6 +2648,9 @@ impl ::prost::Name for UInt64Value { /// Wrapper message for `int32`. /// /// The JSON representation for `Int32Value` is JSON number. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Int32Value { /// The int32 value. @@ -2470,6 +2670,9 @@ impl ::prost::Name for Int32Value { /// Wrapper message for `uint32`. /// /// The JSON representation for `UInt32Value` is JSON number. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UInt32Value { /// The uint32 value. @@ -2489,6 +2692,9 @@ impl ::prost::Name for UInt32Value { /// Wrapper message for `bool`. /// /// The JSON representation for `BoolValue` is JSON `true` and `false`. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BoolValue { /// The bool value. @@ -2508,6 +2714,9 @@ impl ::prost::Name for BoolValue { /// Wrapper message for `string`. /// /// The JSON representation for `StringValue` is JSON string. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, PartialEq, ::prost::Message)] pub struct StringValue { /// The string value. @@ -2527,6 +2736,9 @@ impl ::prost::Name for StringValue { /// Wrapper message for `bytes`. /// /// The JSON representation for `BytesValue` is JSON string. +/// +/// Not recommended for use in new APIs, but still useful for legacy APIs and +/// has no plan to be removed. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BytesValue { /// The bytes value. diff --git a/src/generated/google.protobuf.serde.rs b/src/generated/google.protobuf.serde.rs index 7c237a6..75ec22d 100644 --- a/src/generated/google.protobuf.serde.rs +++ b/src/generated/google.protobuf.serde.rs @@ -222,6 +222,9 @@ impl serde::Serialize for DescriptorProto { if !self.reserved_name.is_empty() { len += 1; } + if self.visibility.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.DescriptorProto", len)?; if let Some(v) = self.name.as_ref() { struct_ser.serialize_field("name", v)?; @@ -253,6 +256,11 @@ impl serde::Serialize for DescriptorProto { if !self.reserved_name.is_empty() { struct_ser.serialize_field("reserved_name", &self.reserved_name)?; } + if let Some(v) = self.visibility.as_ref() { + let v = SymbolVisibility::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("visibility", &v)?; + } struct_ser.end() } } @@ -279,6 +287,7 @@ impl<'de> serde::Deserialize<'de> for DescriptorProto { "reservedRange", "reserved_name", "reservedName", + "visibility", ]; #[allow(clippy::enum_variant_names)] @@ -293,6 +302,7 @@ impl<'de> serde::Deserialize<'de> for DescriptorProto { Options, ReservedRange, ReservedName, + Visibility, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -324,6 +334,7 @@ impl<'de> serde::Deserialize<'de> for DescriptorProto { "options" => Ok(GeneratedField::Options), "reservedRange" | "reserved_range" => Ok(GeneratedField::ReservedRange), "reservedName" | "reserved_name" => Ok(GeneratedField::ReservedName), + "visibility" => Ok(GeneratedField::Visibility), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -353,6 +364,7 @@ impl<'de> serde::Deserialize<'de> for DescriptorProto { let mut options__ = None; let mut reserved_range__ = None; let mut reserved_name__ = None; + let mut visibility__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -415,6 +427,12 @@ impl<'de> serde::Deserialize<'de> for DescriptorProto { } reserved_name__ = Some(map_.next_value()?); } + GeneratedField::Visibility => { + if visibility__.is_some() { + return Err(serde::de::Error::duplicate_field("visibility")); + } + visibility__ = map_.next_value::<::std::option::Option>()?.map(|x| x as i32); + } } } Ok(DescriptorProto { @@ -428,6 +446,7 @@ impl<'de> serde::Deserialize<'de> for DescriptorProto { options: options__, reserved_range: reserved_range__.unwrap_or_default(), reserved_name: reserved_name__.unwrap_or_default(), + visibility: visibility__, }) } } @@ -1077,6 +1096,9 @@ impl serde::Serialize for EnumDescriptorProto { if !self.reserved_name.is_empty() { len += 1; } + if self.visibility.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumDescriptorProto", len)?; if let Some(v) = self.name.as_ref() { struct_ser.serialize_field("name", v)?; @@ -1093,6 +1115,11 @@ impl serde::Serialize for EnumDescriptorProto { if !self.reserved_name.is_empty() { struct_ser.serialize_field("reserved_name", &self.reserved_name)?; } + if let Some(v) = self.visibility.as_ref() { + let v = SymbolVisibility::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("visibility", &v)?; + } struct_ser.end() } } @@ -1110,6 +1137,7 @@ impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { "reservedRange", "reserved_name", "reservedName", + "visibility", ]; #[allow(clippy::enum_variant_names)] @@ -1119,6 +1147,7 @@ impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { Options, ReservedRange, ReservedName, + Visibility, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1145,6 +1174,7 @@ impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { "options" => Ok(GeneratedField::Options), "reservedRange" | "reserved_range" => Ok(GeneratedField::ReservedRange), "reservedName" | "reserved_name" => Ok(GeneratedField::ReservedName), + "visibility" => Ok(GeneratedField::Visibility), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1169,6 +1199,7 @@ impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { let mut options__ = None; let mut reserved_range__ = None; let mut reserved_name__ = None; + let mut visibility__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -1201,6 +1232,12 @@ impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { } reserved_name__ = Some(map_.next_value()?); } + GeneratedField::Visibility => { + if visibility__.is_some() { + return Err(serde::de::Error::duplicate_field("visibility")); + } + visibility__ = map_.next_value::<::std::option::Option>()?.map(|x| x as i32); + } } } Ok(EnumDescriptorProto { @@ -1209,6 +1246,7 @@ impl<'de> serde::Deserialize<'de> for EnumDescriptorProto { options: options__, reserved_range: reserved_range__.unwrap_or_default(), reserved_name: reserved_name__.unwrap_or_default(), + visibility: visibility__, }) } } @@ -2182,6 +2220,12 @@ impl serde::Serialize for FeatureSet { if self.json_format.is_some() { len += 1; } + if self.enforce_naming_style.is_some() { + len += 1; + } + if self.default_symbol_visibility.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSet", len)?; if let Some(v) = self.field_presence.as_ref() { let v = feature_set::FieldPresence::try_from(*v) @@ -2213,6 +2257,16 @@ impl serde::Serialize for FeatureSet { .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("json_format", &v)?; } + if let Some(v) = self.enforce_naming_style.as_ref() { + let v = feature_set::EnforceNamingStyle::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("enforce_naming_style", &v)?; + } + if let Some(v) = self.default_symbol_visibility.as_ref() { + let v = feature_set::visibility_feature::DefaultSymbolVisibility::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("default_symbol_visibility", &v)?; + } struct_ser.end() } } @@ -2235,6 +2289,10 @@ impl<'de> serde::Deserialize<'de> for FeatureSet { "messageEncoding", "json_format", "jsonFormat", + "enforce_naming_style", + "enforceNamingStyle", + "default_symbol_visibility", + "defaultSymbolVisibility", ]; #[allow(clippy::enum_variant_names)] @@ -2245,6 +2303,8 @@ impl<'de> serde::Deserialize<'de> for FeatureSet { Utf8Validation, MessageEncoding, JsonFormat, + EnforceNamingStyle, + DefaultSymbolVisibility, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -2272,6 +2332,8 @@ impl<'de> serde::Deserialize<'de> for FeatureSet { "utf8Validation" | "utf8_validation" => Ok(GeneratedField::Utf8Validation), "messageEncoding" | "message_encoding" => Ok(GeneratedField::MessageEncoding), "jsonFormat" | "json_format" => Ok(GeneratedField::JsonFormat), + "enforceNamingStyle" | "enforce_naming_style" => Ok(GeneratedField::EnforceNamingStyle), + "defaultSymbolVisibility" | "default_symbol_visibility" => Ok(GeneratedField::DefaultSymbolVisibility), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2297,6 +2359,8 @@ impl<'de> serde::Deserialize<'de> for FeatureSet { let mut utf8_validation__ = None; let mut message_encoding__ = None; let mut json_format__ = None; + let mut enforce_naming_style__ = None; + let mut default_symbol_visibility__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::FieldPresence => { @@ -2335,6 +2399,18 @@ impl<'de> serde::Deserialize<'de> for FeatureSet { } json_format__ = map_.next_value::<::std::option::Option>()?.map(|x| x as i32); } + GeneratedField::EnforceNamingStyle => { + if enforce_naming_style__.is_some() { + return Err(serde::de::Error::duplicate_field("enforceNamingStyle")); + } + enforce_naming_style__ = map_.next_value::<::std::option::Option>()?.map(|x| x as i32); + } + GeneratedField::DefaultSymbolVisibility => { + if default_symbol_visibility__.is_some() { + return Err(serde::de::Error::duplicate_field("defaultSymbolVisibility")); + } + default_symbol_visibility__ = map_.next_value::<::std::option::Option>()?.map(|x| x as i32); + } } } Ok(FeatureSet { @@ -2344,12 +2420,88 @@ impl<'de> serde::Deserialize<'de> for FeatureSet { utf8_validation: utf8_validation__, message_encoding: message_encoding__, json_format: json_format__, + enforce_naming_style: enforce_naming_style__, + default_symbol_visibility: default_symbol_visibility__, }) } } deserializer.deserialize_struct("google.protobuf.FeatureSet", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for feature_set::EnforceNamingStyle { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "ENFORCE_NAMING_STYLE_UNKNOWN", + Self::Style2024 => "STYLE2024", + Self::StyleLegacy => "STYLE_LEGACY", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::EnforceNamingStyle { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ENFORCE_NAMING_STYLE_UNKNOWN", + "STYLE2024", + "STYLE_LEGACY", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::EnforceNamingStyle; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "ENFORCE_NAMING_STYLE_UNKNOWN" => Ok(feature_set::EnforceNamingStyle::Unknown), + "STYLE2024" => Ok(feature_set::EnforceNamingStyle::Style2024), + "STYLE_LEGACY" => Ok(feature_set::EnforceNamingStyle::StyleLegacy), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for feature_set::EnumType { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -2797,6 +2949,157 @@ impl<'de> serde::Deserialize<'de> for feature_set::Utf8Validation { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for feature_set::VisibilityFeature { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("google.protobuf.FeatureSet.VisibilityFeature", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for feature_set::VisibilityFeature { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::VisibilityFeature; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSet.VisibilityFeature") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(feature_set::VisibilityFeature { + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSet.VisibilityFeature", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::visibility_feature::DefaultSymbolVisibility { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", + Self::ExportAll => "EXPORT_ALL", + Self::ExportTopLevel => "EXPORT_TOP_LEVEL", + Self::LocalAll => "LOCAL_ALL", + Self::Strict => "STRICT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::visibility_feature::DefaultSymbolVisibility { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", + "EXPORT_ALL", + "EXPORT_TOP_LEVEL", + "LOCAL_ALL", + "STRICT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::visibility_feature::DefaultSymbolVisibility; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => Ok(feature_set::visibility_feature::DefaultSymbolVisibility::Unknown), + "EXPORT_ALL" => Ok(feature_set::visibility_feature::DefaultSymbolVisibility::ExportAll), + "EXPORT_TOP_LEVEL" => Ok(feature_set::visibility_feature::DefaultSymbolVisibility::ExportTopLevel), + "LOCAL_ALL" => Ok(feature_set::visibility_feature::DefaultSymbolVisibility::LocalAll), + "STRICT" => Ok(feature_set::visibility_feature::DefaultSymbolVisibility::Strict), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for FeatureSetDefaults { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -4453,6 +4756,9 @@ impl serde::Serialize for FileDescriptorProto { if !self.weak_dependency.is_empty() { len += 1; } + if !self.option_dependency.is_empty() { + len += 1; + } if !self.message_type.is_empty() { len += 1; } @@ -4493,6 +4799,9 @@ impl serde::Serialize for FileDescriptorProto { if !self.weak_dependency.is_empty() { struct_ser.serialize_field("weak_dependency", &self.weak_dependency)?; } + if !self.option_dependency.is_empty() { + struct_ser.serialize_field("option_dependency", &self.option_dependency)?; + } if !self.message_type.is_empty() { struct_ser.serialize_field("message_type", &self.message_type)?; } @@ -4536,6 +4845,8 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { "publicDependency", "weak_dependency", "weakDependency", + "option_dependency", + "optionDependency", "message_type", "messageType", "enum_type", @@ -4556,6 +4867,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { Dependency, PublicDependency, WeakDependency, + OptionDependency, MessageType, EnumType, Service, @@ -4590,6 +4902,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { "dependency" => Ok(GeneratedField::Dependency), "publicDependency" | "public_dependency" => Ok(GeneratedField::PublicDependency), "weakDependency" | "weak_dependency" => Ok(GeneratedField::WeakDependency), + "optionDependency" | "option_dependency" => Ok(GeneratedField::OptionDependency), "messageType" | "message_type" => Ok(GeneratedField::MessageType), "enumType" | "enum_type" => Ok(GeneratedField::EnumType), "service" => Ok(GeneratedField::Service), @@ -4622,6 +4935,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { let mut dependency__ = None; let mut public_dependency__ = None; let mut weak_dependency__ = None; + let mut option_dependency__ = None; let mut message_type__ = None; let mut enum_type__ = None; let mut service__ = None; @@ -4668,6 +4982,12 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { .into_iter().map(|x| x.0).collect()) ; } + GeneratedField::OptionDependency => { + if option_dependency__.is_some() { + return Err(serde::de::Error::duplicate_field("optionDependency")); + } + option_dependency__ = Some(map_.next_value()?); + } GeneratedField::MessageType => { if message_type__.is_some() { return Err(serde::de::Error::duplicate_field("messageType")); @@ -4724,6 +5044,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { dependency: dependency__.unwrap_or_default(), public_dependency: public_dependency__.unwrap_or_default(), weak_dependency: weak_dependency__.unwrap_or_default(), + option_dependency: option_dependency__.unwrap_or_default(), message_type: message_type__.unwrap_or_default(), enum_type: enum_type__.unwrap_or_default(), service: service__.unwrap_or_default(), @@ -7638,6 +7959,80 @@ impl<'de> serde::Deserialize<'de> for Struct { deserializer.deserialize_struct("google.protobuf.Struct", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for SymbolVisibility { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::VisibilityUnset => "VISIBILITY_UNSET", + Self::VisibilityLocal => "VISIBILITY_LOCAL", + Self::VisibilityExport => "VISIBILITY_EXPORT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SymbolVisibility { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "VISIBILITY_UNSET", + "VISIBILITY_LOCAL", + "VISIBILITY_EXPORT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SymbolVisibility; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "VISIBILITY_UNSET" => Ok(SymbolVisibility::VisibilityUnset), + "VISIBILITY_LOCAL" => Ok(SymbolVisibility::VisibilityLocal), + "VISIBILITY_EXPORT" => Ok(SymbolVisibility::VisibilityExport), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for Timestamp { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/mod.rs b/src/generated/mod.rs index 805b220..66d1c87 100644 --- a/src/generated/mod.rs +++ b/src/generated/mod.rs @@ -336,6 +336,13 @@ pub mod envoy { include!("envoy.service.metrics.v3.serde.rs"); } } + pub mod network_ext_proc { + pub mod v3 { + include!("envoy.service.network_ext_proc.v3.rs"); + #[cfg(feature = "pbjson")] + include!("envoy.service.network_ext_proc.v3.serde.rs"); + } + } pub mod rate_limit_quota { pub mod v3 { include!("envoy.service.rate_limit_quota.v3.rs"); @@ -350,6 +357,13 @@ pub mod envoy { include!("envoy.service.ratelimit.v3.serde.rs"); } } + pub mod redis_auth { + pub mod v3 { + include!("envoy.service.redis_auth.v3.rs"); + #[cfg(feature = "pbjson")] + include!("envoy.service.redis_auth.v3.serde.rs"); + } + } pub mod route { pub mod v3 { include!("envoy.service.route.v3.rs"); @@ -385,13 +399,6 @@ pub mod envoy { include!("envoy.service.tap.v3.serde.rs"); } } - pub mod trace { - pub mod v3 { - include!("envoy.service.trace.v3.rs"); - #[cfg(feature = "pbjson")] - include!("envoy.service.trace.v3.serde.rs"); - } - } } } pub mod google { @@ -427,24 +434,6 @@ pub mod io { } } } -pub mod opencensus { - pub mod proto { - pub mod resource { - pub mod v1 { - include!("opencensus.proto.resource.v1.rs"); - #[cfg(feature = "pbjson")] - include!("opencensus.proto.resource.v1.serde.rs"); - } - } - pub mod trace { - pub mod v1 { - include!("opencensus.proto.trace.v1.rs"); - #[cfg(feature = "pbjson")] - include!("opencensus.proto.trace.v1.serde.rs"); - } - } - } -} pub mod udpa { pub mod annotations { include!("udpa.annotations.rs"); diff --git a/src/generated/opencensus.proto.resource.v1.rs b/src/generated/opencensus.proto.resource.v1.rs deleted file mode 100644 index a2a9d66..0000000 --- a/src/generated/opencensus.proto.resource.v1.rs +++ /dev/null @@ -1,24 +0,0 @@ -// This file is @generated by prost-build. -/// Resource information. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Resource { - /// Type identifier for the resource. - #[prost(string, tag = "1")] - pub r#type: ::prost::alloc::string::String, - /// Set of labels that describe the resource. - #[prost(map = "string, string", tag = "2")] - pub labels: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, -} -impl ::prost::Name for Resource { - const NAME: &'static str = "Resource"; - const PACKAGE: &'static str = "opencensus.proto.resource.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.resource.v1.Resource".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.resource.v1.Resource".into() - } -} diff --git a/src/generated/opencensus.proto.resource.v1.serde.rs b/src/generated/opencensus.proto.resource.v1.serde.rs deleted file mode 100644 index 2b9aa08..0000000 --- a/src/generated/opencensus.proto.resource.v1.serde.rs +++ /dev/null @@ -1,110 +0,0 @@ -impl serde::Serialize for Resource { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.r#type.is_empty() { - len += 1; - } - if !self.labels.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.resource.v1.Resource", len)?; - if !self.r#type.is_empty() { - struct_ser.serialize_field("type", &self.r#type)?; - } - if !self.labels.is_empty() { - struct_ser.serialize_field("labels", &self.labels)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Resource { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "type", - "labels", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Type, - Labels, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "type" => Ok(GeneratedField::Type), - "labels" => Ok(GeneratedField::Labels), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Resource; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.resource.v1.Resource") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut r#type__ = None; - let mut labels__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); - } - r#type__ = Some(map_.next_value()?); - } - GeneratedField::Labels => { - if labels__.is_some() { - return Err(serde::de::Error::duplicate_field("labels")); - } - labels__ = Some( - map_.next_value::>()? - ); - } - } - } - Ok(Resource { - r#type: r#type__.unwrap_or_default(), - labels: labels__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.resource.v1.Resource", FIELDS, GeneratedVisitor) - } -} diff --git a/src/generated/opencensus.proto.trace.v1.rs b/src/generated/opencensus.proto.trace.v1.rs deleted file mode 100644 index 0f19d19..0000000 --- a/src/generated/opencensus.proto.trace.v1.rs +++ /dev/null @@ -1,871 +0,0 @@ -// This file is @generated by prost-build. -/// Global configuration of the trace service. All fields must be specified, or -/// the default (zero) values will be used for each type. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct TraceConfig { - /// The global default max number of attributes per span. - #[prost(int64, tag = "4")] - pub max_number_of_attributes: i64, - /// The global default max number of annotation events per span. - #[prost(int64, tag = "5")] - pub max_number_of_annotations: i64, - /// The global default max number of message events per span. - #[prost(int64, tag = "6")] - pub max_number_of_message_events: i64, - /// The global default max number of link entries per span. - #[prost(int64, tag = "7")] - pub max_number_of_links: i64, - /// The global default sampler used to make decisions on span sampling. - #[prost(oneof = "trace_config::Sampler", tags = "1, 2, 3")] - pub sampler: ::core::option::Option, -} -/// Nested message and enum types in `TraceConfig`. -pub mod trace_config { - /// The global default sampler used to make decisions on span sampling. - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] - pub enum Sampler { - #[prost(message, tag = "1")] - ProbabilitySampler(super::ProbabilitySampler), - #[prost(message, tag = "2")] - ConstantSampler(super::ConstantSampler), - #[prost(message, tag = "3")] - RateLimitingSampler(super::RateLimitingSampler), - } -} -impl ::prost::Name for TraceConfig { - const NAME: &'static str = "TraceConfig"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.TraceConfig".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.TraceConfig".into() - } -} -/// Sampler that tries to uniformly sample traces with a given probability. -/// The probability of sampling a trace is equal to that of the specified probability. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ProbabilitySampler { - /// The desired probability of sampling. Must be within \[0.0, 1.0\]. - #[prost(double, tag = "1")] - pub sampling_probability: f64, -} -impl ::prost::Name for ProbabilitySampler { - const NAME: &'static str = "ProbabilitySampler"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.ProbabilitySampler".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.ProbabilitySampler".into() - } -} -/// Sampler that always makes a constant decision on span sampling. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ConstantSampler { - #[prost(enumeration = "constant_sampler::ConstantDecision", tag = "1")] - pub decision: i32, -} -/// Nested message and enum types in `ConstantSampler`. -pub mod constant_sampler { - /// How spans should be sampled: - /// - Always off - /// - Always on - /// - Always follow the parent Span's decision (off if no parent). - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum ConstantDecision { - AlwaysOff = 0, - AlwaysOn = 1, - AlwaysParent = 2, - } - impl ConstantDecision { - /// 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::AlwaysOff => "ALWAYS_OFF", - Self::AlwaysOn => "ALWAYS_ON", - Self::AlwaysParent => "ALWAYS_PARENT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ALWAYS_OFF" => Some(Self::AlwaysOff), - "ALWAYS_ON" => Some(Self::AlwaysOn), - "ALWAYS_PARENT" => Some(Self::AlwaysParent), - _ => None, - } - } - } -} -impl ::prost::Name for ConstantSampler { - const NAME: &'static str = "ConstantSampler"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.ConstantSampler".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.ConstantSampler".into() - } -} -/// Sampler that tries to sample with a rate per time window. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RateLimitingSampler { - /// Rate per second. - #[prost(int64, tag = "1")] - pub qps: i64, -} -impl ::prost::Name for RateLimitingSampler { - const NAME: &'static str = "RateLimitingSampler"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.RateLimitingSampler".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.RateLimitingSampler".into() - } -} -/// A span represents a single operation within a trace. Spans can be -/// nested to form a trace tree. Spans may also be linked to other spans -/// from the same or different trace. And form graphs. Often, a trace -/// contains a root span that describes the end-to-end latency, and one -/// or more subspans for its sub-operations. A trace can also contain -/// multiple root spans, or none at all. Spans do not need to be -/// contiguous - there may be gaps or overlaps between spans in a trace. -/// -/// The next id is 17. -/// TODO(bdrutu): Add an example. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Span { - /// A unique identifier for a trace. All spans from the same trace share - /// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes - /// is considered invalid. - /// - /// This field is semantically required. Receiver should generate new - /// random trace_id if empty or invalid trace_id was received. - /// - /// This field is required. - #[prost(bytes = "vec", tag = "1")] - pub trace_id: ::prost::alloc::vec::Vec, - /// A unique identifier for a span within a trace, assigned when the span - /// is created. The ID is an 8-byte array. An ID with all zeroes is considered - /// invalid. - /// - /// This field is semantically required. Receiver should generate new - /// random span_id if empty or invalid span_id was received. - /// - /// This field is required. - #[prost(bytes = "vec", tag = "2")] - pub span_id: ::prost::alloc::vec::Vec, - /// The Tracestate on the span. - #[prost(message, optional, tag = "15")] - pub tracestate: ::core::option::Option, - /// The `span_id` of this span's parent span. If this is a root span, then this - /// field must be empty. The ID is an 8-byte array. - #[prost(bytes = "vec", tag = "3")] - pub parent_span_id: ::prost::alloc::vec::Vec, - /// A description of the span's operation. - /// - /// For example, the name can be a qualified method name or a file name - /// and a line number where the operation is called. A best practice is to use - /// the same display name at the same call point in an application. - /// This makes it easier to correlate spans in different traces. - /// - /// This field is semantically required to be set to non-empty string. - /// When null or empty string received - receiver may use string "name" - /// as a replacement. There might be smarted algorithms implemented by - /// receiver to fix the empty span name. - /// - /// This field is required. - #[prost(message, optional, tag = "4")] - pub name: ::core::option::Option, - /// Distinguishes between spans generated in a particular context. For example, - /// two spans with the same name may be distinguished using `CLIENT` (caller) - /// and `SERVER` (callee) to identify queueing latency associated with the span. - #[prost(enumeration = "span::SpanKind", tag = "14")] - pub kind: i32, - /// The start time of the span. On the client side, this is the time kept by - /// the local machine where the span execution starts. On the server side, this - /// is the time when the server's application handler starts running. - /// - /// This field is semantically required. When not set on receive - - /// receiver should set it to the value of end_time field if it was - /// set. Or to the current time if neither was set. It is important to - /// keep end_time > start_time for consistency. - /// - /// This field is required. - #[prost(message, optional, tag = "5")] - pub start_time: ::core::option::Option< - super::super::super::super::google::protobuf::Timestamp, - >, - /// The end time of the span. On the client side, this is the time kept by - /// the local machine where the span execution ends. On the server side, this - /// is the time when the server application handler stops running. - /// - /// This field is semantically required. When not set on receive - - /// receiver should set it to start_time value. It is important to - /// keep end_time > start_time for consistency. - /// - /// This field is required. - #[prost(message, optional, tag = "6")] - pub end_time: ::core::option::Option< - super::super::super::super::google::protobuf::Timestamp, - >, - /// A set of attributes on the span. - #[prost(message, optional, tag = "7")] - pub attributes: ::core::option::Option, - /// A stack trace captured at the start of the span. - #[prost(message, optional, tag = "8")] - pub stack_trace: ::core::option::Option, - /// The included time events. - #[prost(message, optional, tag = "9")] - pub time_events: ::core::option::Option, - /// The included links. - #[prost(message, optional, tag = "10")] - pub links: ::core::option::Option, - /// An optional final status for this span. Semantically when Status - /// wasn't set it is means span ended without errors and assume - /// Status.Ok (code = 0). - #[prost(message, optional, tag = "11")] - pub status: ::core::option::Option, - /// An optional resource that is associated with this span. If not set, this span - /// should be part of a batch that does include the resource information, unless resource - /// information is unknown. - #[prost(message, optional, tag = "16")] - pub resource: ::core::option::Option, - /// A highly recommended but not required flag that identifies when a - /// trace crosses a process boundary. True when the parent_span belongs - /// to the same process as the current span. This flag is most commonly - /// used to indicate the need to adjust time as clocks in different - /// processes may not be synchronized. - #[prost(message, optional, tag = "12")] - pub same_process_as_parent_span: ::core::option::Option< - super::super::super::super::google::protobuf::BoolValue, - >, - /// An optional number of child spans that were generated while this span - /// was active. If set, allows an implementation to detect missing child spans. - #[prost(message, optional, tag = "13")] - pub child_span_count: ::core::option::Option< - super::super::super::super::google::protobuf::UInt32Value, - >, -} -/// Nested message and enum types in `Span`. -pub mod span { - /// This field conveys information about request position in multiple distributed tracing graphs. - /// It is a list of Tracestate.Entry with a maximum of 32 members in the list. - /// - /// See the for more details about this field. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Tracestate { - /// A list of entries that represent the Tracestate. - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `Tracestate`. - pub mod tracestate { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Entry { - /// The key must begin with a lowercase letter, and can only contain - /// lowercase letters 'a'-'z', digits '0'-'9', underscores '_', dashes - /// '-', asterisks '*', and forward slashes '/'. - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - /// The value is opaque string up to 256 characters printable ASCII - /// RFC0020 characters (i.e., the range 0x20 to 0x7E) except ',' and '='. - /// Note that this also excludes tabs, newlines, carriage returns, etc. - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - } - impl ::prost::Name for Entry { - const NAME: &'static str = "Entry"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.Tracestate.Entry".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.Tracestate.Entry".into() - } - } - } - impl ::prost::Name for Tracestate { - const NAME: &'static str = "Tracestate"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.Tracestate".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.Tracestate".into() - } - } - /// A set of attributes, each with a key and a value. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Attributes { - /// The set of attributes. The value can be a string, an integer, a double - /// or the Boolean values `true` or `false`. Note, global attributes like - /// server name can be set as tags using resource API. Examples of attributes: - /// - /// "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" - /// "/http/server_latency": 300 - /// "abc.com/myattribute": true - /// "abc.com/score": 10.239 - #[prost(map = "string, message", tag = "1")] - pub attribute_map: ::std::collections::HashMap< - ::prost::alloc::string::String, - super::AttributeValue, - >, - /// The number of attributes that were discarded. Attributes can be discarded - /// because their keys are too long or because there are too many attributes. - /// If this value is 0, then no attributes were dropped. - #[prost(int32, tag = "2")] - pub dropped_attributes_count: i32, - } - impl ::prost::Name for Attributes { - const NAME: &'static str = "Attributes"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.Attributes".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.Attributes".into() - } - } - /// A time-stamped annotation or message event in the Span. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct TimeEvent { - /// The time the event occurred. - #[prost(message, optional, tag = "1")] - pub time: ::core::option::Option< - super::super::super::super::super::google::protobuf::Timestamp, - >, - /// A `TimeEvent` can contain either an `Annotation` object or a - /// `MessageEvent` object, but not both. - #[prost(oneof = "time_event::Value", tags = "2, 3")] - pub value: ::core::option::Option, - } - /// Nested message and enum types in `TimeEvent`. - pub mod time_event { - /// A text annotation with a set of attributes. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Annotation { - /// A user-supplied message describing the event. - #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - /// A set of attributes on the annotation. - #[prost(message, optional, tag = "2")] - pub attributes: ::core::option::Option, - } - impl ::prost::Name for Annotation { - const NAME: &'static str = "Annotation"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.TimeEvent.Annotation".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.TimeEvent.Annotation".into() - } - } - /// An event describing a message sent/received between Spans. - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct MessageEvent { - /// The type of MessageEvent. Indicates whether the message was sent or - /// received. - #[prost(enumeration = "message_event::Type", tag = "1")] - pub r#type: i32, - /// An identifier for the MessageEvent's message that can be used to match - /// SENT and RECEIVED MessageEvents. For example, this field could - /// represent a sequence ID for a streaming RPC. It is recommended to be - /// unique within a Span. - #[prost(uint64, tag = "2")] - pub id: u64, - /// The number of uncompressed bytes sent or received. - #[prost(uint64, tag = "3")] - pub uncompressed_size: u64, - /// The number of compressed bytes sent or received. If zero, assumed to - /// be the same size as uncompressed. - #[prost(uint64, tag = "4")] - pub compressed_size: u64, - } - /// Nested message and enum types in `MessageEvent`. - pub mod message_event { - /// Indicates whether the message was sent or received. - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum Type { - /// Unknown event type. - Unspecified = 0, - /// Indicates a sent message. - Sent = 1, - /// Indicates a received message. - Received = 2, - } - impl Type { - /// 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::Unspecified => "TYPE_UNSPECIFIED", - Self::Sent => "SENT", - Self::Received => "RECEIVED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "SENT" => Some(Self::Sent), - "RECEIVED" => Some(Self::Received), - _ => None, - } - } - } - } - impl ::prost::Name for MessageEvent { - const NAME: &'static str = "MessageEvent"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent".into() - } - } - /// A `TimeEvent` can contain either an `Annotation` object or a - /// `MessageEvent` object, but not both. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - /// A text annotation with a set of attributes. - #[prost(message, tag = "2")] - Annotation(Annotation), - /// An event describing a message sent/received between Spans. - #[prost(message, tag = "3")] - MessageEvent(MessageEvent), - } - } - impl ::prost::Name for TimeEvent { - const NAME: &'static str = "TimeEvent"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.TimeEvent".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.TimeEvent".into() - } - } - /// A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation - /// on the span, consisting of either user-supplied key-value pairs, or - /// details of a message sent/received between Spans. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct TimeEvents { - /// A collection of `TimeEvent`s. - #[prost(message, repeated, tag = "1")] - pub time_event: ::prost::alloc::vec::Vec, - /// The number of dropped annotations in all the included time events. - /// If the value is 0, then no annotations were dropped. - #[prost(int32, tag = "2")] - pub dropped_annotations_count: i32, - /// The number of dropped message events in all the included time events. - /// If the value is 0, then no message events were dropped. - #[prost(int32, tag = "3")] - pub dropped_message_events_count: i32, - } - impl ::prost::Name for TimeEvents { - const NAME: &'static str = "TimeEvents"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.TimeEvents".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.TimeEvents".into() - } - } - /// A pointer from the current span to another span in the same trace or in a - /// different trace. For example, this can be used in batching operations, - /// where a single batch handler processes multiple requests from different - /// traces or when the handler receives a request from a different project. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Link { - /// A unique identifier of a trace that this linked span is part of. The ID is a - /// 16-byte array. - #[prost(bytes = "vec", tag = "1")] - pub trace_id: ::prost::alloc::vec::Vec, - /// A unique identifier for the linked span. The ID is an 8-byte array. - #[prost(bytes = "vec", tag = "2")] - pub span_id: ::prost::alloc::vec::Vec, - /// The relationship of the current span relative to the linked span. - #[prost(enumeration = "link::Type", tag = "3")] - pub r#type: i32, - /// A set of attributes on the link. - #[prost(message, optional, tag = "4")] - pub attributes: ::core::option::Option, - /// The Tracestate associated with the link. - #[prost(message, optional, tag = "5")] - pub tracestate: ::core::option::Option, - } - /// Nested message and enum types in `Link`. - pub mod link { - /// The relationship of the current span relative to the linked span: child, - /// parent, or unspecified. - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum Type { - /// The relationship of the two spans is unknown, or known but other - /// than parent-child. - Unspecified = 0, - /// The linked span is a child of the current span. - ChildLinkedSpan = 1, - /// The linked span is a parent of the current span. - ParentLinkedSpan = 2, - } - impl Type { - /// 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::Unspecified => "TYPE_UNSPECIFIED", - Self::ChildLinkedSpan => "CHILD_LINKED_SPAN", - Self::ParentLinkedSpan => "PARENT_LINKED_SPAN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "CHILD_LINKED_SPAN" => Some(Self::ChildLinkedSpan), - "PARENT_LINKED_SPAN" => Some(Self::ParentLinkedSpan), - _ => None, - } - } - } - } - impl ::prost::Name for Link { - const NAME: &'static str = "Link"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.Link".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.Link".into() - } - } - /// A collection of links, which are references from this span to a span - /// in the same or different trace. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Links { - /// A collection of links. - #[prost(message, repeated, tag = "1")] - pub link: ::prost::alloc::vec::Vec, - /// The number of dropped links after the maximum size was enforced. If - /// this value is 0, then no links were dropped. - #[prost(int32, tag = "2")] - pub dropped_links_count: i32, - } - impl ::prost::Name for Links { - const NAME: &'static str = "Links"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span.Links".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span.Links".into() - } - } - /// Type of span. Can be used to specify additional relationships between spans - /// in addition to a parent/child relationship. - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum SpanKind { - /// Unspecified. - Unspecified = 0, - /// Indicates that the span covers server-side handling of an RPC or other - /// remote network request. - Server = 1, - /// Indicates that the span covers the client-side wrapper around an RPC or - /// other remote request. - Client = 2, - } - impl SpanKind { - /// 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::Unspecified => "SPAN_KIND_UNSPECIFIED", - Self::Server => "SERVER", - Self::Client => "CLIENT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SPAN_KIND_UNSPECIFIED" => Some(Self::Unspecified), - "SERVER" => Some(Self::Server), - "CLIENT" => Some(Self::Client), - _ => None, - } - } - } -} -impl ::prost::Name for Span { - const NAME: &'static str = "Span"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Span".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Span".into() - } -} -/// The `Status` type defines a logical error model that is suitable for different -/// programming environments, including REST APIs and RPC APIs. This proto's fields -/// are a subset of those of -/// [google.rpc.Status](), -/// which is used by [gRPC](). -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Status { - /// The status code. This is optional field. It is safe to assume 0 (OK) - /// when not set. - #[prost(int32, tag = "1")] - pub code: i32, - /// A developer-facing error message, which should be in English. - #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, -} -impl ::prost::Name for Status { - const NAME: &'static str = "Status"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Status".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Status".into() - } -} -/// The value of an Attribute. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AttributeValue { - /// The type of the value. - #[prost(oneof = "attribute_value::Value", tags = "1, 2, 3, 4")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `AttributeValue`. -pub mod attribute_value { - /// The type of the value. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - /// A string up to 256 bytes long. - #[prost(message, tag = "1")] - StringValue(super::TruncatableString), - /// A 64-bit signed integer. - #[prost(int64, tag = "2")] - IntValue(i64), - /// A Boolean value represented by `true` or `false`. - #[prost(bool, tag = "3")] - BoolValue(bool), - /// A double value. - #[prost(double, tag = "4")] - DoubleValue(f64), - } -} -impl ::prost::Name for AttributeValue { - const NAME: &'static str = "AttributeValue"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.AttributeValue".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.AttributeValue".into() - } -} -/// The call stack which originated this span. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StackTrace { - /// Stack frames in this stack trace. - #[prost(message, optional, tag = "1")] - pub stack_frames: ::core::option::Option, - /// The hash ID is used to conserve network bandwidth for duplicate - /// stack traces within a single trace. - /// - /// Often multiple spans will have identical stack traces. - /// The first occurrence of a stack trace should contain both - /// `stack_frames` and a value in `stack_trace_hash_id`. - /// - /// Subsequent spans within the same request can refer - /// to that stack trace by setting only `stack_trace_hash_id`. - /// - /// TODO: describe how to deal with the case where stack_trace_hash_id is - /// zero because it was not set. - #[prost(uint64, tag = "2")] - pub stack_trace_hash_id: u64, -} -/// Nested message and enum types in `StackTrace`. -pub mod stack_trace { - /// A single stack frame in a stack trace. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct StackFrame { - /// The fully-qualified name that uniquely identifies the function or - /// method that is active in this frame. - #[prost(message, optional, tag = "1")] - pub function_name: ::core::option::Option, - /// An un-mangled function name, if `function_name` is - /// [mangled](). The name can - /// be fully qualified. - #[prost(message, optional, tag = "2")] - pub original_function_name: ::core::option::Option, - /// The name of the source file where the function call appears. - #[prost(message, optional, tag = "3")] - pub file_name: ::core::option::Option, - /// The line number in `file_name` where the function call appears. - #[prost(int64, tag = "4")] - pub line_number: i64, - /// The column number where the function call appears, if available. - /// This is important in JavaScript because of its anonymous functions. - #[prost(int64, tag = "5")] - pub column_number: i64, - /// The binary module from where the code was loaded. - #[prost(message, optional, tag = "6")] - pub load_module: ::core::option::Option, - /// The version of the deployed source code. - #[prost(message, optional, tag = "7")] - pub source_version: ::core::option::Option, - } - impl ::prost::Name for StackFrame { - const NAME: &'static str = "StackFrame"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.StackTrace.StackFrame".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.StackTrace.StackFrame".into() - } - } - /// A collection of stack frames, which can be truncated. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct StackFrames { - /// Stack frames in this call stack. - #[prost(message, repeated, tag = "1")] - pub frame: ::prost::alloc::vec::Vec, - /// The number of stack frames that were dropped because there - /// were too many stack frames. - /// If this value is 0, then no stack frames were dropped. - #[prost(int32, tag = "2")] - pub dropped_frames_count: i32, - } - impl ::prost::Name for StackFrames { - const NAME: &'static str = "StackFrames"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.StackTrace.StackFrames".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.StackTrace.StackFrames".into() - } - } -} -impl ::prost::Name for StackTrace { - const NAME: &'static str = "StackTrace"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.StackTrace".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.StackTrace".into() - } -} -/// A description of a binary module. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Module { - /// TODO: document the meaning of this field. - /// For example: main binary, kernel modules, and dynamic libraries - /// such as libc.so, sharedlib.so. - #[prost(message, optional, tag = "1")] - pub module: ::core::option::Option, - /// A unique identifier for the module, usually a hash of its - /// contents. - #[prost(message, optional, tag = "2")] - pub build_id: ::core::option::Option, -} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.Module".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.Module".into() - } -} -/// A string that might be shortened to a specified length. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TruncatableString { - /// The shortened string. For example, if the original string was 500 bytes long and - /// the limit of the string was 128 bytes, then this value contains the first 128 - /// bytes of the 500-byte string. Note that truncation always happens on a - /// character boundary, to ensure that a truncated string is still valid UTF-8. - /// Because it may contain multi-byte characters, the size of the truncated string - /// may be less than the truncation limit. - #[prost(string, tag = "1")] - pub value: ::prost::alloc::string::String, - /// The number of bytes removed from the original string. If this - /// value is 0, then the string was not shortened. - #[prost(int32, tag = "2")] - pub truncated_byte_count: i32, -} -impl ::prost::Name for TruncatableString { - const NAME: &'static str = "TruncatableString"; - const PACKAGE: &'static str = "opencensus.proto.trace.v1"; - fn full_name() -> ::prost::alloc::string::String { - "opencensus.proto.trace.v1.TruncatableString".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/opencensus.proto.trace.v1.TruncatableString".into() - } -} diff --git a/src/generated/opencensus.proto.trace.v1.serde.rs b/src/generated/opencensus.proto.trace.v1.serde.rs deleted file mode 100644 index ef31fb7..0000000 --- a/src/generated/opencensus.proto.trace.v1.serde.rs +++ /dev/null @@ -1,3180 +0,0 @@ -impl serde::Serialize for AttributeValue { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.value.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.AttributeValue", len)?; - if let Some(v) = self.value.as_ref() { - match v { - attribute_value::Value::StringValue(v) => { - struct_ser.serialize_field("string_value", v)?; - } - attribute_value::Value::IntValue(v) => { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("int_value", ToString::to_string(&v).as_str())?; - } - attribute_value::Value::BoolValue(v) => { - struct_ser.serialize_field("bool_value", v)?; - } - attribute_value::Value::DoubleValue(v) => { - struct_ser.serialize_field("double_value", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AttributeValue { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "string_value", - "stringValue", - "int_value", - "intValue", - "bool_value", - "boolValue", - "double_value", - "doubleValue", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StringValue, - IntValue, - BoolValue, - DoubleValue, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "stringValue" | "string_value" => Ok(GeneratedField::StringValue), - "intValue" | "int_value" => Ok(GeneratedField::IntValue), - "boolValue" | "bool_value" => Ok(GeneratedField::BoolValue), - "doubleValue" | "double_value" => Ok(GeneratedField::DoubleValue), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AttributeValue; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.AttributeValue") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::StringValue => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("stringValue")); - } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(attribute_value::Value::StringValue) -; - } - GeneratedField::IntValue => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("intValue")); - } - value__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| attribute_value::Value::IntValue(x.0)); - } - GeneratedField::BoolValue => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("boolValue")); - } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(attribute_value::Value::BoolValue); - } - GeneratedField::DoubleValue => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("doubleValue")); - } - value__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| attribute_value::Value::DoubleValue(x.0)); - } - } - } - Ok(AttributeValue { - value: value__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.AttributeValue", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ConstantSampler { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.decision != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.ConstantSampler", len)?; - if self.decision != 0 { - let v = constant_sampler::ConstantDecision::try_from(self.decision) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.decision)))?; - struct_ser.serialize_field("decision", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConstantSampler { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "decision", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Decision, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "decision" => Ok(GeneratedField::Decision), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConstantSampler; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.ConstantSampler") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut decision__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Decision => { - if decision__.is_some() { - return Err(serde::de::Error::duplicate_field("decision")); - } - decision__ = Some(map_.next_value::()? as i32); - } - } - } - Ok(ConstantSampler { - decision: decision__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.ConstantSampler", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for constant_sampler::ConstantDecision { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::AlwaysOff => "ALWAYS_OFF", - Self::AlwaysOn => "ALWAYS_ON", - Self::AlwaysParent => "ALWAYS_PARENT", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for constant_sampler::ConstantDecision { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "ALWAYS_OFF", - "ALWAYS_ON", - "ALWAYS_PARENT", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = constant_sampler::ConstantDecision; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "ALWAYS_OFF" => Ok(constant_sampler::ConstantDecision::AlwaysOff), - "ALWAYS_ON" => Ok(constant_sampler::ConstantDecision::AlwaysOn), - "ALWAYS_PARENT" => Ok(constant_sampler::ConstantDecision::AlwaysParent), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for Module { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.module.is_some() { - len += 1; - } - if self.build_id.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Module", len)?; - if let Some(v) = self.module.as_ref() { - struct_ser.serialize_field("module", v)?; - } - if let Some(v) = self.build_id.as_ref() { - struct_ser.serialize_field("build_id", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "module", - "build_id", - "buildId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Module, - BuildId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "module" => Ok(GeneratedField::Module), - "buildId" | "build_id" => Ok(GeneratedField::BuildId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Module") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module__ = None; - let mut build_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Module => { - if module__.is_some() { - return Err(serde::de::Error::duplicate_field("module")); - } - module__ = map_.next_value()?; - } - GeneratedField::BuildId => { - if build_id__.is_some() { - return Err(serde::de::Error::duplicate_field("buildId")); - } - build_id__ = map_.next_value()?; - } - } - } - Ok(Module { - module: module__, - build_id: build_id__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Module", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ProbabilitySampler { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sampling_probability != 0. { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.ProbabilitySampler", len)?; - if self.sampling_probability != 0. { - struct_ser.serialize_field("samplingProbability", &self.sampling_probability)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ProbabilitySampler { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "samplingProbability", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SamplingProbability, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "samplingProbability" => Ok(GeneratedField::SamplingProbability), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ProbabilitySampler; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.ProbabilitySampler") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sampling_probability__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SamplingProbability => { - if sampling_probability__.is_some() { - return Err(serde::de::Error::duplicate_field("samplingProbability")); - } - sampling_probability__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(ProbabilitySampler { - sampling_probability: sampling_probability__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.ProbabilitySampler", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for RateLimitingSampler { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.qps != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.RateLimitingSampler", len)?; - if self.qps != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("qps", ToString::to_string(&self.qps).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RateLimitingSampler { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "qps", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Qps, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "qps" => Ok(GeneratedField::Qps), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RateLimitingSampler; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.RateLimitingSampler") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut qps__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Qps => { - if qps__.is_some() { - return Err(serde::de::Error::duplicate_field("qps")); - } - qps__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(RateLimitingSampler { - qps: qps__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.RateLimitingSampler", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Span { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.trace_id.is_empty() { - len += 1; - } - if !self.span_id.is_empty() { - len += 1; - } - if self.tracestate.is_some() { - len += 1; - } - if !self.parent_span_id.is_empty() { - len += 1; - } - if self.name.is_some() { - len += 1; - } - if self.kind != 0 { - len += 1; - } - if self.start_time.is_some() { - len += 1; - } - if self.end_time.is_some() { - len += 1; - } - if self.attributes.is_some() { - len += 1; - } - if self.stack_trace.is_some() { - len += 1; - } - if self.time_events.is_some() { - len += 1; - } - if self.links.is_some() { - len += 1; - } - if self.status.is_some() { - len += 1; - } - if self.resource.is_some() { - len += 1; - } - if self.same_process_as_parent_span.is_some() { - len += 1; - } - if self.child_span_count.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span", len)?; - if !self.trace_id.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("trace_id", pbjson::private::base64::encode(&self.trace_id).as_str())?; - } - if !self.span_id.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("span_id", pbjson::private::base64::encode(&self.span_id).as_str())?; - } - if let Some(v) = self.tracestate.as_ref() { - struct_ser.serialize_field("tracestate", v)?; - } - if !self.parent_span_id.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("parent_span_id", pbjson::private::base64::encode(&self.parent_span_id).as_str())?; - } - if let Some(v) = self.name.as_ref() { - struct_ser.serialize_field("name", v)?; - } - if self.kind != 0 { - let v = span::SpanKind::try_from(self.kind) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; - struct_ser.serialize_field("kind", &v)?; - } - if let Some(v) = self.start_time.as_ref() { - struct_ser.serialize_field("start_time", v)?; - } - if let Some(v) = self.end_time.as_ref() { - struct_ser.serialize_field("end_time", v)?; - } - if let Some(v) = self.attributes.as_ref() { - struct_ser.serialize_field("attributes", v)?; - } - if let Some(v) = self.stack_trace.as_ref() { - struct_ser.serialize_field("stack_trace", v)?; - } - if let Some(v) = self.time_events.as_ref() { - struct_ser.serialize_field("time_events", v)?; - } - if let Some(v) = self.links.as_ref() { - struct_ser.serialize_field("links", v)?; - } - if let Some(v) = self.status.as_ref() { - struct_ser.serialize_field("status", v)?; - } - if let Some(v) = self.resource.as_ref() { - struct_ser.serialize_field("resource", v)?; - } - if let Some(v) = self.same_process_as_parent_span.as_ref() { - struct_ser.serialize_field("same_process_as_parent_span", v)?; - } - if let Some(v) = self.child_span_count.as_ref() { - struct_ser.serialize_field("child_span_count", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Span { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "trace_id", - "traceId", - "span_id", - "spanId", - "tracestate", - "parent_span_id", - "parentSpanId", - "name", - "kind", - "start_time", - "startTime", - "end_time", - "endTime", - "attributes", - "stack_trace", - "stackTrace", - "time_events", - "timeEvents", - "links", - "status", - "resource", - "same_process_as_parent_span", - "sameProcessAsParentSpan", - "child_span_count", - "childSpanCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TraceId, - SpanId, - Tracestate, - ParentSpanId, - Name, - Kind, - StartTime, - EndTime, - Attributes, - StackTrace, - TimeEvents, - Links, - Status, - Resource, - SameProcessAsParentSpan, - ChildSpanCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "traceId" | "trace_id" => Ok(GeneratedField::TraceId), - "spanId" | "span_id" => Ok(GeneratedField::SpanId), - "tracestate" => Ok(GeneratedField::Tracestate), - "parentSpanId" | "parent_span_id" => Ok(GeneratedField::ParentSpanId), - "name" => Ok(GeneratedField::Name), - "kind" => Ok(GeneratedField::Kind), - "startTime" | "start_time" => Ok(GeneratedField::StartTime), - "endTime" | "end_time" => Ok(GeneratedField::EndTime), - "attributes" => Ok(GeneratedField::Attributes), - "stackTrace" | "stack_trace" => Ok(GeneratedField::StackTrace), - "timeEvents" | "time_events" => Ok(GeneratedField::TimeEvents), - "links" => Ok(GeneratedField::Links), - "status" => Ok(GeneratedField::Status), - "resource" => Ok(GeneratedField::Resource), - "sameProcessAsParentSpan" | "same_process_as_parent_span" => Ok(GeneratedField::SameProcessAsParentSpan), - "childSpanCount" | "child_span_count" => Ok(GeneratedField::ChildSpanCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Span; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut trace_id__ = None; - let mut span_id__ = None; - let mut tracestate__ = None; - let mut parent_span_id__ = None; - let mut name__ = None; - let mut kind__ = None; - let mut start_time__ = None; - let mut end_time__ = None; - let mut attributes__ = None; - let mut stack_trace__ = None; - let mut time_events__ = None; - let mut links__ = None; - let mut status__ = None; - let mut resource__ = None; - let mut same_process_as_parent_span__ = None; - let mut child_span_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::TraceId => { - if trace_id__.is_some() { - return Err(serde::de::Error::duplicate_field("traceId")); - } - trace_id__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::SpanId => { - if span_id__.is_some() { - return Err(serde::de::Error::duplicate_field("spanId")); - } - span_id__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Tracestate => { - if tracestate__.is_some() { - return Err(serde::de::Error::duplicate_field("tracestate")); - } - tracestate__ = map_.next_value()?; - } - GeneratedField::ParentSpanId => { - if parent_span_id__.is_some() { - return Err(serde::de::Error::duplicate_field("parentSpanId")); - } - parent_span_id__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = map_.next_value()?; - } - GeneratedField::Kind => { - if kind__.is_some() { - return Err(serde::de::Error::duplicate_field("kind")); - } - kind__ = Some(map_.next_value::()? as i32); - } - GeneratedField::StartTime => { - if start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("startTime")); - } - start_time__ = map_.next_value()?; - } - GeneratedField::EndTime => { - if end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("endTime")); - } - end_time__ = map_.next_value()?; - } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); - } - attributes__ = map_.next_value()?; - } - GeneratedField::StackTrace => { - if stack_trace__.is_some() { - return Err(serde::de::Error::duplicate_field("stackTrace")); - } - stack_trace__ = map_.next_value()?; - } - GeneratedField::TimeEvents => { - if time_events__.is_some() { - return Err(serde::de::Error::duplicate_field("timeEvents")); - } - time_events__ = map_.next_value()?; - } - GeneratedField::Links => { - if links__.is_some() { - return Err(serde::de::Error::duplicate_field("links")); - } - links__ = map_.next_value()?; - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = map_.next_value()?; - } - GeneratedField::Resource => { - if resource__.is_some() { - return Err(serde::de::Error::duplicate_field("resource")); - } - resource__ = map_.next_value()?; - } - GeneratedField::SameProcessAsParentSpan => { - if same_process_as_parent_span__.is_some() { - return Err(serde::de::Error::duplicate_field("sameProcessAsParentSpan")); - } - same_process_as_parent_span__ = map_.next_value()?; - } - GeneratedField::ChildSpanCount => { - if child_span_count__.is_some() { - return Err(serde::de::Error::duplicate_field("childSpanCount")); - } - child_span_count__ = map_.next_value()?; - } - } - } - Ok(Span { - trace_id: trace_id__.unwrap_or_default(), - span_id: span_id__.unwrap_or_default(), - tracestate: tracestate__, - parent_span_id: parent_span_id__.unwrap_or_default(), - name: name__, - kind: kind__.unwrap_or_default(), - start_time: start_time__, - end_time: end_time__, - attributes: attributes__, - stack_trace: stack_trace__, - time_events: time_events__, - links: links__, - status: status__, - resource: resource__, - same_process_as_parent_span: same_process_as_parent_span__, - child_span_count: child_span_count__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::Attributes { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.attribute_map.is_empty() { - len += 1; - } - if self.dropped_attributes_count != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.Attributes", len)?; - if !self.attribute_map.is_empty() { - struct_ser.serialize_field("attribute_map", &self.attribute_map)?; - } - if self.dropped_attributes_count != 0 { - struct_ser.serialize_field("dropped_attributes_count", &self.dropped_attributes_count)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::Attributes { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "attribute_map", - "attributeMap", - "dropped_attributes_count", - "droppedAttributesCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AttributeMap, - DroppedAttributesCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "attributeMap" | "attribute_map" => Ok(GeneratedField::AttributeMap), - "droppedAttributesCount" | "dropped_attributes_count" => Ok(GeneratedField::DroppedAttributesCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::Attributes; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.Attributes") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut attribute_map__ = None; - let mut dropped_attributes_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AttributeMap => { - if attribute_map__.is_some() { - return Err(serde::de::Error::duplicate_field("attributeMap")); - } - attribute_map__ = Some( - map_.next_value::>()? - ); - } - GeneratedField::DroppedAttributesCount => { - if dropped_attributes_count__.is_some() { - return Err(serde::de::Error::duplicate_field("droppedAttributesCount")); - } - dropped_attributes_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(span::Attributes { - attribute_map: attribute_map__.unwrap_or_default(), - dropped_attributes_count: dropped_attributes_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.Attributes", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::Link { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.trace_id.is_empty() { - len += 1; - } - if !self.span_id.is_empty() { - len += 1; - } - if self.r#type != 0 { - len += 1; - } - if self.attributes.is_some() { - len += 1; - } - if self.tracestate.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.Link", len)?; - if !self.trace_id.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("trace_id", pbjson::private::base64::encode(&self.trace_id).as_str())?; - } - if !self.span_id.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("span_id", pbjson::private::base64::encode(&self.span_id).as_str())?; - } - if self.r#type != 0 { - let v = span::link::Type::try_from(self.r#type) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; - struct_ser.serialize_field("type", &v)?; - } - if let Some(v) = self.attributes.as_ref() { - struct_ser.serialize_field("attributes", v)?; - } - if let Some(v) = self.tracestate.as_ref() { - struct_ser.serialize_field("tracestate", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::Link { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "trace_id", - "traceId", - "span_id", - "spanId", - "type", - "attributes", - "tracestate", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TraceId, - SpanId, - Type, - Attributes, - Tracestate, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "traceId" | "trace_id" => Ok(GeneratedField::TraceId), - "spanId" | "span_id" => Ok(GeneratedField::SpanId), - "type" => Ok(GeneratedField::Type), - "attributes" => Ok(GeneratedField::Attributes), - "tracestate" => Ok(GeneratedField::Tracestate), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::Link; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.Link") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut trace_id__ = None; - let mut span_id__ = None; - let mut r#type__ = None; - let mut attributes__ = None; - let mut tracestate__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::TraceId => { - if trace_id__.is_some() { - return Err(serde::de::Error::duplicate_field("traceId")); - } - trace_id__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::SpanId => { - if span_id__.is_some() { - return Err(serde::de::Error::duplicate_field("spanId")); - } - span_id__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); - } - r#type__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); - } - attributes__ = map_.next_value()?; - } - GeneratedField::Tracestate => { - if tracestate__.is_some() { - return Err(serde::de::Error::duplicate_field("tracestate")); - } - tracestate__ = map_.next_value()?; - } - } - } - Ok(span::Link { - trace_id: trace_id__.unwrap_or_default(), - span_id: span_id__.unwrap_or_default(), - r#type: r#type__.unwrap_or_default(), - attributes: attributes__, - tracestate: tracestate__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.Link", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::link::Type { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "TYPE_UNSPECIFIED", - Self::ChildLinkedSpan => "CHILD_LINKED_SPAN", - Self::ParentLinkedSpan => "PARENT_LINKED_SPAN", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for span::link::Type { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "TYPE_UNSPECIFIED", - "CHILD_LINKED_SPAN", - "PARENT_LINKED_SPAN", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::link::Type; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "TYPE_UNSPECIFIED" => Ok(span::link::Type::Unspecified), - "CHILD_LINKED_SPAN" => Ok(span::link::Type::ChildLinkedSpan), - "PARENT_LINKED_SPAN" => Ok(span::link::Type::ParentLinkedSpan), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for span::Links { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.link.is_empty() { - len += 1; - } - if self.dropped_links_count != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.Links", len)?; - if !self.link.is_empty() { - struct_ser.serialize_field("link", &self.link)?; - } - if self.dropped_links_count != 0 { - struct_ser.serialize_field("dropped_links_count", &self.dropped_links_count)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::Links { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "link", - "dropped_links_count", - "droppedLinksCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Link, - DroppedLinksCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "link" => Ok(GeneratedField::Link), - "droppedLinksCount" | "dropped_links_count" => Ok(GeneratedField::DroppedLinksCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::Links; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.Links") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut link__ = None; - let mut dropped_links_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Link => { - if link__.is_some() { - return Err(serde::de::Error::duplicate_field("link")); - } - link__ = Some(map_.next_value()?); - } - GeneratedField::DroppedLinksCount => { - if dropped_links_count__.is_some() { - return Err(serde::de::Error::duplicate_field("droppedLinksCount")); - } - dropped_links_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(span::Links { - link: link__.unwrap_or_default(), - dropped_links_count: dropped_links_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.Links", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::SpanKind { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "SPAN_KIND_UNSPECIFIED", - Self::Server => "SERVER", - Self::Client => "CLIENT", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for span::SpanKind { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "SPAN_KIND_UNSPECIFIED", - "SERVER", - "CLIENT", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::SpanKind; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "SPAN_KIND_UNSPECIFIED" => Ok(span::SpanKind::Unspecified), - "SERVER" => Ok(span::SpanKind::Server), - "CLIENT" => Ok(span::SpanKind::Client), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for span::TimeEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.time.is_some() { - len += 1; - } - if self.value.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.TimeEvent", len)?; - if let Some(v) = self.time.as_ref() { - struct_ser.serialize_field("time", v)?; - } - if let Some(v) = self.value.as_ref() { - match v { - span::time_event::Value::Annotation(v) => { - struct_ser.serialize_field("annotation", v)?; - } - span::time_event::Value::MessageEvent(v) => { - struct_ser.serialize_field("message_event", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::TimeEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "time", - "annotation", - "message_event", - "messageEvent", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Time, - Annotation, - MessageEvent, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "time" => Ok(GeneratedField::Time), - "annotation" => Ok(GeneratedField::Annotation), - "messageEvent" | "message_event" => Ok(GeneratedField::MessageEvent), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::TimeEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.TimeEvent") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut time__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Time => { - if time__.is_some() { - return Err(serde::de::Error::duplicate_field("time")); - } - time__ = map_.next_value()?; - } - GeneratedField::Annotation => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("annotation")); - } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(span::time_event::Value::Annotation) -; - } - GeneratedField::MessageEvent => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("messageEvent")); - } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(span::time_event::Value::MessageEvent) -; - } - } - } - Ok(span::TimeEvent { - time: time__, - value: value__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.TimeEvent", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::time_event::Annotation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.description.is_some() { - len += 1; - } - if self.attributes.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.TimeEvent.Annotation", len)?; - if let Some(v) = self.description.as_ref() { - struct_ser.serialize_field("description", v)?; - } - if let Some(v) = self.attributes.as_ref() { - struct_ser.serialize_field("attributes", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::time_event::Annotation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "description", - "attributes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Description, - Attributes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "description" => Ok(GeneratedField::Description), - "attributes" => Ok(GeneratedField::Attributes), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::time_event::Annotation; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.TimeEvent.Annotation") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut description__ = None; - let mut attributes__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = map_.next_value()?; - } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); - } - attributes__ = map_.next_value()?; - } - } - } - Ok(span::time_event::Annotation { - description: description__, - attributes: attributes__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.TimeEvent.Annotation", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::time_event::MessageEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.r#type != 0 { - len += 1; - } - if self.id != 0 { - len += 1; - } - if self.uncompressed_size != 0 { - len += 1; - } - if self.compressed_size != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent", len)?; - if self.r#type != 0 { - let v = span::time_event::message_event::Type::try_from(self.r#type) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; - struct_ser.serialize_field("type", &v)?; - } - if self.id != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; - } - if self.uncompressed_size != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("uncompressed_size", ToString::to_string(&self.uncompressed_size).as_str())?; - } - if self.compressed_size != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("compressed_size", ToString::to_string(&self.compressed_size).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::time_event::MessageEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "type", - "id", - "uncompressed_size", - "uncompressedSize", - "compressed_size", - "compressedSize", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Type, - Id, - UncompressedSize, - CompressedSize, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "type" => Ok(GeneratedField::Type), - "id" => Ok(GeneratedField::Id), - "uncompressedSize" | "uncompressed_size" => Ok(GeneratedField::UncompressedSize), - "compressedSize" | "compressed_size" => Ok(GeneratedField::CompressedSize), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::time_event::MessageEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut r#type__ = None; - let mut id__ = None; - let mut uncompressed_size__ = None; - let mut compressed_size__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); - } - r#type__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::UncompressedSize => { - if uncompressed_size__.is_some() { - return Err(serde::de::Error::duplicate_field("uncompressedSize")); - } - uncompressed_size__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::CompressedSize => { - if compressed_size__.is_some() { - return Err(serde::de::Error::duplicate_field("compressedSize")); - } - compressed_size__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(span::time_event::MessageEvent { - r#type: r#type__.unwrap_or_default(), - id: id__.unwrap_or_default(), - uncompressed_size: uncompressed_size__.unwrap_or_default(), - compressed_size: compressed_size__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::time_event::message_event::Type { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "TYPE_UNSPECIFIED", - Self::Sent => "SENT", - Self::Received => "RECEIVED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for span::time_event::message_event::Type { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "TYPE_UNSPECIFIED", - "SENT", - "RECEIVED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::time_event::message_event::Type; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "TYPE_UNSPECIFIED" => Ok(span::time_event::message_event::Type::Unspecified), - "SENT" => Ok(span::time_event::message_event::Type::Sent), - "RECEIVED" => Ok(span::time_event::message_event::Type::Received), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for span::TimeEvents { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.time_event.is_empty() { - len += 1; - } - if self.dropped_annotations_count != 0 { - len += 1; - } - if self.dropped_message_events_count != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.TimeEvents", len)?; - if !self.time_event.is_empty() { - struct_ser.serialize_field("time_event", &self.time_event)?; - } - if self.dropped_annotations_count != 0 { - struct_ser.serialize_field("dropped_annotations_count", &self.dropped_annotations_count)?; - } - if self.dropped_message_events_count != 0 { - struct_ser.serialize_field("dropped_message_events_count", &self.dropped_message_events_count)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::TimeEvents { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "time_event", - "timeEvent", - "dropped_annotations_count", - "droppedAnnotationsCount", - "dropped_message_events_count", - "droppedMessageEventsCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TimeEvent, - DroppedAnnotationsCount, - DroppedMessageEventsCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "timeEvent" | "time_event" => Ok(GeneratedField::TimeEvent), - "droppedAnnotationsCount" | "dropped_annotations_count" => Ok(GeneratedField::DroppedAnnotationsCount), - "droppedMessageEventsCount" | "dropped_message_events_count" => Ok(GeneratedField::DroppedMessageEventsCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::TimeEvents; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.TimeEvents") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut time_event__ = None; - let mut dropped_annotations_count__ = None; - let mut dropped_message_events_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::TimeEvent => { - if time_event__.is_some() { - return Err(serde::de::Error::duplicate_field("timeEvent")); - } - time_event__ = Some(map_.next_value()?); - } - GeneratedField::DroppedAnnotationsCount => { - if dropped_annotations_count__.is_some() { - return Err(serde::de::Error::duplicate_field("droppedAnnotationsCount")); - } - dropped_annotations_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::DroppedMessageEventsCount => { - if dropped_message_events_count__.is_some() { - return Err(serde::de::Error::duplicate_field("droppedMessageEventsCount")); - } - dropped_message_events_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(span::TimeEvents { - time_event: time_event__.unwrap_or_default(), - dropped_annotations_count: dropped_annotations_count__.unwrap_or_default(), - dropped_message_events_count: dropped_message_events_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.TimeEvents", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::Tracestate { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.entries.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.Tracestate", len)?; - if !self.entries.is_empty() { - struct_ser.serialize_field("entries", &self.entries)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::Tracestate { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "entries", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Entries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "entries" => Ok(GeneratedField::Entries), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::Tracestate; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.Tracestate") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut entries__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map_.next_value()?); - } - } - } - Ok(span::Tracestate { - entries: entries__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.Tracestate", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for span::tracestate::Entry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if !self.value.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Span.Tracestate.Entry", len)?; - if !self.key.is_empty() { - struct_ser.serialize_field("key", &self.key)?; - } - if !self.value.is_empty() { - struct_ser.serialize_field("value", &self.value)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for span::tracestate::Entry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = span::tracestate::Entry; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Span.Tracestate.Entry") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some(map_.next_value()?); - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = Some(map_.next_value()?); - } - } - } - Ok(span::tracestate::Entry { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Span.Tracestate.Entry", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StackTrace { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.stack_frames.is_some() { - len += 1; - } - if self.stack_trace_hash_id != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.StackTrace", len)?; - if let Some(v) = self.stack_frames.as_ref() { - struct_ser.serialize_field("stack_frames", v)?; - } - if self.stack_trace_hash_id != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("stack_trace_hash_id", ToString::to_string(&self.stack_trace_hash_id).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StackTrace { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "stack_frames", - "stackFrames", - "stack_trace_hash_id", - "stackTraceHashId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StackFrames, - StackTraceHashId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "stackFrames" | "stack_frames" => Ok(GeneratedField::StackFrames), - "stackTraceHashId" | "stack_trace_hash_id" => Ok(GeneratedField::StackTraceHashId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StackTrace; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.StackTrace") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut stack_frames__ = None; - let mut stack_trace_hash_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::StackFrames => { - if stack_frames__.is_some() { - return Err(serde::de::Error::duplicate_field("stackFrames")); - } - stack_frames__ = map_.next_value()?; - } - GeneratedField::StackTraceHashId => { - if stack_trace_hash_id__.is_some() { - return Err(serde::de::Error::duplicate_field("stackTraceHashId")); - } - stack_trace_hash_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(StackTrace { - stack_frames: stack_frames__, - stack_trace_hash_id: stack_trace_hash_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.StackTrace", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for stack_trace::StackFrame { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.function_name.is_some() { - len += 1; - } - if self.original_function_name.is_some() { - len += 1; - } - if self.file_name.is_some() { - len += 1; - } - if self.line_number != 0 { - len += 1; - } - if self.column_number != 0 { - len += 1; - } - if self.load_module.is_some() { - len += 1; - } - if self.source_version.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.StackTrace.StackFrame", len)?; - if let Some(v) = self.function_name.as_ref() { - struct_ser.serialize_field("function_name", v)?; - } - if let Some(v) = self.original_function_name.as_ref() { - struct_ser.serialize_field("original_function_name", v)?; - } - if let Some(v) = self.file_name.as_ref() { - struct_ser.serialize_field("file_name", v)?; - } - if self.line_number != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("line_number", ToString::to_string(&self.line_number).as_str())?; - } - if self.column_number != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("column_number", ToString::to_string(&self.column_number).as_str())?; - } - if let Some(v) = self.load_module.as_ref() { - struct_ser.serialize_field("load_module", v)?; - } - if let Some(v) = self.source_version.as_ref() { - struct_ser.serialize_field("source_version", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for stack_trace::StackFrame { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "function_name", - "functionName", - "original_function_name", - "originalFunctionName", - "file_name", - "fileName", - "line_number", - "lineNumber", - "column_number", - "columnNumber", - "load_module", - "loadModule", - "source_version", - "sourceVersion", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FunctionName, - OriginalFunctionName, - FileName, - LineNumber, - ColumnNumber, - LoadModule, - SourceVersion, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "functionName" | "function_name" => Ok(GeneratedField::FunctionName), - "originalFunctionName" | "original_function_name" => Ok(GeneratedField::OriginalFunctionName), - "fileName" | "file_name" => Ok(GeneratedField::FileName), - "lineNumber" | "line_number" => Ok(GeneratedField::LineNumber), - "columnNumber" | "column_number" => Ok(GeneratedField::ColumnNumber), - "loadModule" | "load_module" => Ok(GeneratedField::LoadModule), - "sourceVersion" | "source_version" => Ok(GeneratedField::SourceVersion), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = stack_trace::StackFrame; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.StackTrace.StackFrame") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut function_name__ = None; - let mut original_function_name__ = None; - let mut file_name__ = None; - let mut line_number__ = None; - let mut column_number__ = None; - let mut load_module__ = None; - let mut source_version__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::FunctionName => { - if function_name__.is_some() { - return Err(serde::de::Error::duplicate_field("functionName")); - } - function_name__ = map_.next_value()?; - } - GeneratedField::OriginalFunctionName => { - if original_function_name__.is_some() { - return Err(serde::de::Error::duplicate_field("originalFunctionName")); - } - original_function_name__ = map_.next_value()?; - } - GeneratedField::FileName => { - if file_name__.is_some() { - return Err(serde::de::Error::duplicate_field("fileName")); - } - file_name__ = map_.next_value()?; - } - GeneratedField::LineNumber => { - if line_number__.is_some() { - return Err(serde::de::Error::duplicate_field("lineNumber")); - } - line_number__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::ColumnNumber => { - if column_number__.is_some() { - return Err(serde::de::Error::duplicate_field("columnNumber")); - } - column_number__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::LoadModule => { - if load_module__.is_some() { - return Err(serde::de::Error::duplicate_field("loadModule")); - } - load_module__ = map_.next_value()?; - } - GeneratedField::SourceVersion => { - if source_version__.is_some() { - return Err(serde::de::Error::duplicate_field("sourceVersion")); - } - source_version__ = map_.next_value()?; - } - } - } - Ok(stack_trace::StackFrame { - function_name: function_name__, - original_function_name: original_function_name__, - file_name: file_name__, - line_number: line_number__.unwrap_or_default(), - column_number: column_number__.unwrap_or_default(), - load_module: load_module__, - source_version: source_version__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.StackTrace.StackFrame", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for stack_trace::StackFrames { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.frame.is_empty() { - len += 1; - } - if self.dropped_frames_count != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.StackTrace.StackFrames", len)?; - if !self.frame.is_empty() { - struct_ser.serialize_field("frame", &self.frame)?; - } - if self.dropped_frames_count != 0 { - struct_ser.serialize_field("dropped_frames_count", &self.dropped_frames_count)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for stack_trace::StackFrames { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "frame", - "dropped_frames_count", - "droppedFramesCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Frame, - DroppedFramesCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "frame" => Ok(GeneratedField::Frame), - "droppedFramesCount" | "dropped_frames_count" => Ok(GeneratedField::DroppedFramesCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = stack_trace::StackFrames; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.StackTrace.StackFrames") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut frame__ = None; - let mut dropped_frames_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Frame => { - if frame__.is_some() { - return Err(serde::de::Error::duplicate_field("frame")); - } - frame__ = Some(map_.next_value()?); - } - GeneratedField::DroppedFramesCount => { - if dropped_frames_count__.is_some() { - return Err(serde::de::Error::duplicate_field("droppedFramesCount")); - } - dropped_frames_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(stack_trace::StackFrames { - frame: frame__.unwrap_or_default(), - dropped_frames_count: dropped_frames_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.StackTrace.StackFrames", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Status { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.code != 0 { - len += 1; - } - if !self.message.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.Status", len)?; - if self.code != 0 { - struct_ser.serialize_field("code", &self.code)?; - } - if !self.message.is_empty() { - struct_ser.serialize_field("message", &self.message)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Status { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "code", - "message", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Code, - Message, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "code" => Ok(GeneratedField::Code), - "message" => Ok(GeneratedField::Message), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Status; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.Status") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut code__ = None; - let mut message__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Code => { - if code__.is_some() { - return Err(serde::de::Error::duplicate_field("code")); - } - code__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Message => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("message")); - } - message__ = Some(map_.next_value()?); - } - } - } - Ok(Status { - code: code__.unwrap_or_default(), - message: message__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.Status", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TraceConfig { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.max_number_of_attributes != 0 { - len += 1; - } - if self.max_number_of_annotations != 0 { - len += 1; - } - if self.max_number_of_message_events != 0 { - len += 1; - } - if self.max_number_of_links != 0 { - len += 1; - } - if self.sampler.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.TraceConfig", len)?; - if self.max_number_of_attributes != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("max_number_of_attributes", ToString::to_string(&self.max_number_of_attributes).as_str())?; - } - if self.max_number_of_annotations != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("max_number_of_annotations", ToString::to_string(&self.max_number_of_annotations).as_str())?; - } - if self.max_number_of_message_events != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("max_number_of_message_events", ToString::to_string(&self.max_number_of_message_events).as_str())?; - } - if self.max_number_of_links != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("max_number_of_links", ToString::to_string(&self.max_number_of_links).as_str())?; - } - if let Some(v) = self.sampler.as_ref() { - match v { - trace_config::Sampler::ProbabilitySampler(v) => { - struct_ser.serialize_field("probability_sampler", v)?; - } - trace_config::Sampler::ConstantSampler(v) => { - struct_ser.serialize_field("constant_sampler", v)?; - } - trace_config::Sampler::RateLimitingSampler(v) => { - struct_ser.serialize_field("rate_limiting_sampler", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TraceConfig { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "max_number_of_attributes", - "maxNumberOfAttributes", - "max_number_of_annotations", - "maxNumberOfAnnotations", - "max_number_of_message_events", - "maxNumberOfMessageEvents", - "max_number_of_links", - "maxNumberOfLinks", - "probability_sampler", - "probabilitySampler", - "constant_sampler", - "constantSampler", - "rate_limiting_sampler", - "rateLimitingSampler", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MaxNumberOfAttributes, - MaxNumberOfAnnotations, - MaxNumberOfMessageEvents, - MaxNumberOfLinks, - ProbabilitySampler, - ConstantSampler, - RateLimitingSampler, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "maxNumberOfAttributes" | "max_number_of_attributes" => Ok(GeneratedField::MaxNumberOfAttributes), - "maxNumberOfAnnotations" | "max_number_of_annotations" => Ok(GeneratedField::MaxNumberOfAnnotations), - "maxNumberOfMessageEvents" | "max_number_of_message_events" => Ok(GeneratedField::MaxNumberOfMessageEvents), - "maxNumberOfLinks" | "max_number_of_links" => Ok(GeneratedField::MaxNumberOfLinks), - "probabilitySampler" | "probability_sampler" => Ok(GeneratedField::ProbabilitySampler), - "constantSampler" | "constant_sampler" => Ok(GeneratedField::ConstantSampler), - "rateLimitingSampler" | "rate_limiting_sampler" => Ok(GeneratedField::RateLimitingSampler), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TraceConfig; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.TraceConfig") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut max_number_of_attributes__ = None; - let mut max_number_of_annotations__ = None; - let mut max_number_of_message_events__ = None; - let mut max_number_of_links__ = None; - let mut sampler__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::MaxNumberOfAttributes => { - if max_number_of_attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("maxNumberOfAttributes")); - } - max_number_of_attributes__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxNumberOfAnnotations => { - if max_number_of_annotations__.is_some() { - return Err(serde::de::Error::duplicate_field("maxNumberOfAnnotations")); - } - max_number_of_annotations__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxNumberOfMessageEvents => { - if max_number_of_message_events__.is_some() { - return Err(serde::de::Error::duplicate_field("maxNumberOfMessageEvents")); - } - max_number_of_message_events__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxNumberOfLinks => { - if max_number_of_links__.is_some() { - return Err(serde::de::Error::duplicate_field("maxNumberOfLinks")); - } - max_number_of_links__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::ProbabilitySampler => { - if sampler__.is_some() { - return Err(serde::de::Error::duplicate_field("probabilitySampler")); - } - sampler__ = map_.next_value::<::std::option::Option<_>>()?.map(trace_config::Sampler::ProbabilitySampler) -; - } - GeneratedField::ConstantSampler => { - if sampler__.is_some() { - return Err(serde::de::Error::duplicate_field("constantSampler")); - } - sampler__ = map_.next_value::<::std::option::Option<_>>()?.map(trace_config::Sampler::ConstantSampler) -; - } - GeneratedField::RateLimitingSampler => { - if sampler__.is_some() { - return Err(serde::de::Error::duplicate_field("rateLimitingSampler")); - } - sampler__ = map_.next_value::<::std::option::Option<_>>()?.map(trace_config::Sampler::RateLimitingSampler) -; - } - } - } - Ok(TraceConfig { - max_number_of_attributes: max_number_of_attributes__.unwrap_or_default(), - max_number_of_annotations: max_number_of_annotations__.unwrap_or_default(), - max_number_of_message_events: max_number_of_message_events__.unwrap_or_default(), - max_number_of_links: max_number_of_links__.unwrap_or_default(), - sampler: sampler__, - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.TraceConfig", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TruncatableString { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.value.is_empty() { - len += 1; - } - if self.truncated_byte_count != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("opencensus.proto.trace.v1.TruncatableString", len)?; - if !self.value.is_empty() { - struct_ser.serialize_field("value", &self.value)?; - } - if self.truncated_byte_count != 0 { - struct_ser.serialize_field("truncated_byte_count", &self.truncated_byte_count)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TruncatableString { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "value", - "truncated_byte_count", - "truncatedByteCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Value, - TruncatedByteCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "value" => Ok(GeneratedField::Value), - "truncatedByteCount" | "truncated_byte_count" => Ok(GeneratedField::TruncatedByteCount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TruncatableString; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct opencensus.proto.trace.v1.TruncatableString") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut value__ = None; - let mut truncated_byte_count__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = Some(map_.next_value()?); - } - GeneratedField::TruncatedByteCount => { - if truncated_byte_count__.is_some() { - return Err(serde::de::Error::duplicate_field("truncatedByteCount")); - } - truncated_byte_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(TruncatableString { - value: value__.unwrap_or_default(), - truncated_byte_count: truncated_byte_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("opencensus.proto.trace.v1.TruncatableString", FIELDS, GeneratedVisitor) - } -} diff --git a/src/generated/xds.core.v3.rs b/src/generated/xds.core.v3.rs index 06a40d4..8643b06 100644 --- a/src/generated/xds.core.v3.rs +++ b/src/generated/xds.core.v3.rs @@ -1,4 +1,27 @@ // This file is @generated by prost-build. +/// CidrRange specifies an IP Address and a prefix length to construct +/// the subnet mask for a `CIDR <`_> range. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CidrRange { + /// IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``. + #[prost(string, tag = "1")] + pub address_prefix: ::prost::alloc::string::String, + /// Length of prefix, e.g. 0, 32. Defaults to 0 when unset. + #[prost(message, optional, tag = "2")] + pub prefix_len: ::core::option::Option< + super::super::super::google::protobuf::UInt32Value, + >, +} +impl ::prost::Name for CidrRange { + const NAME: &'static str = "CidrRange"; + const PACKAGE: &'static str = "xds.core.v3"; + fn full_name() -> ::prost::alloc::string::String { + "xds.core.v3.CidrRange".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/xds.core.v3.CidrRange".into() + } +} /// Message type for extension configuration. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TypedExtensionConfig { diff --git a/src/generated/xds.core.v3.serde.rs b/src/generated/xds.core.v3.serde.rs index 9dcb484..5ed7114 100644 --- a/src/generated/xds.core.v3.serde.rs +++ b/src/generated/xds.core.v3.serde.rs @@ -89,6 +89,116 @@ impl<'de> serde::Deserialize<'de> for Authority { deserializer.deserialize_struct("xds.core.v3.Authority", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for CidrRange { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address_prefix.is_empty() { + len += 1; + } + if self.prefix_len.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xds.core.v3.CidrRange", len)?; + if !self.address_prefix.is_empty() { + struct_ser.serialize_field("address_prefix", &self.address_prefix)?; + } + if let Some(v) = self.prefix_len.as_ref() { + struct_ser.serialize_field("prefix_len", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CidrRange { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address_prefix", + "addressPrefix", + "prefix_len", + "prefixLen", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressPrefix, + PrefixLen, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "addressPrefix" | "address_prefix" => Ok(GeneratedField::AddressPrefix), + "prefixLen" | "prefix_len" => Ok(GeneratedField::PrefixLen), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CidrRange; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xds.core.v3.CidrRange") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address_prefix__ = None; + let mut prefix_len__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AddressPrefix => { + if address_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("addressPrefix")); + } + address_prefix__ = Some(map_.next_value()?); + } + GeneratedField::PrefixLen => { + if prefix_len__.is_some() { + return Err(serde::de::Error::duplicate_field("prefixLen")); + } + prefix_len__ = map_.next_value()?; + } + } + } + Ok(CidrRange { + address_prefix: address_prefix__.unwrap_or_default(), + prefix_len: prefix_len__, + }) + } + } + deserializer.deserialize_struct("xds.core.v3.CidrRange", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for CollectionEntry { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/src/generated/xds.r#type.matcher.v3.rs b/src/generated/xds.r#type.matcher.v3.rs index e614b0f..6ece753 100644 --- a/src/generated/xds.r#type.matcher.v3.rs +++ b/src/generated/xds.r#type.matcher.v3.rs @@ -162,6 +162,14 @@ pub mod matcher { /// What to do if a match is successful. #[derive(Clone, PartialEq, ::prost::Message)] pub struct OnMatch { + /// If true and the Matcher matches, the action will be taken but the caller + /// will behave as if the Matcher did not match. A subsequent matcher or + /// on_no_match action will be used instead. + /// This field is not supported in all contexts in which the matcher API is + /// used. If this field is set in a context in which it's not supported, + /// the resource will be rejected. + #[prost(bool, tag = "3")] + pub keep_matching: bool, #[prost(oneof = "on_match::OnMatch", tags = "1, 2")] pub on_match: ::core::option::Option, } diff --git a/src/generated/xds.r#type.matcher.v3.serde.rs b/src/generated/xds.r#type.matcher.v3.serde.rs index e150e71..84a0fff 100644 --- a/src/generated/xds.r#type.matcher.v3.serde.rs +++ b/src/generated/xds.r#type.matcher.v3.serde.rs @@ -1019,10 +1019,16 @@ impl serde::Serialize for matcher::OnMatch { { use serde::ser::SerializeStruct; let mut len = 0; + if self.keep_matching { + len += 1; + } if self.on_match.is_some() { len += 1; } let mut struct_ser = serializer.serialize_struct("xds.r#type.matcher.v3.Matcher.OnMatch", len)?; + if self.keep_matching { + struct_ser.serialize_field("keep_matching", &self.keep_matching)?; + } if let Some(v) = self.on_match.as_ref() { match v { matcher::on_match::OnMatch::Matcher(v) => { @@ -1043,12 +1049,15 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "keep_matching", + "keepMatching", "matcher", "action", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + KeepMatching, Matcher, Action, } @@ -1072,6 +1081,7 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { E: serde::de::Error, { match value { + "keepMatching" | "keep_matching" => Ok(GeneratedField::KeepMatching), "matcher" => Ok(GeneratedField::Matcher), "action" => Ok(GeneratedField::Action), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -1093,9 +1103,16 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { where V: serde::de::MapAccess<'de>, { + let mut keep_matching__ = None; let mut on_match__ = None; while let Some(k) = map_.next_key()? { match k { + GeneratedField::KeepMatching => { + if keep_matching__.is_some() { + return Err(serde::de::Error::duplicate_field("keepMatching")); + } + keep_matching__ = Some(map_.next_value()?); + } GeneratedField::Matcher => { if on_match__.is_some() { return Err(serde::de::Error::duplicate_field("matcher")); @@ -1113,6 +1130,7 @@ impl<'de> serde::Deserialize<'de> for matcher::OnMatch { } } Ok(matcher::OnMatch { + keep_matching: keep_matching__.unwrap_or_default(), on_match: on_match__, }) } diff --git a/src/lib.rs b/src/lib.rs index f264ab2..8a33606 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,17 +1,24 @@ #![allow(clippy::doc_lazy_continuation)] #![doc = include_str!("../README.md")] +#[cfg(not(feature = "generate_only"))] mod any; +#[cfg(not(feature = "generate_only"))] #[allow(clippy::all, clippy::pedantic, clippy::nursery)] mod generated; +#[cfg(feature = "generate_only")] +mod generated {} + pub mod pb { pub use crate::generated::*; } +#[cfg(not(feature = "generate_only"))] pub use any::WellKnownTypes; +#[cfg(not(feature = "generate_only"))] mod value; /// A serialized file descriptor set containing the entirety of the XDS API. diff --git a/src/xds-descriptors.bin b/src/xds-descriptors.bin index 90d8151..c26f158 100644 Binary files a/src/xds-descriptors.bin and b/src/xds-descriptors.bin differ diff --git a/tests/generate_sources.rs b/tests/generate_sources.rs index 60b7981..23ea267 100644 --- a/tests/generate_sources.rs +++ b/tests/generate_sources.rs @@ -334,7 +334,8 @@ fn write_line(w: &mut W, depth: usize, line: &str) -> io::Result<( } fn check_protoc_version(sh: &Shell) -> anyhow::Result { - let output = cmd!(sh, "protoc --version").read()?; + let protoc_path = env::var("PROTOC").unwrap_or_else(|_| "protoc".to_string()); + let output = cmd!(sh, "{protoc_path} --version").read()?; let Some(version) = output.split_ascii_whitespace().last() else { anyhow::bail!("oops: couldn't parse protoc version"); }; diff --git a/tests/test_any.rs b/tests/test_any.rs index 827516f..8ac8fe8 100644 --- a/tests/test_any.rs +++ b/tests/test_any.rs @@ -1,4 +1,4 @@ -#[cfg(test)] +#[cfg(all(test, not(feature = "generate_only")))] mod any { use xds_api::pb::{ envoy::{ diff --git a/tests/test_pbjson.rs b/tests/test_pbjson.rs index d6d9b06..cc46f8e 100644 --- a/tests/test_pbjson.rs +++ b/tests/test_pbjson.rs @@ -1,4 +1,4 @@ -#[cfg(all(test, feature = "pbjson"))] +#[cfg(all(test, feature = "pbjson", not(feature = "generate_only")))] mod pbjson { use serde_json::json; diff --git a/tests/test_value.rs b/tests/test_value.rs index 56735f0..06b6f2e 100644 --- a/tests/test_value.rs +++ b/tests/test_value.rs @@ -1,4 +1,4 @@ -#[cfg(test)] +#[cfg(all(test, not(feature = "generate_only")))] mod value { use std::u64;