From ee97406d0f3a59e1f3e003f8fb87e0be01c50b13 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Mon, 15 Aug 2022 09:01:48 -0400 Subject: [PATCH] Avoid getting to gen src thru modules --- limitador-server/build.rs | 19 +- limitador-server/src/envoy_rls/envoy_types.rs | 36 +- .../envoy_rls/protobufs/envoy.annotations.rs | 1 - .../protobufs/envoy.config.core.v3.rs | 727 -------------- .../envoy.extensions.common.ratelimit.v3.rs | 92 -- .../envoy_rls/protobufs/envoy.r#type.v3.rs | 94 -- .../protobufs/envoy.service.ratelimit.v3.rs | 396 -------- .../envoy_rls/protobufs/google.protobuf.rs | 1 - .../envoy_rls/protobufs/udpa.annotations.rs | 54 -- .../src/envoy_rls/protobufs/validate.rs | 899 ------------------ .../envoy_rls/protobufs/xds.annotations.v3.rs | 40 - .../src/envoy_rls/protobufs/xds.core.v3.rs | 12 - 12 files changed, 23 insertions(+), 2348 deletions(-) delete mode 100644 limitador-server/src/envoy_rls/protobufs/envoy.annotations.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/envoy.config.core.v3.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/envoy.extensions.common.ratelimit.v3.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/envoy.r#type.v3.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/envoy.service.ratelimit.v3.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/google.protobuf.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/udpa.annotations.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/validate.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/xds.annotations.v3.rs delete mode 100644 limitador-server/src/envoy_rls/protobufs/xds.core.v3.rs diff --git a/limitador-server/build.rs b/limitador-server/build.rs index 26c0f31c..d8b854e9 100644 --- a/limitador-server/build.rs +++ b/limitador-server/build.rs @@ -1,14 +1,11 @@ fn main() -> Result<(), Box> { - tonic_build::configure() - .build_server(true) - .out_dir("src/envoy_rls/protobufs") - .compile( - &["envoy/service/ratelimit/v3/rls.proto"], - &[ - "vendor/protobufs/data-plane-api", - "vendor/protobufs/protoc-gen-validate", - "vendor/protobufs/xds", - ], - )?; + tonic_build::configure().build_server(true).compile( + &["envoy/service/ratelimit/v3/rls.proto"], + &[ + "vendor/protobufs/data-plane-api", + "vendor/protobufs/protoc-gen-validate", + "vendor/protobufs/xds", + ], + )?; Ok(()) } diff --git a/limitador-server/src/envoy_rls/envoy_types.rs b/limitador-server/src/envoy_rls/envoy_types.rs index 9d8ca559..20e41500 100644 --- a/limitador-server/src/envoy_rls/envoy_types.rs +++ b/limitador-server/src/envoy_rls/envoy_types.rs @@ -1,54 +1,48 @@ -#[path = "protobufs"] pub mod envoy { - #[path = "."] pub mod config { - #[path = "."] pub mod core { - #[path = "envoy.config.core.v3.rs"] // clippy will barf on protobuff generated code for enum variants in // v3::socket_option::SocketState, so allow this lint #[allow(clippy::enum_variant_names, clippy::derive_partial_eq_without_eq)] - pub mod v3; + pub mod v3 { + tonic::include_proto!("envoy.config.core.v3"); + } } } - #[path = "."] pub mod extensions { - #[path = "."] pub mod common { - #[path = "."] pub mod ratelimit { - #[path = "envoy.extensions.common.ratelimit.v3.rs"] #[allow(clippy::derive_partial_eq_without_eq)] - pub mod v3; + pub mod v3 { + tonic::include_proto!("envoy.extensions.common.ratelimit.v3"); + } } } } - #[path = "."] pub mod r#type { - #[path = "envoy.r#type.v3.rs"] #[allow(clippy::derive_partial_eq_without_eq)] - pub mod v3; + pub mod v3 { + tonic::include_proto!("envoy.r#type.v3"); + } } - #[path = "."] pub mod service { - #[path = "."] pub mod ratelimit { - #[path = "envoy.service.ratelimit.v3.rs"] #[allow(clippy::derive_partial_eq_without_eq)] - pub mod v3; + pub mod v3 { + tonic::include_proto!("envoy.service.ratelimit.v3"); + } } } } -#[path = "protobufs"] pub mod xds { - #[path = "."] pub mod core { - #[path = "xds.core.v3.rs"] #[allow(clippy::derive_partial_eq_without_eq)] - pub mod v3; + pub mod v3 { + tonic::include_proto!("xds.core.v3"); + } } } diff --git a/limitador-server/src/envoy_rls/protobufs/envoy.annotations.rs b/limitador-server/src/envoy_rls/protobufs/envoy.annotations.rs deleted file mode 100644 index 8b137891..00000000 --- a/limitador-server/src/envoy_rls/protobufs/envoy.annotations.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/limitador-server/src/envoy_rls/protobufs/envoy.config.core.v3.rs b/limitador-server/src/envoy_rls/protobufs/envoy.config.core.v3.rs deleted file mode 100644 index 97145ab3..00000000 --- a/limitador-server/src/envoy_rls/protobufs/envoy.config.core.v3.rs +++ /dev/null @@ -1,727 +0,0 @@ -// [#protodoc-title: Socket Option ] - -/// Generic socket option message. This would be used to set socket options that -/// might not exist in upstream kernels or precompiled Envoy binaries. -/// [#next-free-field: 7] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SocketOption { - /// An optional name to give this socket option for debugging, etc. - /// Uniqueness is not required and no special meaning is assumed. - #[prost(string, tag = "1")] - pub description: ::prost::alloc::string::String, - /// Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP - #[prost(int64, tag = "2")] - pub level: i64, - /// The numeric name as passed to setsockopt - #[prost(int64, tag = "3")] - pub name: i64, - /// The state in which the option will be applied. When used in BindConfig - /// STATE_PREBIND is currently the only valid value. - #[prost(enumeration = "socket_option::SocketState", tag = "6")] - pub state: i32, - #[prost(oneof = "socket_option::Value", tags = "4, 5")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `SocketOption`. -pub mod socket_option { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum SocketState { - /// Socket options are applied after socket creation but before binding the socket to a port - StatePrebind = 0, - /// Socket options are applied after binding the socket to a port but before calling listen() - StateBound = 1, - /// Socket options are applied after calling listen() - StateListening = 2, - } - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - /// Because many sockopts take an int value. - #[prost(int64, tag = "4")] - IntValue(i64), - /// Otherwise it's a byte buffer. - #[prost(bytes, tag = "5")] - BufValue(::prost::alloc::vec::Vec), - } -} -// [#protodoc-title: Network addresses] - -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pipe { - /// Unix Domain Socket path. On Linux, paths starting with '@' will use the - /// abstract namespace. The starting '@' is replaced by a null byte by Envoy. - /// Paths starting with '@' will result in an error in environments other than - /// Linux. - #[prost(string, tag = "1")] - pub path: ::prost::alloc::string::String, - /// The mode for the Pipe. Not applicable for abstract sockets. - #[prost(uint32, tag = "2")] - pub mode: u32, -} -/// \[#not-implemented-hide:\] The address represents an envoy internal listener. -/// TODO(lambdai): Make this address available for listener and endpoint. -/// TODO(asraa): When address available, remove workaround from test/server/server_fuzz_test.cc:30. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EnvoyInternalAddress { - #[prost(oneof = "envoy_internal_address::AddressNameSpecifier", tags = "1")] - pub address_name_specifier: - ::core::option::Option, -} -/// Nested message and enum types in `EnvoyInternalAddress`. -pub mod envoy_internal_address { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum AddressNameSpecifier { - /// \[#not-implemented-hide:\] The :ref:`listener name ` of the destination internal listener. - #[prost(string, tag = "1")] - ServerListenerName(::prost::alloc::string::String), - } -} -/// [#next-free-field: 7] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SocketAddress { - #[prost(enumeration = "socket_address::Protocol", tag = "1")] - pub protocol: i32, - /// The address for this socket. :ref:`Listeners ` will bind - /// to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` - /// to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: - /// It is possible to distinguish a Listener address via the prefix/suffix matching - /// in :ref:`FilterChainMatch `.] When used - /// within an upstream :ref:`BindConfig `, the address - /// controls the source address of outbound connections. For :ref:`clusters - /// `, the cluster type determines whether the - /// address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS - /// (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized - /// via :ref:`resolver_name `. - #[prost(string, tag = "2")] - pub address: ::prost::alloc::string::String, - /// The name of the custom resolver. This must have been registered with Envoy. If - /// this is empty, a context dependent default applies. If the address is a concrete - /// IP address, no resolution will occur. If address is a hostname this - /// should be set for resolution other than DNS. Specifying a custom resolver with - /// *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime. - #[prost(string, tag = "5")] - pub resolver_name: ::prost::alloc::string::String, - /// When binding to an IPv6 address above, this enables `IPv4 compatibility - /// <`_.> Binding to ``::`` will - /// allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into - /// IPv6 space as ``::FFFF:``. - #[prost(bool, tag = "6")] - pub ipv4_compat: bool, - #[prost(oneof = "socket_address::PortSpecifier", tags = "3, 4")] - pub port_specifier: ::core::option::Option, -} -/// Nested message and enum types in `SocketAddress`. -pub mod socket_address { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum Protocol { - Tcp = 0, - Udp = 1, - } - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum PortSpecifier { - #[prost(uint32, tag = "3")] - PortValue(u32), - /// This is only valid if :ref:`resolver_name - /// ` is specified below and the - /// named resolver is capable of named port resolution. - #[prost(string, tag = "4")] - NamedPort(::prost::alloc::string::String), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TcpKeepalive { - /// Maximum number of keepalive probes to send without response before deciding - /// the connection is dead. Default is to use the OS level configuration (unless - /// overridden, Linux defaults to 9.) - #[prost(message, optional, tag = "1")] - pub keepalive_probes: ::core::option::Option, - /// The number of seconds a connection needs to be idle before keep-alive probes - /// start being sent. Default is to use the OS level configuration (unless - /// overridden, Linux defaults to 7200s (i.e., 2 hours.) - #[prost(message, optional, tag = "2")] - pub keepalive_time: ::core::option::Option, - /// The number of seconds between keep-alive probes. Default is to use the OS - /// level configuration (unless overridden, Linux defaults to 75s.) - #[prost(message, optional, tag = "3")] - pub keepalive_interval: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BindConfig { - /// The address to bind to when creating a socket. - #[prost(message, optional, tag = "1")] - pub source_address: ::core::option::Option, - /// Whether to set the *IP_FREEBIND* option when creating the socket. When this - /// flag is set to true, allows the :ref:`source_address - /// ` to be an IP address - /// that is not configured on the system running Envoy. When this flag is set - /// to false, the option *IP_FREEBIND* is disabled on the socket. When this - /// flag is not set (default), the socket is not modified, i.e. the option is - /// neither enabled nor disabled. - #[prost(message, optional, tag = "2")] - pub freebind: ::core::option::Option, - /// Additional socket options that may not be present in Envoy source code or - /// precompiled binaries. - #[prost(message, repeated, tag = "3")] - pub socket_options: ::prost::alloc::vec::Vec, -} -/// Addresses specify either a logical or physical address and port, which are -/// used to tell Envoy where to bind/listen, connect to upstream and find -/// management servers. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Address { - #[prost(oneof = "address::Address", tags = "1, 2, 3")] - pub address: ::core::option::Option, -} -/// Nested message and enum types in `Address`. -pub mod address { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Address { - #[prost(message, tag = "1")] - SocketAddress(super::SocketAddress), - #[prost(message, tag = "2")] - Pipe(super::Pipe), - /// \[#not-implemented-hide:\] - #[prost(message, tag = "3")] - EnvoyInternalAddress(super::EnvoyInternalAddress), - } -} -/// 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, -} -// [#protodoc-title: Backoff Strategy] - -/// Configuration defining a jittered exponential back off strategy. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BackoffStrategy { - /// The base interval to be used for the next back off computation. It should - /// be greater than zero and less than or equal to :ref:`max_interval - /// `. - #[prost(message, optional, tag = "1")] - pub base_interval: ::core::option::Option<::prost_types::Duration>, - /// Specifies the maximum interval between retries. This parameter is optional, - /// but must be greater than or equal to the :ref:`base_interval - /// ` if set. The default - /// is 10 times the :ref:`base_interval - /// `. - #[prost(message, optional, tag = "2")] - pub max_interval: ::core::option::Option<::prost_types::Duration>, -} -// [#protodoc-title: HTTP Service URI ] - -/// Envoy external URI descriptor -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HttpUri { - /// The HTTP server URI. It should be a full FQDN with protocol, host and path. - /// - /// Example: - /// - /// .. code-block:: yaml - /// - /// uri: - /// - #[prost(string, tag = "1")] - pub uri: ::prost::alloc::string::String, - /// Sets the maximum duration in milliseconds that a response can take to arrive upon request. - #[prost(message, optional, tag = "3")] - pub timeout: ::core::option::Option<::prost_types::Duration>, - /// Specify how `uri` is to be fetched. Today, this requires an explicit - /// cluster, but in the future we may support dynamic cluster creation or - /// inline DNS resolution. See `issue - /// <`_.> - #[prost(oneof = "http_uri::HttpUpstreamType", tags = "2")] - pub http_upstream_type: ::core::option::Option, -} -/// Nested message and enum types in `HttpUri`. -pub mod http_uri { - /// Specify how `uri` is to be fetched. Today, this requires an explicit - /// cluster, but in the future we may support dynamic cluster creation or - /// inline DNS resolution. See `issue - /// <`_.> - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum HttpUpstreamType { - /// A cluster is created in the Envoy "cluster_manager" config - /// section. This field specifies the cluster name. - /// - /// Example: - /// - /// .. code-block:: yaml - /// - /// cluster: jwks_cluster - /// - #[prost(string, tag = "2")] - Cluster(::prost::alloc::string::String), - } -} -/// Identifies location of where either Envoy runs or where upstream hosts run. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Locality { - /// Region this :ref:`zone ` belongs to. - #[prost(string, tag = "1")] - pub region: ::prost::alloc::string::String, - /// Defines the local service zone where Envoy is running. Though optional, it - /// should be set if discovery service routing is used and the discovery - /// service exposes :ref:`zone data `, - /// either in this message or via :option:`--service-zone`. The meaning of zone - /// is context dependent, e.g. `Availability Zone (AZ) - /// <`_> - /// on AWS, `Zone <`_> on - /// GCP, etc. - #[prost(string, tag = "2")] - pub zone: ::prost::alloc::string::String, - /// When used for locality of upstream hosts, this field further splits zone - /// into smaller chunks of sub-zones so they can be load balanced - /// independently. - #[prost(string, tag = "3")] - pub sub_zone: ::prost::alloc::string::String, -} -/// BuildVersion combines SemVer version of extension with free-form build information -/// (i.e. 'alpha', 'private-build') as a set of strings. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BuildVersion { - /// SemVer version of extension. - #[prost(message, optional, tag = "1")] - pub version: ::core::option::Option, - /// Free-form build information. - /// Envoy defines several well known keys in the source/common/version/version.h file - #[prost(message, optional, tag = "2")] - pub metadata: ::core::option::Option<::prost_types::Struct>, -} -/// Version and identification for an Envoy extension. -/// [#next-free-field: 6] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Extension { - /// This is the name of the Envoy filter as specified in the Envoy - /// configuration, e.g. envoy.filters.http.router, com.acme.widget. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Category of the extension. - /// Extension category names use reverse DNS notation. For instance "envoy.filters.listener" - /// for Envoy's built-in listener filters or "com.acme.filters.http" for HTTP filters from - /// acme.com vendor. - /// [#comment:TODO(yanavlasov): Link to the doc with existing envoy category names.] - #[prost(string, tag = "2")] - pub category: ::prost::alloc::string::String, - /// \[#not-implemented-hide:\] Type descriptor of extension configuration proto. - /// [#comment:TODO(yanavlasov): Link to the doc with existing configuration protos.] - /// [#comment:TODO(yanavlasov): Add tests when PR #9391 lands.] - #[prost(string, tag = "3")] - pub type_descriptor: ::prost::alloc::string::String, - /// The version is a property of the extension and maintained independently - /// of other extensions and the Envoy API. - /// This field is not set when extension did not provide version information. - #[prost(message, optional, tag = "4")] - pub version: ::core::option::Option, - /// Indicates that the extension is present but was disabled via dynamic configuration. - #[prost(bool, tag = "5")] - pub disabled: bool, -} -/// Identifies a specific Envoy instance. The node identifier is presented to the -/// management server, which may use this identifier to distinguish per Envoy -/// configuration for serving. -/// [#next-free-field: 13] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Node { - /// An opaque node identifier for the Envoy node. This also provides the local - /// service node name. It should be set if any of the following features are - /// used: :ref:`statsd `, :ref:`CDS - /// `, and :ref:`HTTP tracing - /// `, either in this message or via - /// :option:`--service-node`. - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// Defines the local service cluster name where Envoy is running. Though - /// optional, it should be set if any of the following features are used: - /// :ref:`statsd `, :ref:`health check cluster - /// verification - /// `, - /// :ref:`runtime override directory `, - /// :ref:`user agent addition - /// `, - /// :ref:`HTTP global rate limiting `, - /// :ref:`CDS `, and :ref:`HTTP tracing - /// `, either in this message or via - /// :option:`--service-cluster`. - #[prost(string, tag = "2")] - pub cluster: ::prost::alloc::string::String, - /// Opaque metadata extending the node identifier. Envoy will pass this - /// directly to the management server. - #[prost(message, optional, tag = "3")] - pub metadata: ::core::option::Option<::prost_types::Struct>, - /// Map from xDS resource type URL to dynamic context parameters. These may vary at runtime (unlike - /// other fields in this message). For example, the xDS client may have a shard identifier that - /// changes during the lifetime of the xDS client. In Envoy, this would be achieved by updating the - /// dynamic context on the Server::Instance's LocalInfo context provider. The shard ID dynamic - /// parameter then appears in this field during future discovery requests. - #[prost(map = "string, message", tag = "12")] - pub dynamic_parameters: ::std::collections::HashMap< - ::prost::alloc::string::String, - super::super::super::super::xds::core::v3::ContextParams, - >, - /// Locality specifying where the Envoy instance is running. - #[prost(message, optional, tag = "4")] - pub locality: ::core::option::Option, - /// Free-form string that identifies the entity requesting config. - /// E.g. "envoy" or "grpc" - #[prost(string, tag = "6")] - pub user_agent_name: ::prost::alloc::string::String, - /// List of extensions and their versions supported by the node. - #[prost(message, repeated, tag = "9")] - pub extensions: ::prost::alloc::vec::Vec, - /// Client feature support list. These are well known features described - /// in the Envoy API repository for a given major version of an API. Client features - /// use reverse DNS naming scheme, for example `com.acme.feature`. - /// See :ref:`the list of features ` that xDS client may - /// support. - #[prost(string, repeated, tag = "10")] - pub client_features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Known listening ports on the node as a generic hint to the management server - /// for filtering :ref:`listeners ` to be returned. For example, - /// if there is a listener bound to port 80, the list can optionally contain the - /// SocketAddress `(0.0.0.0,80)`. The field is optional and just a hint. - #[deprecated] - #[prost(message, repeated, tag = "11")] - pub listening_addresses: ::prost::alloc::vec::Vec
, - #[prost(oneof = "node::UserAgentVersionType", tags = "7, 8")] - pub user_agent_version_type: ::core::option::Option, -} -/// Nested message and enum types in `Node`. -pub mod node { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum UserAgentVersionType { - /// Free-form string that identifies the version of the entity requesting config. - /// E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" - #[prost(string, tag = "7")] - UserAgentVersion(::prost::alloc::string::String), - /// Structured version of the entity requesting config. - #[prost(message, tag = "8")] - UserAgentBuildVersion(super::BuildVersion), - } -} -/// Metadata provides additional inputs to filters based on matched listeners, -/// filter chains, routes and endpoints. It is structured as a map, usually from -/// filter name (in reverse DNS format) to metadata specific to the filter. Metadata -/// key-values for a filter are merged as connection and request handling occurs, -/// with later values for the same key overriding earlier values. -/// -/// An example use of metadata is providing additional values to -/// http_connection_manager in the envoy.http_connection_manager.access_log -/// namespace. -/// -/// Another example use of metadata is to per service config info in cluster metadata, which may get -/// consumed by multiple filters. -/// -/// For load balancing, Metadata provides a means to subset cluster endpoints. -/// Endpoints have a Metadata object associated and routes contain a Metadata -/// object to match against. There are some well defined metadata used today for -/// this purpose: -/// -/// * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an -/// endpoint and is also used during header processing -/// (x-envoy-upstream-canary) and for stats purposes. -/// [#next-major-version: move to type/metadata/v2] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - /// Key is the reverse DNS filter name, e.g. com.acme.widget. The envoy.* - /// namespace is reserved for Envoy's built-in filters. - /// If both *filter_metadata* and - /// :ref:`typed_filter_metadata ` - /// fields are present in the metadata with same keys, - /// only *typed_filter_metadata* field will be parsed. - #[prost(map = "string, message", tag = "1")] - pub filter_metadata: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost_types::Struct>, - /// Key is the reverse DNS filter name, e.g. com.acme.widget. The envoy.* - /// namespace is reserved for Envoy's built-in filters. - /// The value is encoded as google.protobuf.Any. - /// If both :ref:`filter_metadata ` - /// and *typed_filter_metadata* fields are present in the metadata with same keys, - /// only *typed_filter_metadata* field will be parsed. - #[prost(map = "string, message", tag = "2")] - pub typed_filter_metadata: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost_types::Any>, -} -/// Runtime derived uint32 with a default when not specified. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuntimeUInt32 { - /// Default value if runtime value is not available. - #[prost(uint32, tag = "2")] - pub default_value: u32, - /// Runtime key to get value for comparison. This value is used if defined. - #[prost(string, tag = "3")] - pub runtime_key: ::prost::alloc::string::String, -} -/// Runtime derived percentage with a default when not specified. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuntimePercent { - /// Default value if runtime value is not available. - #[prost(message, optional, tag = "1")] - pub default_value: ::core::option::Option, - /// Runtime key to get value for comparison. This value is used if defined. - #[prost(string, tag = "2")] - pub runtime_key: ::prost::alloc::string::String, -} -/// Runtime derived double with a default when not specified. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuntimeDouble { - /// Default value if runtime value is not available. - #[prost(double, tag = "1")] - pub default_value: f64, - /// Runtime key to get value for comparison. This value is used if defined. - #[prost(string, tag = "2")] - pub runtime_key: ::prost::alloc::string::String, -} -/// Runtime derived bool with a default when not specified. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuntimeFeatureFlag { - /// Default value if runtime value is not available. - #[prost(message, optional, tag = "1")] - pub default_value: ::core::option::Option, - /// Runtime key to get value for comparison. This value is used if defined. The boolean value must - /// be represented via its - /// `canonical JSON encoding <`_.> - #[prost(string, tag = "2")] - pub runtime_key: ::prost::alloc::string::String, -} -/// Query parameter name/value pair. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParameter { - /// The key of the query parameter. Case sensitive. - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - /// The value of the query parameter. - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, -} -/// Header name/value pair. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeaderValue { - /// Header name. - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - /// Header value. - /// - /// The same :ref:`format specifier ` as used for - /// :ref:`HTTP access logging ` applies here, however - /// unknown header values are replaced with the empty string instead of `-`. - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, -} -/// Header name/value pair plus option to control append behavior. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeaderValueOption { - /// Header name/value pair that this option applies to. - #[prost(message, optional, tag = "1")] - pub header: ::core::option::Option, - /// Should the value be appended? If true (default), the value is appended to - /// existing values. Otherwise it replaces any existing values. - #[prost(message, optional, tag = "2")] - pub append: ::core::option::Option, - /// \[#not-implemented-hide:\] Describes the action taken to append/overwrite the given value for an existing header - /// or to only add this header if it's absent. Value defaults to :ref:`APPEND_IF_EXISTS_OR_ADD`. - #[prost(enumeration = "header_value_option::HeaderAppendAction", tag = "3")] - pub append_action: i32, -} -/// Nested message and enum types in `HeaderValueOption`. -pub mod header_value_option { - /// Describes the supported actions types for header append action. - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum HeaderAppendAction { - /// This action will append the specified value to the existing values if the header - /// already exists. If the header doesn't exist then this will add the header with - /// specified key and value. - AppendIfExistsOrAdd = 0, - /// This action will add the header if it doesn't already exist. If the header - /// already exists then this will be a no-op. - AddIfAbsent = 1, - /// This action will overwrite the specified value by discarding any existing values if - /// the header already exists. If the header doesn't exist then this will add the header - /// with specified key and value. - OverwriteIfExistsOrAdd = 2, - } -} -/// Wrapper for a set of headers. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeaderMap { - #[prost(message, repeated, tag = "1")] - pub headers: ::prost::alloc::vec::Vec, -} -/// A directory that is watched for changes, e.g. by inotify on Linux. Move/rename -/// events inside this directory trigger the watch. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WatchedDirectory { - /// Directory path to watch. - #[prost(string, tag = "1")] - pub path: ::prost::alloc::string::String, -} -/// Data source consisting of a file, an inline value, or an environment variable. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DataSource { - #[prost(oneof = "data_source::Specifier", tags = "1, 2, 3, 4")] - pub specifier: ::core::option::Option, -} -/// Nested message and enum types in `DataSource`. -pub mod data_source { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Specifier { - /// Local filesystem data source. - #[prost(string, tag = "1")] - Filename(::prost::alloc::string::String), - /// Bytes inlined in the configuration. - #[prost(bytes, tag = "2")] - InlineBytes(::prost::alloc::vec::Vec), - /// String inlined in the configuration. - #[prost(string, tag = "3")] - InlineString(::prost::alloc::string::String), - /// Environment variable data source. - #[prost(string, tag = "4")] - EnvironmentVariable(::prost::alloc::string::String), - } -} -/// The message specifies the retry policy of remote data source when fetching fails. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RetryPolicy { - /// Specifies parameters that control :ref:`retry backoff strategy `. - /// This parameter is optional, in which case the default base interval is 1000 milliseconds. The - /// default maximum interval is 10 times the base interval. - #[prost(message, optional, tag = "1")] - pub retry_back_off: ::core::option::Option, - /// Specifies the allowed number of retries. This parameter is optional and - /// defaults to 1. - #[prost(message, optional, tag = "2")] - pub num_retries: ::core::option::Option, -} -/// The message specifies how to fetch data from remote and how to verify it. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoteDataSource { - /// The HTTP URI to fetch the remote data. - #[prost(message, optional, tag = "1")] - pub http_uri: ::core::option::Option, - /// SHA256 string for verifying data. - #[prost(string, tag = "2")] - pub sha256: ::prost::alloc::string::String, - /// Retry policy for fetching remote data. - #[prost(message, optional, tag = "3")] - pub retry_policy: ::core::option::Option, -} -/// Async data source which support async data fetch. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AsyncDataSource { - #[prost(oneof = "async_data_source::Specifier", tags = "1, 2")] - pub specifier: ::core::option::Option, -} -/// Nested message and enum types in `AsyncDataSource`. -pub mod async_data_source { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Specifier { - /// Local async data source. - #[prost(message, tag = "1")] - Local(super::DataSource), - /// Remote async data source. - #[prost(message, tag = "2")] - Remote(super::RemoteDataSource), - } -} -/// Configuration for transport socket in :ref:`listeners ` and -/// :ref:`clusters `. If the configuration is -/// empty, a default transport socket implementation and configuration will be -/// chosen based on the platform and existence of tls_context. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransportSocket { - /// The name of the transport socket to instantiate. The name must match a supported transport - /// socket implementation. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Implementation specific configuration which depends on the implementation being instantiated. - /// See the supported transport socket implementations for further documentation. - #[prost(oneof = "transport_socket::ConfigType", tags = "3")] - pub config_type: ::core::option::Option, -} -/// Nested message and enum types in `TransportSocket`. -pub mod transport_socket { - /// Implementation specific configuration which depends on the implementation being instantiated. - /// See the supported transport socket implementations for further documentation. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum ConfigType { - #[prost(message, tag = "3")] - TypedConfig(::prost_types::Any), - } -} -/// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not -/// specified via a runtime key. -/// -/// .. note:: -/// -/// Parsing of the runtime key's data is implemented such that it may be represented as a -/// :ref:`FractionalPercent ` proto represented as JSON/YAML -/// and may also be represented as an integer with the assumption that the value is an integral -/// percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse -/// as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuntimeFractionalPercent { - /// Default value if the runtime value's for the numerator/denominator keys are not available. - #[prost(message, optional, tag = "1")] - pub default_value: ::core::option::Option, - /// Runtime key for a YAML representation of a FractionalPercent. - #[prost(string, tag = "2")] - pub runtime_key: ::prost::alloc::string::String, -} -/// Identifies a specific ControlPlane instance that Envoy is connected to. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ControlPlane { - /// An opaque control plane identifier that uniquely identifies an instance - /// of control plane. This can be used to identify which control plane instance, - /// the Envoy is connected to. - #[prost(string, tag = "1")] - pub identifier: ::prost::alloc::string::String, -} -// [#protodoc-title: Common types] - -/// Envoy supports :ref:`upstream priority routing -/// ` both at the route and the virtual -/// cluster level. The current priority implementation uses different connection -/// pool and circuit breaking settings for each priority level. This means that -/// even for HTTP/2 requests, two physical connections will be used to an -/// upstream host. In the future Envoy will likely support true HTTP/2 priority -/// over a single upstream connection. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum RoutingPriority { - Default = 0, - High = 1, -} -/// HTTP request method. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum RequestMethod { - MethodUnspecified = 0, - Get = 1, - Head = 2, - Post = 3, - Put = 4, - Delete = 5, - Connect = 6, - Options = 7, - Trace = 8, - Patch = 9, -} -/// Identifies the direction of the traffic relative to the local Envoy. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum TrafficDirection { - /// Default option is unspecified. - Unspecified = 0, - /// The transport is used for incoming traffic. - Inbound = 1, - /// The transport is used for outgoing traffic. - Outbound = 2, -} diff --git a/limitador-server/src/envoy_rls/protobufs/envoy.extensions.common.ratelimit.v3.rs b/limitador-server/src/envoy_rls/protobufs/envoy.extensions.common.ratelimit.v3.rs deleted file mode 100644 index 710cce26..00000000 --- a/limitador-server/src/envoy_rls/protobufs/envoy.extensions.common.ratelimit.v3.rs +++ /dev/null @@ -1,92 +0,0 @@ -// [#protodoc-title: Common rate limit components] - -/// A RateLimitDescriptor is a list of hierarchical entries that are used by the service to -/// determine the final rate limit key and overall allowed limit. Here are some examples of how -/// they might be used for the domain "envoy". -/// -/// .. code-block:: cpp -/// -/// ["authenticated": "false"], ["remote_address": "10.0.0.1"] -/// -/// What it does: Limits all unauthenticated traffic for the IP address 10.0.0.1. The -/// configuration supplies a default limit for the *remote_address* key. If there is a desire to -/// raise the limit for 10.0.0.1 or block it entirely it can be specified directly in the -/// configuration. -/// -/// .. code-block:: cpp -/// -/// ["authenticated": "false"], ["path": "/foo/bar"] -/// -/// What it does: Limits all unauthenticated traffic globally for a specific path (or prefix if -/// configured that way in the service). -/// -/// .. code-block:: cpp -/// -/// ["authenticated": "false"], ["path": "/foo/bar"], ["remote_address": "10.0.0.1"] -/// -/// What it does: Limits unauthenticated traffic to a specific path for a specific IP address. -/// Like (1) we can raise/block specific IP addresses if we want with an override configuration. -/// -/// .. code-block:: cpp -/// -/// ["authenticated": "true"], ["client_id": "foo"] -/// -/// What it does: Limits all traffic for an authenticated client "foo" -/// -/// .. code-block:: cpp -/// -/// ["authenticated": "true"], ["client_id": "foo"], ["path": "/foo/bar"] -/// -/// What it does: Limits traffic to a specific path for an authenticated client "foo" -/// -/// The idea behind the API is that (1)/(2)/(3) and (4)/(5) can be sent in 1 request if desired. -/// This enables building complex application scenarios with a generic backend. -/// -/// Optionally the descriptor can contain a limit override under a "limit" key, that specifies -/// the number of requests per unit to use instead of the number configured in the -/// rate limiting service. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RateLimitDescriptor { - /// Descriptor entries. - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - /// Optional rate limit override to supply to the ratelimit service. - #[prost(message, optional, tag = "2")] - pub limit: ::core::option::Option, -} -/// Nested message and enum types in `RateLimitDescriptor`. -pub mod rate_limit_descriptor { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Entry { - /// Descriptor key. - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - /// Descriptor value. - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - } - /// Override rate limit to apply to this descriptor instead of the limit - /// configured in the rate limit service. See :ref:`rate limit override - /// ` for more information. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct RateLimitOverride { - /// The number of requests per unit of time. - #[prost(uint32, tag = "1")] - pub requests_per_unit: u32, - /// The unit of time. - #[prost( - enumeration = "super::super::super::super::super::r#type::v3::RateLimitUnit", - tag = "2" - )] - pub unit: i32, - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocalRateLimitDescriptor { - /// Descriptor entries. - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - /// Token Bucket algorithm for local ratelimiting. - #[prost(message, optional, tag = "2")] - pub token_bucket: ::core::option::Option, -} diff --git a/limitador-server/src/envoy_rls/protobufs/envoy.r#type.v3.rs b/limitador-server/src/envoy_rls/protobufs/envoy.r#type.v3.rs deleted file mode 100644 index 067ad7df..00000000 --- a/limitador-server/src/envoy_rls/protobufs/envoy.r#type.v3.rs +++ /dev/null @@ -1,94 +0,0 @@ -// [#protodoc-title: Percent] - -/// Identifies a percentage, in the range [0.0, 100.0]. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Percent { - #[prost(double, tag = "1")] - pub value: f64, -} -/// A fractional percentage is used in cases in which for performance reasons performing floating -/// point to integer conversions during randomness calculations is undesirable. The message includes -/// both a numerator and denominator that together determine the final fractional value. -/// -/// * **Example**: 1/100 = 1%. -/// * **Example**: 3/10000 = 0.03%. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FractionalPercent { - /// Specifies the numerator. Defaults to 0. - #[prost(uint32, tag = "1")] - pub numerator: u32, - /// Specifies the denominator. If the denominator specified is less than the numerator, the final - /// fractional percentage is capped at 1 (100%). - #[prost(enumeration = "fractional_percent::DenominatorType", tag = "2")] - pub denominator: i32, -} -/// Nested message and enum types in `FractionalPercent`. -pub mod fractional_percent { - /// Fraction percentages support several fixed denominator values. - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum DenominatorType { - /// 100. - /// - /// **Example**: 1/100 = 1%. - Hundred = 0, - /// 10,000. - /// - /// **Example**: 1/10000 = 0.01%. - TenThousand = 1, - /// 1,000,000. - /// - /// **Example**: 1/1000000 = 0.0001%. - Million = 2, - } -} -// [#protodoc-title: Semantic Version] - -/// Envoy uses SemVer (). Major/minor versions indicate -/// expected behaviors and APIs, the patch version field is used only -/// for security fixes and can be generally ignored. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SemanticVersion { - #[prost(uint32, tag = "1")] - pub major_number: u32, - #[prost(uint32, tag = "2")] - pub minor_number: u32, - #[prost(uint32, tag = "3")] - pub patch: u32, -} -// [#protodoc-title: Ratelimit Time Unit] - -/// Identifies the unit of of time for rate limit. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum RateLimitUnit { - /// The time unit is not known. - Unknown = 0, - /// The time unit representing a second. - Second = 1, - /// The time unit representing a minute. - Minute = 2, - /// The time unit representing an hour. - Hour = 3, - /// The time unit representing a day. - Day = 4, -} -// [#protodoc-title: Token bucket] - -/// Configures a token bucket, typically used for rate limiting. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TokenBucket { - /// The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket - /// initially contains. - #[prost(uint32, tag = "1")] - pub max_tokens: u32, - /// The number of tokens added to the bucket during each fill interval. If not specified, defaults - /// to a single token. - #[prost(message, optional, tag = "2")] - pub tokens_per_fill: ::core::option::Option, - /// The fill interval that tokens are added to the bucket. During each fill interval - /// `tokens_per_fill` are added to the bucket. The bucket will never contain more than - /// `max_tokens` tokens. - #[prost(message, optional, tag = "3")] - pub fill_interval: ::core::option::Option<::prost_types::Duration>, -} diff --git a/limitador-server/src/envoy_rls/protobufs/envoy.service.ratelimit.v3.rs b/limitador-server/src/envoy_rls/protobufs/envoy.service.ratelimit.v3.rs deleted file mode 100644 index 04b137d0..00000000 --- a/limitador-server/src/envoy_rls/protobufs/envoy.service.ratelimit.v3.rs +++ /dev/null @@ -1,396 +0,0 @@ -/// Main message for a rate limit request. The rate limit service is designed to be fully generic -/// in the sense that it can operate on arbitrary hierarchical key/value pairs. The loaded -/// configuration will parse the request and find the most specific limit to apply. In addition, -/// a RateLimitRequest can contain multiple "descriptors" to limit on. When multiple descriptors -/// are provided, the server will limit on *ALL* of them and return an OVER_LIMIT response if any -/// of them are over limit. This enables more complex application level rate limiting scenarios -/// if desired. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RateLimitRequest { - /// All rate limit requests must specify a domain. This enables the configuration to be per - /// application without fear of overlap. E.g., "envoy". - #[prost(string, tag = "1")] - pub domain: ::prost::alloc::string::String, - /// All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is - /// processed by the service (see below). If any of the descriptors are over limit, the entire - /// request is considered to be over limit. - #[prost(message, repeated, tag = "2")] - pub descriptors: ::prost::alloc::vec::Vec< - super::super::super::extensions::common::ratelimit::v3::RateLimitDescriptor, - >, - /// 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. - #[prost(uint32, tag = "3")] - pub hits_addend: u32, -} -/// A response from a ShouldRateLimit call. -/// [#next-free-field: 8] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RateLimitResponse { - /// The overall response code which takes into account all of the descriptors that were passed - /// in the RateLimitRequest message. - #[prost(enumeration = "rate_limit_response::Code", tag = "1")] - pub overall_code: i32, - /// A list of DescriptorStatus messages which matches the length of the descriptor list passed - /// in the RateLimitRequest. This can be used by the caller to determine which individual - /// descriptors failed and/or what the currently configured limits are for all of them. - #[prost(message, repeated, tag = "2")] - pub statuses: ::prost::alloc::vec::Vec, - /// A list of headers to add to the response - #[prost(message, repeated, tag = "3")] - pub response_headers_to_add: - ::prost::alloc::vec::Vec, - /// A list of headers to add to the request when forwarded - #[prost(message, repeated, tag = "4")] - pub request_headers_to_add: - ::prost::alloc::vec::Vec, - /// A response body to send to the downstream client when the response code is not OK. - #[prost(bytes = "vec", tag = "5")] - pub raw_body: ::prost::alloc::vec::Vec, - /// Optional response metadata that will be emitted as dynamic metadata to be consumed by the next - /// filter. This metadata lives in a namespace specified by the canonical name of extension filter - /// that requires it: - /// - /// - :ref:`envoy.filters.http.ratelimit ` for HTTP filter. - /// - :ref:`envoy.filters.network.ratelimit ` for network filter. - /// - :ref:`envoy.filters.thrift.rate_limit ` for Thrift filter. - #[prost(message, optional, tag = "6")] - pub dynamic_metadata: ::core::option::Option<::prost_types::Struct>, - /// Quota is available for a request if its entire descriptor set has cached quota available. - /// This is a union of all descriptors in the descriptor set. Clients can use the quota for future matches if and only if the descriptor set matches what was sent in the request that originated this response. - /// - /// If quota is available, a RLS request will not be made and the quota will be reduced by 1. - /// If quota is not available (i.e., a cached entry doesn't exist for a RLS descriptor set), a RLS request will be triggered. - /// If the server did not provide a quota, such as the quota message is empty then the request admission is determined by the - /// :ref:`overall_code `. - /// - /// If there is not sufficient quota and the cached entry exists for a RLS descriptor set is out-of-quota but not expired, - /// the request will be treated as OVER_LIMIT. - /// \[#not-implemented-hide:\] - #[prost(message, optional, tag = "7")] - pub quota: ::core::option::Option, -} -/// Nested message and enum types in `RateLimitResponse`. -pub mod rate_limit_response { - /// Defines an actual rate limit in terms of requests per unit of time and the unit itself. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct RateLimit { - /// A name or description of this limit. - #[prost(string, tag = "3")] - pub name: ::prost::alloc::string::String, - /// The number of requests per unit of time. - #[prost(uint32, tag = "1")] - pub requests_per_unit: u32, - /// The unit of time. - #[prost(enumeration = "rate_limit::Unit", tag = "2")] - pub unit: i32, - } - /// Nested message and enum types in `RateLimit`. - pub mod rate_limit { - /// Identifies the unit of of time for rate limit. - /// [#comment: replace by envoy/type/v3/ratelimit_unit.proto in v4] - #[derive( - Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration, - )] - #[repr(i32)] - pub enum Unit { - /// The time unit is not known. - Unknown = 0, - /// The time unit representing a second. - Second = 1, - /// The time unit representing a minute. - Minute = 2, - /// The time unit representing an hour. - Hour = 3, - /// The time unit representing a day. - Day = 4, - } - } - /// Cacheable quota for responses. - /// Quota can be granted at different levels: either for each individual descriptor or for the whole descriptor set. - /// This is a certain number of requests over a period of time. - /// The client may cache this result and apply the effective RateLimitResponse to future matching - /// requests without querying rate limit service. - /// - /// When quota expires due to timeout, a new RLS request will also be made. - /// The implementation may choose to preemptively query the rate limit server for more quota on or - /// before expiration or before the available quota runs out. - /// \[#not-implemented-hide:\] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Quota { - /// Number of matching requests granted in quota. Must be 1 or more. - #[prost(uint32, tag = "1")] - pub requests: u32, - /// The unique id that is associated with each Quota either at individual descriptor level or whole descriptor set level. - /// - /// For a matching policy with boolean logic, for example, match: "request.headers\['environment'\] == 'staging' || request.headers\['environment'\] == 'dev'"), - /// the request_headers action produces a distinct list of descriptors for each possible value of the ‘environment’ header even though the granted quota is same. - /// Thus, the client will use this id information (returned from RLS server) to correctly correlate the multiple descriptors/descriptor sets that have been granted with same quota (i.e., share the same quota among multiple descriptors or descriptor sets.) - /// - /// If id is empty, this id field will be ignored. If quota for the same id changes (e.g. due to configuration update), the old quota will be overridden by the new one. Shared quotas referenced by ID will still adhere to expiration after `valid_until`. - #[prost(string, tag = "3")] - pub id: ::prost::alloc::string::String, - #[prost(oneof = "quota::ExpirationSpecifier", tags = "2")] - pub expiration_specifier: ::core::option::Option, - } - /// Nested message and enum types in `Quota`. - pub mod quota { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum ExpirationSpecifier { - /// Point in time at which the quota expires. - #[prost(message, tag = "2")] - ValidUntil(::prost_types::Timestamp), - } - } - /// [#next-free-field: 6] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct DescriptorStatus { - /// The response code for an individual descriptor. - #[prost(enumeration = "Code", tag = "1")] - pub code: i32, - /// The current limit as configured by the server. Useful for debugging, etc. - #[prost(message, optional, tag = "2")] - pub current_limit: ::core::option::Option, - /// The limit remaining in the current time unit. - #[prost(uint32, tag = "3")] - pub limit_remaining: u32, - /// Duration until reset of the current limit window. - #[prost(message, optional, tag = "4")] - pub duration_until_reset: ::core::option::Option<::prost_types::Duration>, - /// Quota is available for a request if its descriptor set has cached quota available for all - /// descriptors. - /// This is for each individual descriptor in the descriptor set. The client will perform matches for each individual descriptor against available per-descriptor quota. - /// - /// If quota is available, a RLS request will not be made and the quota will be reduced by 1 for - /// all matching descriptors. - /// - /// If there is not sufficient quota, there are three cases: - /// 1. A cached entry exists for a RLS descriptor that is out-of-quota, but not expired. - /// In this case, the request will be treated as OVER_LIMIT. - /// 2. Some RLS descriptors have a cached entry that has valid quota but some RLS descriptors - /// have no cached entry. This will trigger a new RLS request. - /// When the result is returned, a single unit will be consumed from the quota for all - /// matching descriptors. - /// If the server did not provide a quota, such as the quota message is empty for some of - /// the descriptors, then the request admission is determined by the - /// :ref:`overall_code `. - /// 3. All RLS descriptors lack a cached entry, this will trigger a new RLS request, - /// When the result is returned, a single unit will be consumed from the quota for all - /// matching descriptors. - /// If the server did not provide a quota, such as the quota message is empty for some of - /// the descriptors, then the request admission is determined by the - /// :ref:`overall_code `. - /// \[#not-implemented-hide:\] - #[prost(message, optional, tag = "5")] - pub quota: ::core::option::Option, - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum Code { - /// The response code is not known. - Unknown = 0, - /// The response code to notify that the number of requests are under limit. - Ok = 1, - /// The response code to notify that the number of requests are over limit. - OverLimit = 2, - } -} -#[doc = r" Generated client implementations."] -pub mod rate_limit_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct RateLimitServiceClient { - inner: tonic::client::Grpc, - } - impl RateLimitServiceClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl RateLimitServiceClient - where - T: tonic::client::GrpcService, - T::ResponseBody: Body + Send + 'static, - T::Error: Into, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> RateLimitServiceClient> - where - F: tonic::service::Interceptor, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - RateLimitServiceClient::new(InterceptedService::new(inner, interceptor)) - } - #[doc = r" Compress requests with `gzip`."] - #[doc = r""] - #[doc = r" This requires the server to support it otherwise it might respond with an"] - #[doc = r" error."] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); - self - } - #[doc = r" Enable decompressing responses with `gzip`."] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); - self - } - #[doc = " Determine whether rate limiting should take place."] - pub async fn should_rate_limit( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/envoy.service.ratelimit.v3.RateLimitService/ShouldRateLimit", - ); - self.inner.unary(request.into_request(), path, codec).await - } - } -} -#[doc = r" Generated server implementations."] -pub mod rate_limit_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - #[doc = "Generated trait containing gRPC methods that should be implemented for use with RateLimitServiceServer."] - #[async_trait] - pub trait RateLimitService: Send + Sync + 'static { - #[doc = " Determine whether rate limiting should take place."] - async fn should_rate_limit( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - } - #[derive(Debug)] - pub struct RateLimitServiceServer { - inner: _Inner, - accept_compression_encodings: (), - send_compression_encodings: (), - } - struct _Inner(Arc); - impl RateLimitServiceServer { - pub fn new(inner: T) -> Self { - let inner = Arc::new(inner); - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - } - } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - } - impl tonic::codegen::Service> for RateLimitServiceServer - where - T: RateLimitService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = Never; - type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/envoy.service.ratelimit.v3.RateLimitService/ShouldRateLimit" => { - #[allow(non_camel_case_types)] - struct ShouldRateLimitSvc(pub Arc); - impl tonic::server::UnaryService - for ShouldRateLimitSvc - { - type Response = super::RateLimitResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).should_rate_limit(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ShouldRateLimitSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), - } - } - } - impl Clone for RateLimitServiceServer { - 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, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(self.0.clone()) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::transport::NamedService for RateLimitServiceServer { - const NAME: &'static str = "envoy.service.ratelimit.v3.RateLimitService"; - } -} diff --git a/limitador-server/src/envoy_rls/protobufs/google.protobuf.rs b/limitador-server/src/envoy_rls/protobufs/google.protobuf.rs deleted file mode 100644 index 8b137891..00000000 --- a/limitador-server/src/envoy_rls/protobufs/google.protobuf.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/limitador-server/src/envoy_rls/protobufs/udpa.annotations.rs b/limitador-server/src/envoy_rls/protobufs/udpa.annotations.rs deleted file mode 100644 index dafb07f0..00000000 --- a/limitador-server/src/envoy_rls/protobufs/udpa.annotations.rs +++ /dev/null @@ -1,54 +0,0 @@ -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StatusAnnotation { - /// The entity is work-in-progress and subject to breaking changes. - #[prost(bool, tag = "1")] - pub work_in_progress: bool, - /// The entity belongs to a package with the given version status. - #[prost(enumeration = "PackageVersionStatus", tag = "2")] - pub package_version_status: i32, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum PackageVersionStatus { - /// Unknown package version status. - Unknown = 0, - /// This version of the package is frozen. - Frozen = 1, - /// This version of the package is the active development version. - Active = 2, - /// This version of the package is the candidate for the next major version. It - /// is typically machine generated from the active development version. - NextMajorVersionCandidate = 3, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VersioningAnnotation { - /// Track the previous message type. E.g. this message might be - /// udpa.foo.v3alpha.Foo and it was previously udpa.bar.v2.Bar. This - /// information is consumed by UDPA via proto descriptors. - #[prost(string, tag = "1")] - pub previous_message_type: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MigrateAnnotation { - /// Rename the message/enum/enum value in next version. - #[prost(string, tag = "1")] - pub rename: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FieldMigrateAnnotation { - /// Rename the field in next version. - #[prost(string, tag = "1")] - pub rename: ::prost::alloc::string::String, - /// Add the field to a named oneof in next version. If this already exists, the - /// field will join its siblings under the oneof, otherwise a new oneof will be - /// created with the given name. - #[prost(string, tag = "2")] - pub oneof_promotion: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FileMigrateAnnotation { - /// Move all types in the file to another package, this implies changing proto - /// file path. - #[prost(string, tag = "2")] - pub move_to_package: ::prost::alloc::string::String, -} diff --git a/limitador-server/src/envoy_rls/protobufs/validate.rs b/limitador-server/src/envoy_rls/protobufs/validate.rs deleted file mode 100644 index 363ece55..00000000 --- a/limitador-server/src/envoy_rls/protobufs/validate.rs +++ /dev/null @@ -1,899 +0,0 @@ -/// FieldRules encapsulates the rules for each type of field. Depending on the -/// field, the correct set should be used to ensure proper validations. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FieldRules { - #[prost(message, optional, tag = "17")] - pub message: ::core::option::Option, - #[prost( - oneof = "field_rules::Type", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22" - )] - pub r#type: ::core::option::Option, -} -/// Nested message and enum types in `FieldRules`. -pub mod field_rules { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Type { - /// Scalar Field Types - #[prost(message, tag = "1")] - Float(super::FloatRules), - #[prost(message, tag = "2")] - Double(super::DoubleRules), - #[prost(message, tag = "3")] - Int32(super::Int32Rules), - #[prost(message, tag = "4")] - Int64(super::Int64Rules), - #[prost(message, tag = "5")] - Uint32(super::UInt32Rules), - #[prost(message, tag = "6")] - Uint64(super::UInt64Rules), - #[prost(message, tag = "7")] - Sint32(super::SInt32Rules), - #[prost(message, tag = "8")] - Sint64(super::SInt64Rules), - #[prost(message, tag = "9")] - Fixed32(super::Fixed32Rules), - #[prost(message, tag = "10")] - Fixed64(super::Fixed64Rules), - #[prost(message, tag = "11")] - Sfixed32(super::SFixed32Rules), - #[prost(message, tag = "12")] - Sfixed64(super::SFixed64Rules), - #[prost(message, tag = "13")] - Bool(super::BoolRules), - #[prost(message, tag = "14")] - String(super::StringRules), - #[prost(message, tag = "15")] - Bytes(super::BytesRules), - /// Complex Field Types - #[prost(message, tag = "16")] - Enum(super::EnumRules), - #[prost(message, tag = "18")] - Repeated(::prost::alloc::boxed::Box), - #[prost(message, tag = "19")] - Map(::prost::alloc::boxed::Box), - /// Well-Known Field Types - #[prost(message, tag = "20")] - Any(super::AnyRules), - #[prost(message, tag = "21")] - Duration(super::DurationRules), - #[prost(message, tag = "22")] - Timestamp(super::TimestampRules), - } -} -/// FloatRules describes the constraints applied to `float` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FloatRules { - /// Const specifies that this field must be exactly the specified value - #[prost(float, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(float, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(float, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(float, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(float, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(float, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(float, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// DoubleRules describes the constraints applied to `double` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DoubleRules { - /// Const specifies that this field must be exactly the specified value - #[prost(double, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(double, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(double, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(double, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(double, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(double, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(double, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// Int32Rules describes the constraints applied to `int32` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Int32Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(int32, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(int32, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(int32, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(int32, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(int32, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(int32, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(int32, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// Int64Rules describes the constraints applied to `int64` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Int64Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(int64, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(int64, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(int64, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(int64, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(int64, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(int64, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(int64, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// UInt32Rules describes the constraints applied to `uint32` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UInt32Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(uint32, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(uint32, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(uint32, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(uint32, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(uint32, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(uint32, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(uint32, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// UInt64Rules describes the constraints applied to `uint64` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UInt64Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(uint64, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(uint64, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(uint64, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(uint64, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(uint64, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(uint64, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(uint64, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// SInt32Rules describes the constraints applied to `sint32` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SInt32Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(sint32, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(sint32, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(sint32, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(sint32, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(sint32, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(sint32, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(sint32, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// SInt64Rules describes the constraints applied to `sint64` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SInt64Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(sint64, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(sint64, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(sint64, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(sint64, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(sint64, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(sint64, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(sint64, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// Fixed32Rules describes the constraints applied to `fixed32` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Fixed32Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(fixed32, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(fixed32, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(fixed32, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(fixed32, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(fixed32, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(fixed32, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(fixed32, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// Fixed64Rules describes the constraints applied to `fixed64` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Fixed64Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(fixed64, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(fixed64, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(fixed64, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(fixed64, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(fixed64, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(fixed64, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(fixed64, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// SFixed32Rules describes the constraints applied to `sfixed32` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SFixed32Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(sfixed32, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(sfixed32, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(sfixed32, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(sfixed32, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(sfixed32, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(sfixed32, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(sfixed32, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// SFixed64Rules describes the constraints applied to `sfixed64` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SFixed64Rules { - /// Const specifies that this field must be exactly the specified value - #[prost(sfixed64, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(sfixed64, optional, tag = "2")] - pub lt: ::core::option::Option, - /// Lte specifies that this field must be less than or equal to the - /// specified value, inclusive - #[prost(sfixed64, optional, tag = "3")] - pub lte: ::core::option::Option, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive. If the value of Gt is larger than a specified Lt or Lte, the - /// range is reversed. - #[prost(sfixed64, optional, tag = "4")] - pub gt: ::core::option::Option, - /// Gte specifies that this field must be greater than or equal to the - /// specified value, inclusive. If the value of Gte is larger than a - /// specified Lt or Lte, the range is reversed. - #[prost(sfixed64, optional, tag = "5")] - pub gte: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(sfixed64, repeated, packed = "false", tag = "6")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(sfixed64, repeated, packed = "false", tag = "7")] - pub not_in: ::prost::alloc::vec::Vec, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "8")] - pub ignore_empty: ::core::option::Option, -} -/// BoolRules describes the constraints applied to `bool` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BoolRules { - /// Const specifies that this field must be exactly the specified value - #[prost(bool, optional, tag = "1")] - pub r#const: ::core::option::Option, -} -/// StringRules describe the constraints applied to `string` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StringRules { - /// Const specifies that this field must be exactly the specified value - #[prost(string, optional, tag = "1")] - pub r#const: ::core::option::Option<::prost::alloc::string::String>, - /// Len specifies that this field must be the specified number of - /// characters (Unicode code points). Note that the number of - /// characters may differ from the number of bytes in the string. - #[prost(uint64, optional, tag = "19")] - pub len: ::core::option::Option, - /// MinLen specifies that this field must be the specified number of - /// characters (Unicode code points) at a minimum. Note that the number of - /// characters may differ from the number of bytes in the string. - #[prost(uint64, optional, tag = "2")] - pub min_len: ::core::option::Option, - /// MaxLen specifies that this field must be the specified number of - /// characters (Unicode code points) at a maximum. Note that the number of - /// characters may differ from the number of bytes in the string. - #[prost(uint64, optional, tag = "3")] - pub max_len: ::core::option::Option, - /// LenBytes specifies that this field must be the specified number of bytes - #[prost(uint64, optional, tag = "20")] - pub len_bytes: ::core::option::Option, - /// MinBytes specifies that this field must be the specified number of bytes - /// at a minimum - #[prost(uint64, optional, tag = "4")] - pub min_bytes: ::core::option::Option, - /// MaxBytes specifies that this field must be the specified number of bytes - /// at a maximum - #[prost(uint64, optional, tag = "5")] - pub max_bytes: ::core::option::Option, - /// Pattern specifes that this field must match against the specified - /// regular expression (RE2 syntax). The included expression should elide - /// any delimiters. - #[prost(string, optional, tag = "6")] - pub pattern: ::core::option::Option<::prost::alloc::string::String>, - /// Prefix specifies that this field must have the specified substring at - /// the beginning of the string. - #[prost(string, optional, tag = "7")] - pub prefix: ::core::option::Option<::prost::alloc::string::String>, - /// Suffix specifies that this field must have the specified substring at - /// the end of the string. - #[prost(string, optional, tag = "8")] - pub suffix: ::core::option::Option<::prost::alloc::string::String>, - /// Contains specifies that this field must have the specified substring - /// anywhere in the string. - #[prost(string, optional, tag = "9")] - pub contains: ::core::option::Option<::prost::alloc::string::String>, - /// NotContains specifies that this field cannot have the specified substring - /// anywhere in the string. - #[prost(string, optional, tag = "23")] - pub not_contains: ::core::option::Option<::prost::alloc::string::String>, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(string, repeated, tag = "10")] - pub r#in: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(string, repeated, tag = "11")] - pub not_in: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - /// strict header validation. - /// By default, this is true, and HTTP header validations are RFC-compliant. - /// Setting to false will enable a looser validations that only disallows - /// \r\n\0 characters, which can be used to bypass header matching rules. - #[prost(bool, optional, tag = "25", default = "true")] - pub strict: ::core::option::Option, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "26")] - pub ignore_empty: ::core::option::Option, - /// WellKnown rules provide advanced constraints against common string - /// patterns - #[prost( - oneof = "string_rules::WellKnown", - tags = "12, 13, 14, 15, 16, 17, 18, 21, 22, 24" - )] - pub well_known: ::core::option::Option, -} -/// Nested message and enum types in `StringRules`. -pub mod string_rules { - /// WellKnown rules provide advanced constraints against common string - /// patterns - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WellKnown { - /// Email specifies that the field must be a valid email address as - /// defined by RFC 5322 - #[prost(bool, tag = "12")] - Email(bool), - /// Hostname specifies that the field must be a valid hostname as - /// defined by RFC 1034. This constraint does not support - /// internationalized domain names (IDNs). - #[prost(bool, tag = "13")] - Hostname(bool), - /// Ip specifies that the field must be a valid IP (v4 or v6) address. - /// Valid IPv6 addresses should not include surrounding square brackets. - #[prost(bool, tag = "14")] - Ip(bool), - /// Ipv4 specifies that the field must be a valid IPv4 address. - #[prost(bool, tag = "15")] - Ipv4(bool), - /// Ipv6 specifies that the field must be a valid IPv6 address. Valid - /// IPv6 addresses should not include surrounding square brackets. - #[prost(bool, tag = "16")] - Ipv6(bool), - /// Uri specifies that the field must be a valid, absolute URI as defined - /// by RFC 3986 - #[prost(bool, tag = "17")] - Uri(bool), - /// UriRef specifies that the field must be a valid URI as defined by RFC - /// 3986 and may be relative or absolute. - #[prost(bool, tag = "18")] - UriRef(bool), - /// Address specifies that the field must be either a valid hostname as - /// defined by RFC 1034 (which does not support internationalized domain - /// names or IDNs), or it can be a valid IP (v4 or v6). - #[prost(bool, tag = "21")] - Address(bool), - /// Uuid specifies that the field must be a valid UUID as defined by - /// RFC 4122 - #[prost(bool, tag = "22")] - Uuid(bool), - /// WellKnownRegex specifies a common well known pattern defined as a regex. - #[prost(enumeration = "super::KnownRegex", tag = "24")] - WellKnownRegex(i32), - } -} -/// BytesRules describe the constraints applied to `bytes` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BytesRules { - /// Const specifies that this field must be exactly the specified value - #[prost(bytes = "vec", optional, tag = "1")] - pub r#const: ::core::option::Option<::prost::alloc::vec::Vec>, - /// Len specifies that this field must be the specified number of bytes - #[prost(uint64, optional, tag = "13")] - pub len: ::core::option::Option, - /// MinLen specifies that this field must be the specified number of bytes - /// at a minimum - #[prost(uint64, optional, tag = "2")] - pub min_len: ::core::option::Option, - /// MaxLen specifies that this field must be the specified number of bytes - /// at a maximum - #[prost(uint64, optional, tag = "3")] - pub max_len: ::core::option::Option, - /// Pattern specifes that this field must match against the specified - /// regular expression (RE2 syntax). The included expression should elide - /// any delimiters. - #[prost(string, optional, tag = "4")] - pub pattern: ::core::option::Option<::prost::alloc::string::String>, - /// Prefix specifies that this field must have the specified bytes at the - /// beginning of the string. - #[prost(bytes = "vec", optional, tag = "5")] - pub prefix: ::core::option::Option<::prost::alloc::vec::Vec>, - /// Suffix specifies that this field must have the specified bytes at the - /// end of the string. - #[prost(bytes = "vec", optional, tag = "6")] - pub suffix: ::core::option::Option<::prost::alloc::vec::Vec>, - /// Contains specifies that this field must have the specified bytes - /// anywhere in the string. - #[prost(bytes = "vec", optional, tag = "7")] - pub contains: ::core::option::Option<::prost::alloc::vec::Vec>, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(bytes = "vec", repeated, tag = "8")] - pub r#in: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(bytes = "vec", repeated, tag = "9")] - pub not_in: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "14")] - pub ignore_empty: ::core::option::Option, - /// WellKnown rules provide advanced constraints against common byte - /// patterns - #[prost(oneof = "bytes_rules::WellKnown", tags = "10, 11, 12")] - pub well_known: ::core::option::Option, -} -/// Nested message and enum types in `BytesRules`. -pub mod bytes_rules { - /// WellKnown rules provide advanced constraints against common byte - /// patterns - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum WellKnown { - /// Ip specifies that the field must be a valid IP (v4 or v6) address in - /// byte format - #[prost(bool, tag = "10")] - Ip(bool), - /// Ipv4 specifies that the field must be a valid IPv4 address in byte - /// format - #[prost(bool, tag = "11")] - Ipv4(bool), - /// Ipv6 specifies that the field must be a valid IPv6 address in byte - /// format - #[prost(bool, tag = "12")] - Ipv6(bool), - } -} -/// EnumRules describe the constraints applied to enum values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EnumRules { - /// Const specifies that this field must be exactly the specified value - #[prost(int32, optional, tag = "1")] - pub r#const: ::core::option::Option, - /// DefinedOnly specifies that this field must be only one of the defined - /// values for this enum, failing on any undefined value. - #[prost(bool, optional, tag = "2")] - pub defined_only: ::core::option::Option, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(int32, repeated, packed = "false", tag = "3")] - pub r#in: ::prost::alloc::vec::Vec, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(int32, repeated, packed = "false", tag = "4")] - pub not_in: ::prost::alloc::vec::Vec, -} -/// MessageRules describe the constraints applied to embedded message values. -/// For message-type fields, validation is performed recursively. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MessageRules { - /// Skip specifies that the validation rules of this field should not be - /// evaluated - #[prost(bool, optional, tag = "1")] - pub skip: ::core::option::Option, - /// Required specifies that this field must be set - #[prost(bool, optional, tag = "2")] - pub required: ::core::option::Option, -} -/// RepeatedRules describe the constraints applied to `repeated` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RepeatedRules { - /// MinItems specifies that this field must have the specified number of - /// items at a minimum - #[prost(uint64, optional, tag = "1")] - pub min_items: ::core::option::Option, - /// MaxItems specifies that this field must have the specified number of - /// items at a maximum - #[prost(uint64, optional, tag = "2")] - pub max_items: ::core::option::Option, - /// Unique specifies that all elements in this field must be unique. This - /// contraint is only applicable to scalar and enum types (messages are not - /// supported). - #[prost(bool, optional, tag = "3")] - pub unique: ::core::option::Option, - /// Items specifies the contraints to be applied to each item in the field. - /// Repeated message fields will still execute validation against each item - /// unless skip is specified here. - #[prost(message, optional, boxed, tag = "4")] - pub items: ::core::option::Option<::prost::alloc::boxed::Box>, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "5")] - pub ignore_empty: ::core::option::Option, -} -/// MapRules describe the constraints applied to `map` values -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MapRules { - /// MinPairs specifies that this field must have the specified number of - /// KVs at a minimum - #[prost(uint64, optional, tag = "1")] - pub min_pairs: ::core::option::Option, - /// MaxPairs specifies that this field must have the specified number of - /// KVs at a maximum - #[prost(uint64, optional, tag = "2")] - pub max_pairs: ::core::option::Option, - /// NoSparse specifies values in this field cannot be unset. This only - /// applies to map's with message value types. - #[prost(bool, optional, tag = "3")] - pub no_sparse: ::core::option::Option, - /// Keys specifies the constraints to be applied to each key in the field. - #[prost(message, optional, boxed, tag = "4")] - pub keys: ::core::option::Option<::prost::alloc::boxed::Box>, - /// Values specifies the constraints to be applied to the value of each key - /// in the field. Message values will still have their validations evaluated - /// unless skip is specified here. - #[prost(message, optional, boxed, tag = "5")] - pub values: ::core::option::Option<::prost::alloc::boxed::Box>, - /// IgnoreEmpty specifies that the validation rules of this field should be - /// evaluated only if the field is not empty - #[prost(bool, optional, tag = "6")] - pub ignore_empty: ::core::option::Option, -} -/// AnyRules describe constraints applied exclusively to the -/// `google.protobuf.Any` well-known type -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AnyRules { - /// Required specifies that this field must be set - #[prost(bool, optional, tag = "1")] - pub required: ::core::option::Option, - /// In specifies that this field's `type_url` must be equal to one of the - /// specified values. - #[prost(string, repeated, tag = "2")] - pub r#in: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// NotIn specifies that this field's `type_url` must not be equal to any of - /// the specified values. - #[prost(string, repeated, tag = "3")] - pub not_in: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// DurationRules describe the constraints applied exclusively to the -/// `google.protobuf.Duration` well-known type -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DurationRules { - /// Required specifies that this field must be set - #[prost(bool, optional, tag = "1")] - pub required: ::core::option::Option, - /// Const specifies that this field must be exactly the specified value - #[prost(message, optional, tag = "2")] - pub r#const: ::core::option::Option<::prost_types::Duration>, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(message, optional, tag = "3")] - pub lt: ::core::option::Option<::prost_types::Duration>, - /// Lt specifies that this field must be less than the specified value, - /// inclusive - #[prost(message, optional, tag = "4")] - pub lte: ::core::option::Option<::prost_types::Duration>, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive - #[prost(message, optional, tag = "5")] - pub gt: ::core::option::Option<::prost_types::Duration>, - /// Gte specifies that this field must be greater than the specified value, - /// inclusive - #[prost(message, optional, tag = "6")] - pub gte: ::core::option::Option<::prost_types::Duration>, - /// In specifies that this field must be equal to one of the specified - /// values - #[prost(message, repeated, tag = "7")] - pub r#in: ::prost::alloc::vec::Vec<::prost_types::Duration>, - /// NotIn specifies that this field cannot be equal to one of the specified - /// values - #[prost(message, repeated, tag = "8")] - pub not_in: ::prost::alloc::vec::Vec<::prost_types::Duration>, -} -/// TimestampRules describe the constraints applied exclusively to the -/// `google.protobuf.Timestamp` well-known type -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimestampRules { - /// Required specifies that this field must be set - #[prost(bool, optional, tag = "1")] - pub required: ::core::option::Option, - /// Const specifies that this field must be exactly the specified value - #[prost(message, optional, tag = "2")] - pub r#const: ::core::option::Option<::prost_types::Timestamp>, - /// Lt specifies that this field must be less than the specified value, - /// exclusive - #[prost(message, optional, tag = "3")] - pub lt: ::core::option::Option<::prost_types::Timestamp>, - /// Lte specifies that this field must be less than the specified value, - /// inclusive - #[prost(message, optional, tag = "4")] - pub lte: ::core::option::Option<::prost_types::Timestamp>, - /// Gt specifies that this field must be greater than the specified value, - /// exclusive - #[prost(message, optional, tag = "5")] - pub gt: ::core::option::Option<::prost_types::Timestamp>, - /// Gte specifies that this field must be greater than the specified value, - /// inclusive - #[prost(message, optional, tag = "6")] - pub gte: ::core::option::Option<::prost_types::Timestamp>, - /// LtNow specifies that this must be less than the current time. LtNow - /// can only be used with the Within rule. - #[prost(bool, optional, tag = "7")] - pub lt_now: ::core::option::Option, - /// GtNow specifies that this must be greater than the current time. GtNow - /// can only be used with the Within rule. - #[prost(bool, optional, tag = "8")] - pub gt_now: ::core::option::Option, - /// Within specifies that this field must be within this duration of the - /// current time. This constraint can be used alone or with the LtNow and - /// GtNow rules. - #[prost(message, optional, tag = "9")] - pub within: ::core::option::Option<::prost_types::Duration>, -} -/// WellKnownRegex contain some well-known patterns. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum KnownRegex { - Unknown = 0, - /// HTTP header name as defined by RFC 7230. - HttpHeaderName = 1, - /// HTTP header value as defined by RFC 7230. - HttpHeaderValue = 2, -} diff --git a/limitador-server/src/envoy_rls/protobufs/xds.annotations.v3.rs b/limitador-server/src/envoy_rls/protobufs/xds.annotations.v3.rs deleted file mode 100644 index a728e81c..00000000 --- a/limitador-server/src/envoy_rls/protobufs/xds.annotations.v3.rs +++ /dev/null @@ -1,40 +0,0 @@ -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FileStatusAnnotation { - /// The entity is work-in-progress and subject to breaking changes. - #[prost(bool, tag = "1")] - pub work_in_progress: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MessageStatusAnnotation { - /// The entity is work-in-progress and subject to breaking changes. - #[prost(bool, tag = "1")] - pub work_in_progress: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FieldStatusAnnotation { - /// The entity is work-in-progress and subject to breaking changes. - #[prost(bool, tag = "1")] - pub work_in_progress: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StatusAnnotation { - /// The entity is work-in-progress and subject to breaking changes. - #[prost(bool, tag = "1")] - pub work_in_progress: bool, - /// The entity belongs to a package with the given version status. - #[prost(enumeration = "PackageVersionStatus", tag = "2")] - pub package_version_status: i32, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum PackageVersionStatus { - /// Unknown package version status. - Unknown = 0, - /// This version of the package is frozen. - Frozen = 1, - /// This version of the package is the active development version. - Active = 2, - /// This version of the package is the candidate for the next major version. It - /// is typically machine generated from the active development version. - NextMajorVersionCandidate = 3, -} diff --git a/limitador-server/src/envoy_rls/protobufs/xds.core.v3.rs b/limitador-server/src/envoy_rls/protobufs/xds.core.v3.rs deleted file mode 100644 index af9bef73..00000000 --- a/limitador-server/src/envoy_rls/protobufs/xds.core.v3.rs +++ /dev/null @@ -1,12 +0,0 @@ -/// Additional parameters that can be used to select resource variants. These include any -/// global context parameters, per-resource type client feature capabilities and per-resource -/// type functional attributes. All per-resource type attributes will be `xds.resource.` -/// prefixed and some of these are documented below: -/// `xds.resource.listening_address`: The value is "IP:port" (e.g. "10.1.1.3:8080") which is -/// the listening address of a Listener. Used in a Listener resource query. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ContextParams { - #[prost(map = "string, string", tag = "1")] - pub params: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, -}