From f70b2fc90a1540cd69ffc6aea39093bb7dcafc67 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Tue, 17 Dec 2024 00:00:00 +0000 Subject: [PATCH] chore(deps): update to http v1 versions (wip) this commit bumps our rust dependencies such that we depend on http's v1 major release. this commit in particular makes the following changes to our dependency graph: * `h2`: 0.3 -> 0.4 * `http`: 0.2 -> 1.2 * `prost`: 0.12 -> 0.13 * `prost-types`: 0.12 -> 0.13 * `tonic`: 0.10 -> 0.12 * `tonic-build`: 0.10 -> 0.12 Signed-off-by: katelyn martin --- Cargo.lock | 84 +++++----- Cargo.toml | 12 +- src/gen/io.linkerd.proxy.destination.rs | 147 +++++++----------- src/gen/io.linkerd.proxy.grpc_route.rs | 4 +- src/gen/io.linkerd.proxy.http_route.rs | 23 +-- src/gen/io.linkerd.proxy.http_types.rs | 29 ++-- src/gen/io.linkerd.proxy.identity.rs | 83 +++++----- src/gen/io.linkerd.proxy.inbound.rs | 128 ++++++--------- src/gen/io.linkerd.proxy.meta.rs | 4 +- src/gen/io.linkerd.proxy.net.rs | 16 +- src/gen/io.linkerd.proxy.opaque_route.rs | 5 +- src/gen/io.linkerd.proxy.outbound.rs | 188 +++++++---------------- src/gen/io.linkerd.proxy.tap.rs | 143 +++++++---------- src/gen/io.linkerd.proxy.tls_route.rs | 4 +- 14 files changed, 345 insertions(+), 525 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6db8795d3..a33b62369 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -36,9 +42,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.5" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -144,15 +150,15 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", "indexmap 2.2.3", "slab", @@ -181,9 +187,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "http" -version = "0.2.12" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -192,12 +198,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", + "futures-util", "http", + "http-body", "pin-project-lite", ] @@ -353,9 +371,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -384,9 +402,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" dependencies = [ "bytes", "prost-derive", @@ -394,11 +412,10 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" dependencies = [ - "bytes", "heck", "itertools", "log", @@ -411,14 +428,13 @@ dependencies = [ "regex", "syn 2.0.87", "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", "itertools", @@ -429,9 +445,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.4" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" dependencies = [ "prost", ] @@ -603,9 +619,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -628,19 +644,19 @@ dependencies = [ [[package]] name = "tonic" -version = "0.10.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-trait", "base64", "bytes", "http", "http-body", + "http-body-util", "percent-encoding", "pin-project", "prost", - "tokio", "tokio-stream", "tower-layer", "tower-service", @@ -649,13 +665,14 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.10.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" dependencies = [ "prettyplease", "proc-macro2", "prost-build", + "prost-types", "quote", "syn 2.0.87", ] @@ -716,17 +733,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "windows-sys" version = "0.42.0" diff --git a/Cargo.toml b/Cargo.toml index d549a2493..b42fa09d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,20 +49,20 @@ rustdoc-args = ["--cfg", "docsrs"] all-features = true [dependencies] -h2 = { version = "0.3", optional = true } -http = { version = "0.2", optional = true } +h2 = { version = "0.4", optional = true } +http = { version = "1.2", optional = true } ipnet = { version = "2", optional = true } -prost = "0.12" -prost-types = { version = "0.12", optional = true } +prost = "0.13" +prost-types = { version = "0.13", optional = true } quickcheck = { version = "1", default-features = false, optional = true } thiserror = { version = "2", optional = true } [dependencies.tonic] -version = "0.10" +version = "0.12" default-features = false features = ["prost"] [dev-dependencies.tonic-build] -version = "0.10" +version = "0.12" default-features = false features = ["prost"] diff --git a/src/gen/io.linkerd.proxy.destination.rs b/src/gen/io.linkerd.proxy.destination.rs index 457285a83..4730cff0c 100644 --- a/src/gen/io.linkerd.proxy.destination.rs +++ b/src/gen/io.linkerd.proxy.destination.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetDestination { #[prost(string, tag = "1")] @@ -14,7 +14,6 @@ pub struct GetDestination { #[prost(string, tag = "3")] pub context_token: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Update { #[prost(oneof = "update::Update", tags = "1, 2, 3")] @@ -22,7 +21,6 @@ pub struct Update { } /// Nested message and enum types in `Update`. pub mod update { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Update { /// A new set of endpoints are available for the service. The set might be @@ -41,13 +39,11 @@ pub mod update { NoEndpoints(super::NoEndpoints), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddrSet { #[prost(message, repeated, tag = "1")] pub addrs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedAddrSet { #[prost(message, repeated, tag = "1")] @@ -58,7 +54,6 @@ pub struct WeightedAddrSet { ::prost::alloc::string::String, >, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedAddr { #[prost(message, optional, tag = "1")] @@ -87,7 +82,6 @@ pub struct WeightedAddr { #[prost(message, optional, tag = "9")] pub resource_ref: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TlsIdentity { /// The server name of the endpoint. This is the value that needs to be included @@ -101,7 +95,6 @@ pub struct TlsIdentity { /// Nested message and enum types in `TlsIdentity`. pub mod tls_identity { /// Verify the certificate based on the Kubernetes pod identity. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DnsLikeIdentity { /// A DNS-like name that encodes workload coordinates. @@ -112,7 +105,6 @@ pub mod tls_identity { pub name: ::prost::alloc::string::String, } /// Verify the certificate based on an URI identity. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UriLikeIdentity { /// A URI name that encodes workload identity. @@ -122,7 +114,6 @@ pub mod tls_identity { #[prost(string, tag = "1")] pub uri: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Strategy { #[prost(message, tag = "1")] @@ -131,22 +122,19 @@ pub mod tls_identity { UriLikeIdentity(UriLikeIdentity), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuthorityOverride { #[prost(string, tag = "1")] pub authority_override: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct NoEndpoints { #[prost(bool, tag = "1")] pub exists: bool, } /// A hint of what protocol the service knows. The default value is /// for the `hint` field to be not be set, essentially meaning "unknown". -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ProtocolHint { /// When set, indicates that the target supports receiving opaque traffic /// wrapped with the Linkerd connection header on the specified port. @@ -157,21 +145,17 @@ pub struct ProtocolHint { } /// Nested message and enum types in `ProtocolHint`. pub mod protocol_hint { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct H2 {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Opaque {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OpaqueTransport { /// The target proxy's inbound port. #[prost(uint32, tag = "1")] pub inbound_port: u32, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Protocol { /// Hints that the service understands HTTP2 and the proxy's internal /// http2-upgrade mechanism. @@ -185,8 +169,7 @@ pub mod protocol_hint { } } /// Configures the parameters used to initialize an HTTP/2 connection. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Http2ClientParams { /// Overrides the default client flow control settings. #[prost(message, optional, tag = "1")] @@ -200,8 +183,7 @@ pub struct Http2ClientParams { } /// Nested message and enum types in `Http2ClientParams`. pub mod http2_client_params { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FlowControl { /// Configures the maximum connection-level flow control window size. #[prost(uint32, tag = "1")] @@ -213,8 +195,7 @@ pub mod http2_client_params { #[prost(bool, tag = "3")] pub adaptive_flow_control: bool, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct KeepAlive { /// The time between pings. #[prost(message, optional, tag = "1")] @@ -227,8 +208,7 @@ pub mod http2_client_params { #[prost(bool, tag = "3")] pub while_idle: bool, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Internals { #[prost(uint32, tag = "1")] pub max_concurrent_reset_streams: u32, @@ -238,7 +218,6 @@ pub mod http2_client_params { pub max_send_buf_size: u32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DestinationProfile { /// The fully-qualified service name, if one exists. @@ -293,7 +272,6 @@ pub struct DestinationProfile { #[prost(message, optional, tag = "8")] pub profile_ref: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Route { /// This route contains requests which match this condition. @@ -320,8 +298,7 @@ pub struct Route { #[prost(message, optional, tag = "5")] pub timeout: ::core::option::Option<::prost_types::Duration>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RetryBudget { /// The ratio of additional traffic that may be added by retries. A /// retry_ratio of 0.1 means that 1 retry may be attempted for every 10 regular @@ -341,7 +318,6 @@ pub struct RetryBudget { #[prost(message, optional, tag = "3")] pub ttl: ::core::option::Option<::prost_types::Duration>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseClass { /// This class contains responses which match this condition. @@ -352,7 +328,6 @@ pub struct ResponseClass { #[prost(bool, tag = "2")] pub is_failure: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestMatch { #[prost(oneof = "request_match::Match", tags = "1, 2, 3, 4, 5")] @@ -360,13 +335,11 @@ pub struct RequestMatch { } /// Nested message and enum types in `RequestMatch`. pub mod request_match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Seq { #[prost(message, repeated, tag = "1")] pub matches: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] @@ -382,14 +355,12 @@ pub mod request_match { Method(super::super::http_types::HttpMethod), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathMatch { /// Match if the request path matches this regex. #[prost(string, tag = "1")] pub regex: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseMatch { #[prost(oneof = "response_match::Match", tags = "1, 2, 3, 4")] @@ -397,13 +368,11 @@ pub struct ResponseMatch { } /// Nested message and enum types in `ResponseMatch`. pub mod response_match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Seq { #[prost(message, repeated, tag = "1")] pub matches: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] @@ -419,8 +388,7 @@ pub mod response_match { } /// If either a minimum or maximum is not specified, the range is considered to /// be over a discrete value. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct HttpStatusRange { /// Minimum matching http status code (inclusive), if specified. #[prost(uint32, tag = "1")] @@ -429,7 +397,6 @@ pub struct HttpStatusRange { #[prost(uint32, tag = "2")] pub max: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedDst { /// This authority will be used as the `path` in a call to the Destination.Get @@ -446,7 +413,13 @@ pub struct WeightedDst { } /// Generated client implementations. pub mod destination_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -457,8 +430,8 @@ pub mod destination_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -483,7 +456,7 @@ pub mod destination_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { DestinationClient::new(InterceptedService::new(inner, interceptor)) } @@ -531,8 +504,7 @@ pub mod destination_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -560,8 +532,7 @@ pub mod destination_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -583,16 +554,22 @@ pub mod destination_client { } /// Generated server implementations. pub mod destination_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with DestinationServer. #[async_trait] - pub trait Destination: Send + Sync + 'static { + pub trait Destination: std::marker::Send + std::marker::Sync + 'static { /// Server streaming response type for the Get method. type GetStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, > - + Send + + std::marker::Send + 'static; /// Given a destination, return all addresses in that destination as a long- /// running stream of updates. @@ -604,7 +581,7 @@ pub mod destination_server { type GetProfileStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, > - + Send + + std::marker::Send + 'static; /// Given a destination, return that destination's profile and send an update /// whenever it changes. @@ -614,20 +591,18 @@ pub mod destination_server { ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct DestinationServer { - inner: _Inner, + pub struct DestinationServer { + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - struct _Inner(Arc); - impl DestinationServer { + impl DestinationServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), @@ -677,8 +652,8 @@ pub mod destination_server { impl tonic::codegen::Service> for DestinationServer where T: Destination, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; @@ -690,7 +665,6 @@ pub mod destination_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/io.linkerd.proxy.destination.Destination/Get" => { #[allow(non_camel_case_types)] @@ -722,7 +696,6 @@ pub mod destination_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = GetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -769,7 +742,6 @@ pub mod destination_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = GetProfileSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -788,20 +760,25 @@ pub mod destination_server { } _ => { Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) }) } } } } - impl Clone for DestinationServer { + impl Clone for DestinationServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -813,17 +790,9 @@ pub mod destination_server { } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for DestinationServer { - const NAME: &'static str = "io.linkerd.proxy.destination.Destination"; + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "io.linkerd.proxy.destination.Destination"; + impl tonic::server::NamedService for DestinationServer { + const NAME: &'static str = SERVICE_NAME; } } diff --git a/src/gen/io.linkerd.proxy.grpc_route.rs b/src/gen/io.linkerd.proxy.grpc_route.rs index 877f81ed4..fc2621164 100644 --- a/src/gen/io.linkerd.proxy.grpc_route.rs +++ b/src/gen/io.linkerd.proxy.grpc_route.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrpcRouteMatch { #[prost(message, optional, tag = "1")] @@ -9,7 +9,6 @@ pub struct GrpcRouteMatch { #[prost(message, repeated, tag = "2")] pub headers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrpcRpcMatch { #[prost(string, tag = "1")] @@ -18,7 +17,6 @@ pub struct GrpcRpcMatch { pub method: ::prost::alloc::string::String, } /// Configures a route to respond with a fixed response. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrpcFailureInjector { /// The status code to use in the `grpc-status` response. Must be specified. diff --git a/src/gen/io.linkerd.proxy.http_route.rs b/src/gen/io.linkerd.proxy.http_route.rs index 30165e72c..6aab04dd4 100644 --- a/src/gen/io.linkerd.proxy.http_route.rs +++ b/src/gen/io.linkerd.proxy.http_route.rs @@ -1,5 +1,5 @@ +// This file is @generated by prost-build. /// Describes how to match an `:authority` or `host` header. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HostMatch { #[prost(oneof = "host_match::Match", tags = "1, 2")] @@ -8,13 +8,11 @@ pub struct HostMatch { /// Nested message and enum types in `HostMatch`. pub mod host_match { /// A match like `*.example.com` is encoded as \[com, example\]. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Suffix { #[prost(string, repeated, tag = "1")] pub reverse_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { /// Match an exact hostname, e.g. www.example.com. @@ -26,7 +24,6 @@ pub mod host_match { } } /// Describes a set of matches, ALL of which must apply. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpRouteMatch { /// Matches requests by path. @@ -47,7 +44,6 @@ pub struct HttpRouteMatch { pub method: ::core::option::Option, } /// Describes how to match a path. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathMatch { #[prost(oneof = "path_match::Kind", tags = "1, 2, 3")] @@ -55,7 +51,6 @@ pub struct PathMatch { } /// Nested message and enum types in `PathMatch`. pub mod path_match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(string, tag = "1")] @@ -67,7 +62,6 @@ pub mod path_match { } } /// Describes how to match a header by name and value. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HeaderMatch { #[prost(string, tag = "1")] @@ -77,7 +71,6 @@ pub struct HeaderMatch { } /// Nested message and enum types in `HeaderMatch`. pub mod header_match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(bytes, tag = "2")] @@ -87,7 +80,6 @@ pub mod header_match { } } /// Describes how to match a query parameter by name and value. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamMatch { #[prost(string, tag = "1")] @@ -97,7 +89,6 @@ pub struct QueryParamMatch { } /// Nested message and enum types in `QueryParamMatch`. pub mod query_param_match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(string, tag = "2")] @@ -110,7 +101,6 @@ pub mod query_param_match { /// /// Modifications are to be applied in the order they are described here: /// additions apply first, then sets, and then removals. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestHeaderModifier { /// A list of headers name-value pairs to set on requests, augmenting any @@ -129,7 +119,6 @@ pub struct RequestHeaderModifier { /// /// Modifications are to be applied in the order they are described here: /// additions apply first, then sets, and then removals. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseHeaderModifier { /// A list of headers name-value pairs to set on responses, augmenting any @@ -146,7 +135,6 @@ pub struct ResponseHeaderModifier { } /// Configures a route to respond with a redirect response. The `location` header /// is set with the given URL parameters. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestRedirect { /// The scheme value to be used in the `location` header. If not specified, @@ -171,7 +159,6 @@ pub struct RequestRedirect { pub status: u32, } /// Describes how a path value may be rewritten in a route. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PathModifier { #[prost(oneof = "path_modifier::Replace", tags = "1, 2")] @@ -179,7 +166,6 @@ pub struct PathModifier { } /// Nested message and enum types in `PathModifier`. pub mod path_modifier { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Replace { /// Indicates that the path should be replaced with the given value. @@ -196,7 +182,6 @@ pub mod path_modifier { } } /// Configures a route to respond with a fixed response. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpFailureInjector { /// The status code to use in the HTTP response. Must be specified. @@ -213,8 +198,7 @@ pub struct HttpFailureInjector { /// A ratio (i.e., of requests) to which an filter should be applied. /// /// Represents fractional values on \[0, 1\]. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Ratio { #[prost(uint32, tag = "1")] pub numerator: u32, @@ -222,8 +206,7 @@ pub struct Ratio { #[prost(uint32, tag = "2")] pub denominator: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Timeouts { /// Limits the the time a stream may be active after all request frames have /// been processed. diff --git a/src/gen/io.linkerd.proxy.http_types.rs b/src/gen/io.linkerd.proxy.http_types.rs index 306098a68..f92789ef4 100644 --- a/src/gen/io.linkerd.proxy.http_types.rs +++ b/src/gen/io.linkerd.proxy.http_types.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpMethod { #[prost(oneof = "http_method::Type", tags = "1, 2")] @@ -36,15 +36,15 @@ pub mod http_method { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Registered::Get => "GET", - Registered::Post => "POST", - Registered::Put => "PUT", - Registered::Delete => "DELETE", - Registered::Patch => "PATCH", - Registered::Options => "OPTIONS", - Registered::Connect => "CONNECT", - Registered::Head => "HEAD", - Registered::Trace => "TRACE", + Self::Get => "GET", + Self::Post => "POST", + Self::Put => "PUT", + Self::Delete => "DELETE", + Self::Patch => "PATCH", + Self::Options => "OPTIONS", + Self::Connect => "CONNECT", + Self::Head => "HEAD", + Self::Trace => "TRACE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -63,7 +63,6 @@ pub mod http_method { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Type { #[prost(enumeration = "Registered", tag = "1")] @@ -72,7 +71,6 @@ pub mod http_method { Unregistered(::prost::alloc::string::String), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Scheme { #[prost(oneof = "scheme::Type", tags = "1, 2")] @@ -103,8 +101,8 @@ pub mod scheme { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Registered::Http => "HTTP", - Registered::Https => "HTTPS", + Self::Http => "HTTP", + Self::Https => "HTTPS", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -116,7 +114,6 @@ pub mod scheme { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Type { #[prost(enumeration = "Registered", tag = "1")] @@ -125,7 +122,6 @@ pub mod scheme { Unregistered(::prost::alloc::string::String), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Headers { #[prost(message, repeated, tag = "1")] @@ -133,7 +129,6 @@ pub struct Headers { } /// Nested message and enum types in `Headers`. pub mod headers { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { #[prost(string, tag = "1")] diff --git a/src/gen/io.linkerd.proxy.identity.rs b/src/gen/io.linkerd.proxy.identity.rs index 091122e39..6c5222702 100644 --- a/src/gen/io.linkerd.proxy.identity.rs +++ b/src/gen/io.linkerd.proxy.identity.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CertifyRequest { #[prost(string, tag = "1")] @@ -13,7 +13,6 @@ pub struct CertifyRequest { #[prost(bytes = "vec", tag = "3")] pub certificate_signing_request: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CertifyResponse { /// A PEM-encoded x509 Certificate. @@ -30,7 +29,13 @@ pub struct CertifyResponse { } /// Generated client implementations. pub mod identity_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -41,8 +46,8 @@ pub mod identity_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -67,7 +72,7 @@ pub mod identity_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { IdentityClient::new(InterceptedService::new(inner, interceptor)) } @@ -120,8 +125,7 @@ pub mod identity_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -140,11 +144,17 @@ pub mod identity_client { } /// Generated server implementations. pub mod identity_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with IdentityServer. #[async_trait] - pub trait Identity: Send + Sync + 'static { + pub trait Identity: std::marker::Send + std::marker::Sync + 'static { /// Requests that a time-bounded certificate be signed. /// /// The requester must provide a token that verifies the client's identity and @@ -158,20 +168,18 @@ pub mod identity_server { ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct IdentityServer { - inner: _Inner, + pub struct IdentityServer { + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - struct _Inner(Arc); - impl IdentityServer { + impl IdentityServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), @@ -221,8 +229,8 @@ pub mod identity_server { impl tonic::codegen::Service> for IdentityServer where T: Identity, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; @@ -234,7 +242,6 @@ pub mod identity_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/io.linkerd.proxy.identity.Identity/Certify" => { #[allow(non_camel_case_types)] @@ -263,7 +270,6 @@ pub mod identity_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = CertifySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -282,20 +288,25 @@ pub mod identity_server { } _ => { Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) }) } } } } - impl Clone for IdentityServer { + impl Clone for IdentityServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -307,17 +318,9 @@ pub mod identity_server { } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for IdentityServer { - const NAME: &'static str = "io.linkerd.proxy.identity.Identity"; + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "io.linkerd.proxy.identity.Identity"; + impl tonic::server::NamedService for IdentityServer { + const NAME: &'static str = SERVICE_NAME; } } diff --git a/src/gen/io.linkerd.proxy.inbound.rs b/src/gen/io.linkerd.proxy.inbound.rs index 57370a88d..1214ab824 100644 --- a/src/gen/io.linkerd.proxy.inbound.rs +++ b/src/gen/io.linkerd.proxy.inbound.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PortSpec { /// Identifies a proxy workload (e.g., pod name). @@ -8,7 +8,6 @@ pub struct PortSpec { #[prost(uint32, tag = "2")] pub port: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Server { /// If set, indicates how the proxy should proxy connections on the specified @@ -34,7 +33,6 @@ pub struct Server { ::prost::alloc::string::String, >, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProxyProtocol { #[prost(oneof = "proxy_protocol::Kind", tags = "1, 2, 3, 4, 5, 6")] @@ -42,7 +40,6 @@ pub struct ProxyProtocol { } /// Nested message and enum types in `ProxyProtocol`. pub mod proxy_protocol { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Detect { #[prost(message, optional, tag = "1")] @@ -55,7 +52,6 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "4")] pub http_local_rate_limit: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http1 { #[prost(message, repeated, tag = "2")] @@ -63,7 +59,6 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "3")] pub local_rate_limit: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http2 { #[prost(message, repeated, tag = "2")] @@ -71,20 +66,16 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "3")] pub local_rate_limit: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Grpc { #[prost(message, repeated, tag = "2")] pub routes: ::prost::alloc::vec::Vec, } /// TODO: opaque TLS settings (versions, algorithms, SNI) - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Opaque {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Tls {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -101,7 +92,6 @@ pub mod proxy_protocol { Grpc(Grpc), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Authz { /// Limits this authorization to client addresses in the provided networks. @@ -133,7 +123,6 @@ pub struct Authz { pub metadata: ::core::option::Option, } /// Describes a network of authorized clients. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Network { #[prost(message, optional, tag = "1")] @@ -141,7 +130,6 @@ pub struct Network { #[prost(message, repeated, tag = "2")] pub except: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Authn { #[prost(oneof = "authn::Permit", tags = "1, 2")] @@ -149,10 +137,8 @@ pub struct Authn { } /// Nested message and enum types in `Authn`. pub mod authn { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PermitUnauthenticated {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PermitMeshTls { #[prost(oneof = "permit_mesh_tls::Clients", tags = "1, 2")] @@ -160,7 +146,6 @@ pub mod authn { } /// Nested message and enum types in `PermitMeshTLS`. pub mod permit_mesh_tls { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PermitClientIdentities { /// A list of literal identities. @@ -172,7 +157,6 @@ pub mod authn { #[prost(message, repeated, tag = "2")] pub suffixes: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Clients { /// Indicates that client identities are not required. @@ -184,7 +168,6 @@ pub mod authn { Identities(PermitClientIdentities), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Permit { #[prost(message, tag = "1")] @@ -194,7 +177,6 @@ pub mod authn { MeshTls(PermitMeshTls), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Identity { #[prost(string, tag = "1")] @@ -204,7 +186,6 @@ pub struct Identity { /// /// An empty list is equivalent to `.` (matching all names); the list `["foo", /// "bar"]` is equivalent to "foo.bar." (matching `*.foo.bar`), etc. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentitySuffix { #[prost(string, repeated, tag = "1")] @@ -212,7 +193,6 @@ pub struct IdentitySuffix { } /// Inbound-specific HTTP route configuration (based on the /// [Gateway API]()). -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpRoute { #[prost(message, optional, tag = "1")] @@ -230,7 +210,6 @@ pub struct HttpRoute { } /// Nested message and enum types in `HttpRoute`. pub mod http_route { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Rule { #[prost(message, repeated, tag = "1")] @@ -238,7 +217,6 @@ pub mod http_route { #[prost(message, repeated, tag = "2")] pub filters: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2, 3")] @@ -246,7 +224,6 @@ pub mod http_route { } /// Nested message and enum types in `Filter`. pub mod filter { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -261,7 +238,6 @@ pub mod http_route { } } /// Inbound-specific gRPC route configuration. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrpcRoute { #[prost(message, optional, tag = "1")] @@ -279,7 +255,6 @@ pub struct GrpcRoute { } /// Nested message and enum types in `GrpcRoute`. pub mod grpc_route { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Rule { #[prost(message, repeated, tag = "1")] @@ -287,7 +262,6 @@ pub mod grpc_route { #[prost(message, repeated, tag = "2")] pub filters: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2")] @@ -295,7 +269,6 @@ pub mod grpc_route { } /// Nested message and enum types in `Filter`. pub mod filter { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -307,7 +280,6 @@ pub mod grpc_route { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpLocalRateLimit { /// Describes the associated HTTPLocalRateLimitPolicy resource @@ -327,7 +299,6 @@ pub struct HttpLocalRateLimit { } /// Nested message and enum types in `HttpLocalRateLimit`. pub mod http_local_rate_limit { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Override { #[prost(message, optional, tag = "1")] @@ -337,7 +308,6 @@ pub mod http_local_rate_limit { } /// Nested message and enum types in `Override`. pub mod r#override { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientIdentities { /// A list of literal identities. @@ -345,8 +315,7 @@ pub mod http_local_rate_limit { pub identities: ::prost::alloc::vec::Vec, } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Limit { #[prost(uint32, tag = "1")] pub requests_per_second: u32, @@ -354,7 +323,13 @@ pub mod http_local_rate_limit { } /// Generated client implementations. pub mod inbound_server_policies_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// / An API exposed to the linkerd2-proxy to configure the inbound proxy with per-port configuration @@ -372,8 +347,8 @@ pub mod inbound_server_policies_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -398,7 +373,7 @@ pub mod inbound_server_policies_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { InboundServerPoliciesClient::new(InterceptedService::new(inner, interceptor)) } @@ -442,8 +417,7 @@ pub mod inbound_server_policies_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -473,8 +447,7 @@ pub mod inbound_server_policies_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -496,11 +469,17 @@ pub mod inbound_server_policies_client { } /// Generated server implementations. pub mod inbound_server_policies_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with InboundServerPoliciesServer. #[async_trait] - pub trait InboundServerPolicies: Send + Sync + 'static { + pub trait InboundServerPolicies: std::marker::Send + std::marker::Sync + 'static { /// / Gets the inbound server policy for a given workload port. async fn get_port( &self, @@ -510,7 +489,7 @@ pub mod inbound_server_policies_server { type WatchPortStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, > - + Send + + std::marker::Send + 'static; /// / Watches the inbound server policy for a given workload port. async fn watch_port( @@ -526,20 +505,18 @@ pub mod inbound_server_policies_server { /// / The unary `GetPort` endpoint is exposed as a convenience for clients to query policies for /// / diagnostic purposes. #[derive(Debug)] - pub struct InboundServerPoliciesServer { - inner: _Inner, + pub struct InboundServerPoliciesServer { + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - struct _Inner(Arc); - impl InboundServerPoliciesServer { + impl InboundServerPoliciesServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), @@ -590,8 +567,8 @@ pub mod inbound_server_policies_server { for InboundServerPoliciesServer where T: InboundServerPolicies, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; @@ -603,7 +580,6 @@ pub mod inbound_server_policies_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/io.linkerd.proxy.inbound.InboundServerPolicies/GetPort" => { #[allow(non_camel_case_types)] @@ -634,7 +610,6 @@ pub mod inbound_server_policies_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = GetPortSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -682,7 +657,6 @@ pub mod inbound_server_policies_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WatchPortSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -701,20 +675,25 @@ pub mod inbound_server_policies_server { } _ => { Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) }) } } } } - impl Clone for InboundServerPoliciesServer { + impl Clone for InboundServerPoliciesServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -726,18 +705,9 @@ pub mod inbound_server_policies_server { } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService - for InboundServerPoliciesServer { - const NAME: &'static str = "io.linkerd.proxy.inbound.InboundServerPolicies"; + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "io.linkerd.proxy.inbound.InboundServerPolicies"; + impl tonic::server::NamedService for InboundServerPoliciesServer { + const NAME: &'static str = SERVICE_NAME; } } diff --git a/src/gen/io.linkerd.proxy.meta.rs b/src/gen/io.linkerd.proxy.meta.rs index c38c3fecd..598715bff 100644 --- a/src/gen/io.linkerd.proxy.meta.rs +++ b/src/gen/io.linkerd.proxy.meta.rs @@ -1,6 +1,6 @@ +// This file is @generated by prost-build. /// General metadata about a configuration object. Typically references either an /// implicit default configuration or a Kubernetes resource. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { #[prost(oneof = "metadata::Kind", tags = "1, 2")] @@ -8,7 +8,6 @@ pub struct Metadata { } /// Nested message and enum types in `Metadata`. pub mod metadata { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { /// A name describing a default/implicit configuration. @@ -23,7 +22,6 @@ pub mod metadata { } } /// References a (e.g., Kubernetes) resource. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Resource { #[prost(string, tag = "1")] diff --git a/src/gen/io.linkerd.proxy.net.rs b/src/gen/io.linkerd.proxy.net.rs index 829820a2e..a54c4d445 100644 --- a/src/gen/io.linkerd.proxy.net.rs +++ b/src/gen/io.linkerd.proxy.net.rs @@ -1,13 +1,12 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct IpAddress { #[prost(oneof = "ip_address::Ip", tags = "1, 2")] pub ip: ::core::option::Option, } /// Nested message and enum types in `IPAddress`. pub mod ip_address { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Ip { #[prost(fixed32, tag = "1")] Ipv4(u32), @@ -15,16 +14,14 @@ pub mod ip_address { Ipv6(super::IPv6), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct IpNetwork { #[prost(message, optional, tag = "1")] pub ip: ::core::option::Option, #[prost(uint32, tag = "2")] pub prefix_len: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct IPv6 { /// hextets 1-4 #[prost(fixed64, tag = "1")] @@ -33,8 +30,7 @@ pub struct IPv6 { #[prost(fixed64, tag = "2")] pub last: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TcpAddress { #[prost(message, optional, tag = "1")] pub ip: ::core::option::Option, diff --git a/src/gen/io.linkerd.proxy.opaque_route.rs b/src/gen/io.linkerd.proxy.opaque_route.rs index 12c4a7471..a933ad388 100644 --- a/src/gen/io.linkerd.proxy.opaque_route.rs +++ b/src/gen/io.linkerd.proxy.opaque_route.rs @@ -1,11 +1,10 @@ +// This file is @generated by prost-build. /// Used to indicate that the policy is invalid. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Invalid { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } /// Used to indicate that traffic is forbidden. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Forbidden {} diff --git a/src/gen/io.linkerd.proxy.outbound.rs b/src/gen/io.linkerd.proxy.outbound.rs index 9fc9d74c3..9e2a0dd7d 100644 --- a/src/gen/io.linkerd.proxy.outbound.rs +++ b/src/gen/io.linkerd.proxy.outbound.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TrafficSpec { /// Uniquely identifies the source proxy workload (e.g., pod name) to the @@ -12,7 +12,6 @@ pub struct TrafficSpec { /// Nested message and enum types in `TrafficSpec`. pub mod traffic_spec { /// Describes a target address, as observed by the proxy. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Target { /// Indicates the proxy is connecting to a specific IP:port. @@ -25,7 +24,6 @@ pub mod traffic_spec { } } /// Outbound policy for a given traffic spec. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutboundPolicy { /// Indicates the protocol to use for this target. This will be set to Opaque @@ -36,7 +34,6 @@ pub struct OutboundPolicy { #[prost(message, optional, tag = "2")] pub metadata: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProxyProtocol { #[prost(oneof = "proxy_protocol::Kind", tags = "1, 2, 3, 4, 5, 6")] @@ -44,7 +41,6 @@ pub struct ProxyProtocol { } /// Nested message and enum types in `ProxyProtocol`. pub mod proxy_protocol { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Detect { /// Protocol detection timeout. @@ -59,13 +55,11 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "4")] pub http2: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Opaque { #[prost(message, repeated, tag = "1")] pub routes: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http1 { #[prost(message, repeated, tag = "1")] @@ -74,7 +68,6 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "2")] pub failure_accrual: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http2 { #[prost(message, repeated, tag = "1")] @@ -83,7 +76,6 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "2")] pub failure_accrual: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Grpc { #[prost(message, repeated, tag = "1")] @@ -92,13 +84,11 @@ pub mod proxy_protocol { #[prost(message, optional, tag = "2")] pub failure_accrual: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tls { #[prost(message, repeated, tag = "1")] pub routes: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -121,7 +111,6 @@ pub mod proxy_protocol { } /// Outbound-specific HTTP route configuration (based on the /// [Gateway API]()). -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpRoute { #[prost(message, optional, tag = "1")] @@ -135,7 +124,6 @@ pub struct HttpRoute { } /// Nested message and enum types in `HttpRoute`. pub mod http_route { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Rule { #[prost(message, repeated, tag = "1")] @@ -158,7 +146,6 @@ pub mod http_route { #[prost(bool, tag = "7")] pub allow_l5d_request_headers: bool, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2, 3, 4")] @@ -166,7 +153,6 @@ pub mod http_route { } /// Nested message and enum types in `Filter`. pub mod filter { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -183,7 +169,6 @@ pub mod http_route { ), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Distribution { #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")] @@ -191,22 +176,18 @@ pub mod http_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Empty {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RandomAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -218,7 +199,6 @@ pub mod http_route { RandomAvailable(RandomAvailable), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Retry { #[prost(uint32, tag = "1")] @@ -236,7 +216,6 @@ pub mod http_route { /// Nested message and enum types in `Retry`. pub mod retry { /// Retryable conditions. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Conditions { /// Specifies the status code ranges that should trigger a retry. @@ -245,8 +224,7 @@ pub mod http_route { } /// Nested message and enum types in `Conditions`. pub mod conditions { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct StatusRange { #[prost(uint32, tag = "1")] pub start: u32, @@ -255,7 +233,6 @@ pub mod http_route { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RouteBackend { #[prost(message, optional, tag = "1")] @@ -267,7 +244,6 @@ pub mod http_route { #[prost(message, optional, tag = "4")] pub request_timeout: ::core::option::Option<::prost_types::Duration>, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedRouteBackend { #[prost(message, optional, tag = "1")] @@ -276,7 +252,6 @@ pub mod http_route { pub weight: u32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrpcRoute { #[prost(message, optional, tag = "1")] @@ -290,7 +265,6 @@ pub struct GrpcRoute { } /// Nested message and enum types in `GrpcRoute`. pub mod grpc_route { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Rule { #[prost(message, repeated, tag = "1")] @@ -313,7 +287,6 @@ pub mod grpc_route { #[prost(bool, tag = "7")] pub allow_l5d_request_headers: bool, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2")] @@ -321,7 +294,6 @@ pub mod grpc_route { } /// Nested message and enum types in `Filter`. pub mod filter { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -332,7 +304,6 @@ pub mod grpc_route { ), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Distribution { #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")] @@ -340,22 +311,18 @@ pub mod grpc_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Empty {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RandomAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -367,8 +334,7 @@ pub mod grpc_route { RandomAvailable(RandomAvailable), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Retry { #[prost(uint32, tag = "1")] pub max_retries: u32, @@ -385,8 +351,7 @@ pub mod grpc_route { /// Nested message and enum types in `Retry`. pub mod retry { /// Retryable gRPC status codes. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Conditions { #[prost(bool, tag = "1")] pub cancelled: bool, @@ -400,7 +365,6 @@ pub mod grpc_route { pub unavailable: bool, } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RouteBackend { #[prost(message, optional, tag = "1")] @@ -412,7 +376,6 @@ pub mod grpc_route { #[prost(message, optional, tag = "4")] pub request_timeout: ::core::option::Option<::prost_types::Duration>, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedRouteBackend { #[prost(message, optional, tag = "1")] @@ -421,7 +384,6 @@ pub mod grpc_route { pub weight: u32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OpaqueRoute { #[prost(message, optional, tag = "1")] @@ -432,7 +394,6 @@ pub struct OpaqueRoute { } /// Nested message and enum types in `OpaqueRoute`. pub mod opaque_route { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Rule { #[prost(message, optional, tag = "1")] @@ -440,7 +401,6 @@ pub mod opaque_route { #[prost(message, repeated, tag = "2")] pub filters: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2")] @@ -448,7 +408,6 @@ pub mod opaque_route { } /// Nested message and enum types in `Filter`. pub mod filter { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -457,7 +416,6 @@ pub mod opaque_route { Forbidden(super::super::super::opaque_route::Forbidden), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Distribution { #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")] @@ -465,22 +423,18 @@ pub mod opaque_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Empty {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RandomAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -492,7 +446,6 @@ pub mod opaque_route { RandomAvailable(RandomAvailable), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RouteBackend { #[prost(message, optional, tag = "1")] @@ -500,7 +453,6 @@ pub mod opaque_route { #[prost(message, repeated, tag = "3")] pub filters: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedRouteBackend { #[prost(message, optional, tag = "1")] @@ -509,7 +461,6 @@ pub mod opaque_route { pub weight: u32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TlsRoute { #[prost(message, optional, tag = "1")] @@ -523,7 +474,6 @@ pub struct TlsRoute { } /// Nested message and enum types in `TlsRoute`. pub mod tls_route { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Rule { #[prost(message, optional, tag = "1")] @@ -531,7 +481,6 @@ pub mod tls_route { #[prost(message, repeated, tag = "2")] pub filters: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2")] @@ -539,7 +488,6 @@ pub mod tls_route { } /// Nested message and enum types in `Filter`. pub mod filter { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -548,7 +496,6 @@ pub mod tls_route { Forbidden(super::super::super::opaque_route::Forbidden), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Distribution { #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")] @@ -556,22 +503,18 @@ pub mod tls_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Empty {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RandomAvailable { #[prost(message, repeated, tag = "1")] pub backends: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] @@ -583,7 +526,6 @@ pub mod tls_route { RandomAvailable(RandomAvailable), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RouteBackend { #[prost(message, optional, tag = "1")] @@ -591,7 +533,6 @@ pub mod tls_route { #[prost(message, repeated, tag = "3")] pub filters: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedRouteBackend { #[prost(message, optional, tag = "1")] @@ -600,7 +541,6 @@ pub mod tls_route { pub weight: u32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Backend { #[prost(message, optional, tag = "1")] @@ -614,7 +554,6 @@ pub struct Backend { /// Nested message and enum types in `Backend`. pub mod backend { /// A strategy for discovering endpoints for a service. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EndpointDiscovery { #[prost(oneof = "endpoint_discovery::Kind", tags = "1")] @@ -622,13 +561,11 @@ pub mod backend { } /// Nested message and enum types in `EndpointDiscovery`. pub mod endpoint_discovery { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DestinationGet { #[prost(string, tag = "1")] pub path: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { /// Use the `Destination` service to discover endpoints for this service. @@ -638,7 +575,6 @@ pub mod backend { } /// Describes a power-of-two-choices (P2C) load balancer configuration for a /// backend. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BalanceP2c { #[prost(message, optional, tag = "1")] @@ -650,8 +586,7 @@ pub mod backend { /// Nested message and enum types in `BalanceP2c`. pub mod balance_p2c { /// Parameters configuring peak EWMA load estimation. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PeakEwma { /// Initial latency value used when no latencies have been /// recorded for an endpoint. @@ -662,8 +597,7 @@ pub mod backend { pub decay: ::core::option::Option<::prost_types::Duration>, } /// The load estimation strategy used by this load balancer. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Load { /// This load balancer uses peak EWMA (exponentially weighted moving /// average) load estimates. @@ -671,7 +605,6 @@ pub mod backend { PeakEwma(PeakEwma), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { /// A backend that consists of a single endpoint. @@ -682,8 +615,7 @@ pub mod backend { Balancer(BalanceP2c), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Queue { /// The number of requests that may be held in a queue before backpressure is /// exerted. @@ -694,31 +626,27 @@ pub struct Queue { #[prost(message, optional, tag = "2")] pub failfast_timeout: ::core::option::Option<::prost_types::Duration>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FailureAccrual { #[prost(oneof = "failure_accrual::Kind", tags = "1")] pub kind: ::core::option::Option, } /// Nested message and enum types in `FailureAccrual`. pub mod failure_accrual { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ConsecutiveFailures { #[prost(uint32, tag = "1")] pub max_failures: u32, #[prost(message, optional, tag = "2")] pub backoff: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] ConsecutiveFailures(ConsecutiveFailures), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ExponentialBackoff { /// The minimum amount of time to wait before resuming an operation. #[prost(message, optional, tag = "1")] @@ -734,7 +662,13 @@ pub struct ExponentialBackoff { } /// Generated client implementations. pub mod outbound_policies_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -745,8 +679,8 @@ pub mod outbound_policies_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -771,7 +705,7 @@ pub mod outbound_policies_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { OutboundPoliciesClient::new(InterceptedService::new(inner, interceptor)) } @@ -814,8 +748,7 @@ pub mod outbound_policies_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -841,8 +774,7 @@ pub mod outbound_policies_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -864,11 +796,17 @@ pub mod outbound_policies_client { } /// Generated server implementations. pub mod outbound_policies_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with OutboundPoliciesServer. #[async_trait] - pub trait OutboundPolicies: Send + Sync + 'static { + pub trait OutboundPolicies: std::marker::Send + std::marker::Sync + 'static { async fn get( &self, request: tonic::Request, @@ -877,7 +815,7 @@ pub mod outbound_policies_server { type WatchStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, > - + Send + + std::marker::Send + 'static; async fn watch( &self, @@ -885,20 +823,18 @@ pub mod outbound_policies_server { ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct OutboundPoliciesServer { - inner: _Inner, + pub struct OutboundPoliciesServer { + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - struct _Inner(Arc); - impl OutboundPoliciesServer { + impl OutboundPoliciesServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), @@ -948,8 +884,8 @@ pub mod outbound_policies_server { impl tonic::codegen::Service> for OutboundPoliciesServer where T: OutboundPolicies, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; @@ -961,7 +897,6 @@ pub mod outbound_policies_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/io.linkerd.proxy.outbound.OutboundPolicies/Get" => { #[allow(non_camel_case_types)] @@ -991,7 +926,6 @@ pub mod outbound_policies_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = GetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1038,7 +972,6 @@ pub mod outbound_policies_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = WatchSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1057,20 +990,25 @@ pub mod outbound_policies_server { } _ => { Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) }) } } } } - impl Clone for OutboundPoliciesServer { + impl Clone for OutboundPoliciesServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1082,17 +1020,9 @@ pub mod outbound_policies_server { } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for OutboundPoliciesServer { - const NAME: &'static str = "io.linkerd.proxy.outbound.OutboundPolicies"; + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "io.linkerd.proxy.outbound.OutboundPolicies"; + impl tonic::server::NamedService for OutboundPoliciesServer { + const NAME: &'static str = SERVICE_NAME; } } diff --git a/src/gen/io.linkerd.proxy.tap.rs b/src/gen/io.linkerd.proxy.tap.rs index 3e40715d4..3141102a9 100644 --- a/src/gen/io.linkerd.proxy.tap.rs +++ b/src/gen/io.linkerd.proxy.tap.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ObserveRequest { /// Limits the number of event keys that will be returned by this tap. @@ -14,7 +14,6 @@ pub struct ObserveRequest { } /// Nested message and enum types in `ObserveRequest`. pub mod observe_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Match { #[prost(oneof = "r#match::Match", tags = "1, 2, 3, 4, 5, 6, 7, 8")] @@ -22,13 +21,11 @@ pub mod observe_request { } /// Nested message and enum types in `Match`. pub mod r#match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Seq { #[prost(message, repeated, tag = "1")] pub matches: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Label { #[prost(string, tag = "1")] @@ -36,16 +33,14 @@ pub mod observe_request { #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Tcp { #[prost(oneof = "tcp::Match", tags = "1, 3")] pub r#match: ::core::option::Option, } /// Nested message and enum types in `Tcp`. pub mod tcp { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Netmask { #[prost(message, optional, tag = "1")] pub ip: ::core::option::Option< @@ -56,8 +51,7 @@ pub mod observe_request { } /// If either a minimum or maximum is not specified, the range is /// considered to be over a discrete value. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PortRange { /// Minimum matching port value (inclusive), if specified. #[prost(uint32, tag = "1")] @@ -66,8 +60,7 @@ pub mod observe_request { #[prost(uint32, tag = "2")] pub max: u32, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] Netmask(Netmask), @@ -75,7 +68,6 @@ pub mod observe_request { Ports(PortRange), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http { #[prost(oneof = "http::Match", tags = "1, 3, 2, 4")] @@ -83,7 +75,6 @@ pub mod observe_request { } /// Nested message and enum types in `Http`. pub mod http { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StringMatch { #[prost(oneof = "string_match::Match", tags = "1, 2")] @@ -91,7 +82,6 @@ pub mod observe_request { } /// Nested message and enum types in `StringMatch`. pub mod string_match { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(string, tag = "1")] @@ -100,7 +90,6 @@ pub mod observe_request { Prefix(::prost::alloc::string::String), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] @@ -114,7 +103,6 @@ pub mod observe_request { Path(StringMatch), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] @@ -135,50 +123,43 @@ pub mod observe_request { RouteLabel(Label), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Extract { #[prost(oneof = "extract::Extract", tags = "1")] pub extract: ::core::option::Option, } /// Nested message and enum types in `Extract`. pub mod extract { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Http { #[prost(oneof = "http::Extract", tags = "1")] pub extract: ::core::option::Option, } /// Nested message and enum types in `Http`. pub mod http { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Headers {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Extract { #[prost(message, tag = "1")] Headers(Headers), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Extract { #[prost(message, tag = "1")] Http(Http), } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Eos { #[prost(oneof = "eos::End", tags = "1, 2")] pub end: ::core::option::Option, } /// Nested message and enum types in `Eos`. pub mod eos { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum End { #[prost(uint32, tag = "1")] GrpcStatusCode(u32), @@ -186,7 +167,6 @@ pub mod eos { ResetErrorCode(u32), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TapEvent { #[prost(message, optional, tag = "1")] @@ -206,7 +186,6 @@ pub struct TapEvent { } /// Nested message and enum types in `TapEvent`. pub mod tap_event { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EndpointMeta { #[prost(map = "string, string", tag = "1")] @@ -215,7 +194,6 @@ pub mod tap_event { ::prost::alloc::string::String, >, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RouteMeta { #[prost(map = "string, string", tag = "1")] @@ -224,7 +202,6 @@ pub mod tap_event { ::prost::alloc::string::String, >, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http { #[prost(oneof = "http::Event", tags = "1, 2, 3")] @@ -232,8 +209,7 @@ pub mod tap_event { } /// Nested message and enum types in `Http`. pub mod http { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct StreamId { /// A randomized base (stable across a process's runtime) #[prost(uint32, tag = "1")] @@ -242,7 +218,6 @@ pub mod tap_event { #[prost(uint64, tag = "2")] pub stream: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInit { #[prost(message, optional, tag = "1")] @@ -262,7 +237,6 @@ pub mod tap_event { super::super::super::http_types::Headers, >, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseInit { #[prost(message, optional, tag = "1")] @@ -276,7 +250,6 @@ pub mod tap_event { super::super::super::http_types::Headers, >, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseEnd { #[prost(message, optional, tag = "1")] @@ -294,7 +267,6 @@ pub mod tap_event { super::super::super::http_types::Headers, >, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { #[prost(message, tag = "1")] @@ -329,9 +301,9 @@ pub mod tap_event { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ProxyDirection::Unknown => "UNKNOWN", - ProxyDirection::Inbound => "INBOUND", - ProxyDirection::Outbound => "OUTBOUND", + Self::Unknown => "UNKNOWN", + Self::Inbound => "INBOUND", + Self::Outbound => "OUTBOUND", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -344,7 +316,6 @@ pub mod tap_event { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { #[prost(message, tag = "3")] @@ -353,7 +324,13 @@ pub mod tap_event { } /// Generated client implementations. pub mod tap_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// A service exposed by proxy instances to setup @@ -365,8 +342,8 @@ pub mod tap_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -391,7 +368,7 @@ pub mod tap_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { TapClient::new(InterceptedService::new(inner, interceptor)) } @@ -437,8 +414,7 @@ pub mod tap_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -455,16 +431,22 @@ pub mod tap_client { } /// Generated server implementations. pub mod tap_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with TapServer. #[async_trait] - pub trait Tap: Send + Sync + 'static { + pub trait Tap: std::marker::Send + std::marker::Sync + 'static { /// Server streaming response type for the Observe method. type ObserveStream: tonic::codegen::tokio_stream::Stream< Item = std::result::Result, > - + Send + + std::marker::Send + 'static; async fn observe( &self, @@ -473,20 +455,18 @@ pub mod tap_server { } /// A service exposed by proxy instances to setup #[derive(Debug)] - pub struct TapServer { - inner: _Inner, + pub struct TapServer { + inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - struct _Inner(Arc); - impl TapServer { + impl TapServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), @@ -536,8 +516,8 @@ pub mod tap_server { impl tonic::codegen::Service> for TapServer where T: Tap, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, + B: Body + std::marker::Send + 'static, + B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; @@ -549,7 +529,6 @@ pub mod tap_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); match req.uri().path() { "/io.linkerd.proxy.tap.Tap/Observe" => { #[allow(non_camel_case_types)] @@ -581,7 +560,6 @@ pub mod tap_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let inner = inner.0; let method = ObserveSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -600,20 +578,25 @@ pub mod tap_server { } _ => { Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) + let mut response = http::Response::new(empty_body()); + let headers = response.headers_mut(); + headers + .insert( + tonic::Status::GRPC_STATUS, + (tonic::Code::Unimplemented as i32).into(), + ); + headers + .insert( + http::header::CONTENT_TYPE, + tonic::metadata::GRPC_CONTENT_TYPE, + ); + Ok(response) }) } } } } - impl Clone for TapServer { + impl Clone for TapServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -625,17 +608,9 @@ pub mod tap_server { } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for TapServer { - const NAME: &'static str = "io.linkerd.proxy.tap.Tap"; + /// Generated gRPC service name + pub const SERVICE_NAME: &str = "io.linkerd.proxy.tap.Tap"; + impl tonic::server::NamedService for TapServer { + const NAME: &'static str = SERVICE_NAME; } } diff --git a/src/gen/io.linkerd.proxy.tls_route.rs b/src/gen/io.linkerd.proxy.tls_route.rs index 28e005b0d..89e72ef5c 100644 --- a/src/gen/io.linkerd.proxy.tls_route.rs +++ b/src/gen/io.linkerd.proxy.tls_route.rs @@ -1,5 +1,5 @@ +// This file is @generated by prost-build. /// Describes how to match an `SNI` ClientHello extension. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SniMatch { #[prost(oneof = "sni_match::Match", tags = "1, 2")] @@ -8,13 +8,11 @@ pub struct SniMatch { /// Nested message and enum types in `SniMatch`. pub mod sni_match { /// A match like `*.example.com` is encoded as \[com, example\]. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Suffix { #[prost(string, repeated, tag = "1")] pub reverse_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { /// Match an exact SNI, e.g. www.example.com.