diff --git a/Cargo.lock b/Cargo.lock index 791ff2bb0..86c9f03ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,11 +82,17 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" + [[package]] name = "bytes" -version = "1.4.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" @@ -146,6 +152,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + [[package]] name = "futures-core" version = "0.3.31" @@ -264,6 +279,68 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "libc", + "pin-project-lite", + "socket2 0.6.0", + "tokio", + "tower-service", + "tracing", +] + [[package]] name = "indexmap" version = "1.9.2" @@ -326,9 +403,9 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" [[package]] name = "linkerd2-proxy-api" @@ -342,7 +419,8 @@ dependencies = [ "quickcheck", "thiserror", "tonic", - "tonic-build", + "tonic-prost", + "tonic-prost-build", ] [[package]] @@ -375,6 +453,17 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.59.0", +] + [[package]] name = "multimap" version = "0.8.3" @@ -465,9 +554,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" dependencies = [ "bytes", "prost-derive", @@ -475,9 +564,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" +checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1" dependencies = [ "heck", "itertools", @@ -488,6 +577,8 @@ dependencies = [ "prettyplease", "prost", "prost-types", + "pulldown-cmark", + "pulldown-cmark-to-cmark", "regex", "syn 2.0.87", "tempfile", @@ -495,9 +586,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" dependencies = [ "anyhow", "itertools", @@ -508,13 +599,33 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" dependencies = [ "prost", ] +[[package]] +name = "pulldown-cmark" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" +dependencies = [ + "bitflags 2.9.4", + "memchr", + "unicase", +] + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5b6a0769a491a08b31ea5c62494a8f144ee0987d86d670a8af4df1e1b7cde75" +dependencies = [ + "pulldown-cmark", +] + [[package]] name = "quickcheck" version = "1.0.3" @@ -557,7 +668,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -601,7 +712,7 @@ version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -624,6 +735,32 @@ dependencies = [ "autocfg", ] +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "syn" version = "1.0.109" @@ -646,6 +783,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + [[package]] name = "tempfile" version = "3.4.0" @@ -687,7 +830,11 @@ checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", + "libc", + "mio", "pin-project-lite", + "socket2 0.5.10", + "windows-sys 0.52.0", ] [[package]] @@ -717,9 +864,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.13.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9" +checksum = "eb7613188ce9f7df5bfe185db26c5814347d110db17920415cf2fbcad85e7203" dependencies = [ "async-trait", "base64", @@ -727,10 +874,15 @@ dependencies = [ "http", "http-body", "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", - "prost", + "sync_wrapper", + "tokio", "tokio-stream", + "tower", "tower-layer", "tower-service", "tracing", @@ -738,9 +890,32 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.13.1" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40aaccc9f9eccf2cd82ebc111adc13030d23e887244bc9cfa5d1d636049de3" +dependencies = [ + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tonic-prost" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66bd50ad6ce1252d87ef024b3d64fe4c3cf54a86fb9ef4c631fdd0ded7aeaa67" +dependencies = [ + "bytes", + "prost", + "tonic", +] + +[[package]] +name = "tonic-prost-build" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac6f67be712d12f0b41328db3137e0d0757645d8904b4cb7d51cd9c2279e847" +checksum = "b4a16cba4043dc3ff43fcb3f96b4c5c154c64cbd18ca8dce2ab2c6a451d058a2" dependencies = [ "prettyplease", "proc-macro2", @@ -748,19 +923,40 @@ dependencies = [ "prost-types", "quote", "syn 2.0.87", + "tempfile", + "tonic-build", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 2.2.3", + "pin-project-lite", + "slab", + "sync_wrapper", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", ] [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -794,12 +990,33 @@ dependencies = [ "once_cell", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + [[package]] name = "unicode-ident" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -836,7 +1053,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -856,17 +1082,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -877,9 +1104,9 @@ checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -889,9 +1116,9 @@ checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -901,9 +1128,15 @@ checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -913,9 +1146,9 @@ checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -925,9 +1158,9 @@ checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -937,9 +1170,9 @@ checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -949,6 +1182,6 @@ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/Cargo.toml b/Cargo.toml index 7907d6c2a..6f04802a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,17 +52,12 @@ all-features = true h2 = { version = "0.4", optional = true } http = { version = "1.2", optional = true } ipnet = { version = "2", optional = true } -prost = "0.13" -prost-types = { version = "0.13", optional = true } +prost = "0.14" +prost-types = { version = "0.14", optional = true } quickcheck = { version = "1", default-features = false, optional = true } thiserror = { version = "2", optional = true } +tonic = { version = "0.14", default-features = false, features = ["channel"] } +tonic-prost = "0.14" -[dependencies.tonic] -version = "0.13" -default-features = false -features = ["prost"] - -[dev-dependencies.tonic-build] -version = "0.13" -default-features = false -features = ["prost"] +[dev-dependencies] +tonic-prost-build = "0.14" diff --git a/deny.toml b/deny.toml index 14c2b4d30..42349de1f 100644 --- a/deny.toml +++ b/deny.toml @@ -37,7 +37,10 @@ highlight = "all" skip = [ { name = "syn" }, ] -skip-tree = [] +skip-tree = [ + # socket v0.6 is still propagating through the ecosystem + { name = "socket2", version = "0.5" }, +] [sources] unknown-registry = "deny" diff --git a/examples/gen.rs b/examples/gen.rs index 7a22f4513..7d6cfac14 100644 --- a/examples/gen.rs +++ b/examples/gen.rs @@ -17,7 +17,7 @@ fn main() -> Result<(), Box> { // Generate rust bindings. let out_dir = PathBuf::from("src").join("gen"); - if let Err(e) = tonic_build::configure() + if let Err(e) = tonic_prost_build::configure() .build_client(true) .build_server(true) .out_dir(out_dir) diff --git a/src/gen/io.linkerd.proxy.destination.rs b/src/gen/io.linkerd.proxy.destination.rs index 13788424c..92a6de1e1 100644 --- a/src/gen/io.linkerd.proxy.destination.rs +++ b/src/gen/io.linkerd.proxy.destination.rs @@ -1,5 +1,5 @@ // This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetDestination { #[prost(string, tag = "1")] pub scheme: ::prost::alloc::string::String, @@ -82,7 +82,7 @@ pub struct WeightedAddr { #[prost(message, optional, tag = "9")] pub resource_ref: ::core::option::Option, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TlsIdentity { /// The server name of the endpoint. This is the value that needs to be included /// by clients in the ClientHello SNI extension of the TLS handshake when they @@ -95,26 +95,26 @@ pub struct TlsIdentity { /// Nested message and enum types in `TlsIdentity`. pub mod tls_identity { /// Verify the certificate based on the Kubernetes pod identity. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DnsLikeIdentity { /// A DNS-like name that encodes workload coordinates. /// /// For example: - /// {name}.{namespace}.{type}.identity.{control-namespace}.{trust-domain...} + /// {name}.{namespace}.{type}.identity.{control-namespace}.{trust-domain...} #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } /// Verify the certificate based on an URI identity. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UriLikeIdentity { /// A URI name that encodes workload identity. /// /// For example: - /// spiffe://trust-domain/workload-dentifier + /// spiffe://trust-domain/workload-dentifier #[prost(string, tag = "1")] pub uri: ::prost::alloc::string::String, } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Strategy { #[prost(message, tag = "1")] DnsLikeIdentity(DnsLikeIdentity), @@ -122,19 +122,19 @@ pub mod tls_identity { UriLikeIdentity(UriLikeIdentity), } } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AuthorityOverride { #[prost(string, tag = "1")] pub authority_override: ::prost::alloc::string::String, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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". -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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. @@ -145,17 +145,17 @@ pub struct ProtocolHint { } /// Nested message and enum types in `ProtocolHint`. pub mod protocol_hint { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct H2 {} - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Opaque {} - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct OpaqueTransport { /// The target proxy's inbound port. #[prost(uint32, tag = "1")] pub inbound_port: u32, } - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Protocol { /// Hints that the service understands HTTP2 and the proxy's internal /// http2-upgrade mechanism. @@ -169,7 +169,7 @@ pub mod protocol_hint { } } /// Configures the parameters used to initialize an HTTP/2 connection. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Http2ClientParams { /// Overrides the default client flow control settings. #[prost(message, optional, tag = "1")] @@ -183,7 +183,7 @@ pub struct Http2ClientParams { } /// Nested message and enum types in `Http2ClientParams`. pub mod http2_client_params { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlowControl { /// Configures the maximum connection-level flow control window size. #[prost(uint32, tag = "1")] @@ -195,7 +195,7 @@ pub mod http2_client_params { #[prost(bool, tag = "3")] pub adaptive_flow_control: bool, } - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeepAlive { /// The time between pings. #[prost(message, optional, tag = "1")] @@ -208,7 +208,7 @@ pub mod http2_client_params { #[prost(bool, tag = "3")] pub while_idle: bool, } - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Internals { #[prost(uint32, tag = "1")] pub max_concurrent_reset_streams: u32, @@ -355,7 +355,7 @@ pub mod request_match { Method(super::super::http_types::HttpMethod), } } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PathMatch { /// Match if the request path matches this regex. #[prost(string, tag = "1")] @@ -388,7 +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. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct HttpStatusRange { /// Minimum matching http status code (inclusive), if specified. #[prost(uint32, tag = "1")] @@ -397,7 +397,7 @@ pub struct HttpStatusRange { #[prost(uint32, tag = "2")] pub max: u32, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WeightedDst { /// This authority will be used as the `path` in a call to the Destination.Get /// rpc. @@ -426,6 +426,17 @@ pub mod destination_client { pub struct DestinationClient { inner: tonic::client::Grpc, } + impl DestinationClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } impl DestinationClient where T: tonic::client::GrpcService, @@ -508,7 +519,7 @@ pub mod destination_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.destination.Destination/Get", ); @@ -536,7 +547,7 @@ pub mod destination_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.destination.Destination/GetProfile", ); @@ -697,7 +708,7 @@ pub mod destination_server { let inner = self.inner.clone(); let fut = async move { let method = GetSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, @@ -743,7 +754,7 @@ pub mod destination_server { let inner = self.inner.clone(); let fut = async move { let method = GetProfileSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, diff --git a/src/gen/io.linkerd.proxy.grpc_route.rs b/src/gen/io.linkerd.proxy.grpc_route.rs index fc2621164..1d34c8bca 100644 --- a/src/gen/io.linkerd.proxy.grpc_route.rs +++ b/src/gen/io.linkerd.proxy.grpc_route.rs @@ -9,7 +9,7 @@ pub struct GrpcRouteMatch { #[prost(message, repeated, tag = "2")] pub headers: ::prost::alloc::vec::Vec, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GrpcRpcMatch { #[prost(string, tag = "1")] pub service: ::prost::alloc::string::String, @@ -17,7 +17,7 @@ pub struct GrpcRpcMatch { pub method: ::prost::alloc::string::String, } /// Configures a route to respond with a fixed response. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GrpcFailureInjector { /// The status code to use in the `grpc-status` response. Must be specified. #[prost(uint32, tag = "1")] diff --git a/src/gen/io.linkerd.proxy.http_route.rs b/src/gen/io.linkerd.proxy.http_route.rs index 6aab04dd4..665424e90 100644 --- a/src/gen/io.linkerd.proxy.http_route.rs +++ b/src/gen/io.linkerd.proxy.http_route.rs @@ -1,6 +1,6 @@ // This file is @generated by prost-build. /// Describes how to match an `:authority` or `host` header. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct HostMatch { #[prost(oneof = "host_match::Match", tags = "1, 2")] pub r#match: ::core::option::Option, @@ -8,17 +8,17 @@ pub struct HostMatch { /// Nested message and enum types in `HostMatch`. pub mod host_match { /// A match like `*.example.com` is encoded as \[com, example\]. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Suffix { #[prost(string, repeated, tag = "1")] pub reverse_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Match { /// Match an exact hostname, e.g. www.example.com. #[prost(string, tag = "1")] Exact(::prost::alloc::string::String), - /// Match a hostname as a wildcard suffix, e.g. *.example.com. + /// Match a hostname as a wildcard suffix, e.g. \*.example.com. #[prost(message, tag = "2")] Suffix(Suffix), } @@ -44,14 +44,14 @@ pub struct HttpRouteMatch { pub method: ::core::option::Option, } /// Describes how to match a path. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PathMatch { #[prost(oneof = "path_match::Kind", tags = "1, 2, 3")] pub kind: ::core::option::Option, } /// Nested message and enum types in `PathMatch`. pub mod path_match { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Kind { #[prost(string, tag = "1")] Exact(::prost::alloc::string::String), @@ -62,7 +62,7 @@ pub mod path_match { } } /// Describes how to match a header by name and value. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct HeaderMatch { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -71,7 +71,7 @@ pub struct HeaderMatch { } /// Nested message and enum types in `HeaderMatch`. pub mod header_match { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Value { #[prost(bytes, tag = "2")] Exact(::prost::alloc::vec::Vec), @@ -80,7 +80,7 @@ pub mod header_match { } } /// Describes how to match a query parameter by name and value. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct QueryParamMatch { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -89,7 +89,7 @@ pub struct QueryParamMatch { } /// Nested message and enum types in `QueryParamMatch`. pub mod query_param_match { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Value { #[prost(string, tag = "2")] Exact(::prost::alloc::string::String), @@ -135,7 +135,7 @@ pub struct ResponseHeaderModifier { } /// Configures a route to respond with a redirect response. The `location` header /// is set with the given URL parameters. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RequestRedirect { /// The scheme value to be used in the `location` header. If not specified, /// the original request's scheme is used. @@ -159,14 +159,14 @@ pub struct RequestRedirect { pub status: u32, } /// Describes how a path value may be rewritten in a route. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PathModifier { #[prost(oneof = "path_modifier::Replace", tags = "1, 2")] pub replace: ::core::option::Option, } /// Nested message and enum types in `PathModifier`. pub mod path_modifier { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Replace { /// Indicates that the path should be replaced with the given value. #[prost(string, tag = "1")] @@ -182,7 +182,7 @@ pub mod path_modifier { } } /// Configures a route to respond with a fixed response. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct HttpFailureInjector { /// The status code to use in the HTTP response. Must be specified. #[prost(uint32, tag = "1")] @@ -198,7 +198,7 @@ pub struct HttpFailureInjector { /// A ratio (i.e., of requests) to which an filter should be applied. /// /// Represents fractional values on \[0, 1\]. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Ratio { #[prost(uint32, tag = "1")] pub numerator: u32, @@ -206,7 +206,7 @@ pub struct Ratio { #[prost(uint32, tag = "2")] pub denominator: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 f92789ef4..3df31ff46 100644 --- a/src/gen/io.linkerd.proxy.http_types.rs +++ b/src/gen/io.linkerd.proxy.http_types.rs @@ -1,5 +1,5 @@ // This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct HttpMethod { #[prost(oneof = "http_method::Type", tags = "1, 2")] pub r#type: ::core::option::Option, @@ -63,7 +63,7 @@ pub mod http_method { } } } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Type { #[prost(enumeration = "Registered", tag = "1")] Registered(i32), @@ -71,7 +71,7 @@ pub mod http_method { Unregistered(::prost::alloc::string::String), } } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Scheme { #[prost(oneof = "scheme::Type", tags = "1, 2")] pub r#type: ::core::option::Option, @@ -114,7 +114,7 @@ pub mod scheme { } } } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Type { #[prost(enumeration = "Registered", tag = "1")] Registered(i32), @@ -129,7 +129,7 @@ pub struct Headers { } /// Nested message and enum types in `Headers`. pub mod headers { - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Header { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, diff --git a/src/gen/io.linkerd.proxy.identity.rs b/src/gen/io.linkerd.proxy.identity.rs index 76eaf2d9d..84d949927 100644 --- a/src/gen/io.linkerd.proxy.identity.rs +++ b/src/gen/io.linkerd.proxy.identity.rs @@ -1,5 +1,5 @@ // This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CertifyRequest { #[prost(string, tag = "1")] pub identity: ::prost::alloc::string::String, @@ -13,7 +13,7 @@ pub struct CertifyRequest { #[prost(bytes = "vec", tag = "3")] pub certificate_signing_request: ::prost::alloc::vec::Vec, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CertifyResponse { /// A PEM-encoded x509 Certificate. #[prost(bytes = "vec", tag = "1")] @@ -42,6 +42,17 @@ pub mod identity_client { pub struct IdentityClient { inner: tonic::client::Grpc, } + impl IdentityClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } impl IdentityClient where T: tonic::client::GrpcService, @@ -129,7 +140,7 @@ pub mod identity_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.identity.Identity/Certify", ); @@ -271,7 +282,7 @@ pub mod identity_server { let inner = self.inner.clone(); let fut = async move { let method = CertifySvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, diff --git a/src/gen/io.linkerd.proxy.inbound.rs b/src/gen/io.linkerd.proxy.inbound.rs index d0630bbd9..c7e53d853 100644 --- a/src/gen/io.linkerd.proxy.inbound.rs +++ b/src/gen/io.linkerd.proxy.inbound.rs @@ -1,10 +1,10 @@ // This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PortSpec { /// Identifies a proxy workload (e.g., pod name). #[prost(string, tag = "1")] pub workload: ::prost::alloc::string::String, - /// An inbound port on _workload_. + /// An inbound port on *workload*. #[prost(uint32, tag = "2")] pub port: u32, } @@ -72,9 +72,9 @@ pub mod proxy_protocol { pub routes: ::prost::alloc::vec::Vec, } /// TODO: opaque TLS settings (versions, algorithms, SNI) - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Opaque {} - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Tls {} #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Kind { @@ -98,7 +98,7 @@ pub struct Authz { /// /// Must have at least one network, otherwise the authorization must be /// ignored. An authorization matches all clients by including an explicit - /// match on, i.e., `\[0.0.0.0/0, 0::/0\]``. + /// match on, i.e., \`\[0.0.0.0/0, 0::/0\]\``. #[prost(message, repeated, tag = "1")] pub networks: ::prost::alloc::vec::Vec, /// Must be set. @@ -137,7 +137,7 @@ pub struct Authn { } /// Nested message and enum types in `Authn`. pub mod authn { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PermitUnauthenticated {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct PermitMeshTls { @@ -177,16 +177,15 @@ pub mod authn { MeshTls(PermitMeshTls), } } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Identity { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } /// Encodes a DNS-like name suffix as sequence of parts. /// -/// An empty list is equivalent to `.` (matching all names); the list `["foo", -/// "bar"]` is equivalent to "foo.bar." (matching `*.foo.bar`), etc. -#[derive(Clone, PartialEq, ::prost::Message)] +/// An empty list is equivalent to `.` (matching all names); the list `\["foo", "bar"\]` is equivalent to "foo.bar." (matching `*.foo.bar`), etc. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct IdentitySuffix { #[prost(string, repeated, tag = "1")] pub parts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, @@ -315,7 +314,7 @@ pub mod http_local_rate_limit { pub identities: ::prost::alloc::vec::Vec, } } - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Limit { #[prost(uint32, tag = "1")] pub requests_per_second: u32, @@ -343,6 +342,17 @@ pub mod inbound_server_policies_client { pub struct InboundServerPoliciesClient { inner: tonic::client::Grpc, } + impl InboundServerPoliciesClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } impl InboundServerPoliciesClient where T: tonic::client::GrpcService, @@ -421,7 +431,7 @@ pub mod inbound_server_policies_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.inbound.InboundServerPolicies/GetPort", ); @@ -451,7 +461,7 @@ pub mod inbound_server_policies_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.inbound.InboundServerPolicies/WatchPort", ); @@ -611,7 +621,7 @@ pub mod inbound_server_policies_server { let inner = self.inner.clone(); let fut = async move { let method = GetPortSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, @@ -658,7 +668,7 @@ pub mod inbound_server_policies_server { let inner = self.inner.clone(); let fut = async move { let method = WatchPortSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, diff --git a/src/gen/io.linkerd.proxy.meta.rs b/src/gen/io.linkerd.proxy.meta.rs index 598715bff..9e0337f58 100644 --- a/src/gen/io.linkerd.proxy.meta.rs +++ b/src/gen/io.linkerd.proxy.meta.rs @@ -1,14 +1,14 @@ // This file is @generated by prost-build. /// General metadata about a configuration object. Typically references either an /// implicit default configuration or a Kubernetes resource. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Metadata { #[prost(oneof = "metadata::Kind", tags = "1, 2")] pub kind: ::core::option::Option, } /// Nested message and enum types in `Metadata`. pub mod metadata { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Kind { /// A name describing a default/implicit configuration. /// @@ -22,7 +22,7 @@ pub mod metadata { } } /// References a (e.g., Kubernetes) resource. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Resource { #[prost(string, tag = "1")] pub group: ::prost::alloc::string::String, diff --git a/src/gen/io.linkerd.proxy.net.rs b/src/gen/io.linkerd.proxy.net.rs index a54c4d445..cc0dc7d89 100644 --- a/src/gen/io.linkerd.proxy.net.rs +++ b/src/gen/io.linkerd.proxy.net.rs @@ -1,12 +1,12 @@ // This file is @generated by prost-build. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 { - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Ip { #[prost(fixed32, tag = "1")] Ipv4(u32), @@ -14,14 +14,14 @@ pub mod ip_address { Ipv6(super::IPv6), } } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IpNetwork { #[prost(message, optional, tag = "1")] pub ip: ::core::option::Option, #[prost(uint32, tag = "2")] pub prefix_len: u32, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IPv6 { /// hextets 1-4 #[prost(fixed64, tag = "1")] @@ -30,7 +30,7 @@ pub struct IPv6 { #[prost(fixed64, tag = "2")] pub last: u64, } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 a933ad388..b49a3a789 100644 --- a/src/gen/io.linkerd.proxy.opaque_route.rs +++ b/src/gen/io.linkerd.proxy.opaque_route.rs @@ -1,10 +1,10 @@ // This file is @generated by prost-build. /// Used to indicate that the policy is invalid. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Invalid { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } /// Used to indicate that traffic is forbidden. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Forbidden {} diff --git a/src/gen/io.linkerd.proxy.outbound.rs b/src/gen/io.linkerd.proxy.outbound.rs index 3202b4665..b3103bfbb 100644 --- a/src/gen/io.linkerd.proxy.outbound.rs +++ b/src/gen/io.linkerd.proxy.outbound.rs @@ -1,5 +1,5 @@ // This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TrafficSpec { /// Uniquely identifies the source proxy workload (e.g., pod name) to the /// control plane. @@ -12,7 +12,7 @@ pub struct TrafficSpec { /// Nested message and enum types in `TrafficSpec`. pub mod traffic_spec { /// Describes a target address, as observed by the proxy. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Target { /// Indicates the proxy is connecting to a specific IP:port. #[prost(message, tag = "2")] @@ -176,7 +176,7 @@ pub mod http_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Empty {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { @@ -224,7 +224,7 @@ pub mod http_route { } /// Nested message and enum types in `Conditions`. pub mod conditions { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StatusRange { #[prost(uint32, tag = "1")] pub start: u32, @@ -311,7 +311,7 @@ pub mod grpc_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Empty {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { @@ -351,7 +351,7 @@ pub mod grpc_route { /// Nested message and enum types in `Retry`. pub mod retry { /// Retryable gRPC status codes. - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Conditions { #[prost(bool, tag = "1")] pub cancelled: bool, @@ -401,14 +401,14 @@ pub mod opaque_route { #[prost(message, repeated, tag = "2")] pub filters: ::prost::alloc::vec::Vec, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2")] pub kind: ::core::option::Option, } /// Nested message and enum types in `Filter`. pub mod filter { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] Invalid(super::super::super::opaque_route::Invalid), @@ -423,7 +423,7 @@ pub mod opaque_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Empty {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { @@ -481,14 +481,14 @@ pub mod tls_route { #[prost(message, repeated, tag = "2")] pub filters: ::prost::alloc::vec::Vec, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Filter { #[prost(oneof = "filter::Kind", tags = "1, 2")] pub kind: ::core::option::Option, } /// Nested message and enum types in `Filter`. pub mod filter { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] Invalid(super::super::super::opaque_route::Invalid), @@ -503,7 +503,7 @@ pub mod tls_route { } /// Nested message and enum types in `Distribution`. pub mod distribution { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Empty {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct FirstAvailable { @@ -554,19 +554,19 @@ pub struct Backend { /// Nested message and enum types in `Backend`. pub mod backend { /// A strategy for discovering endpoints for a service. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct EndpointDiscovery { #[prost(oneof = "endpoint_discovery::Kind", tags = "1")] pub kind: ::core::option::Option, } /// Nested message and enum types in `EndpointDiscovery`. pub mod endpoint_discovery { - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DestinationGet { #[prost(string, tag = "1")] pub path: ::prost::alloc::string::String, } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Kind { /// Use the `Destination` service to discover endpoints for this service. #[prost(message, tag = "1")] @@ -575,7 +575,7 @@ pub mod backend { } /// Describes a power-of-two-choices (P2C) load balancer configuration for a /// backend. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BalanceP2c { #[prost(message, optional, tag = "1")] pub discovery: ::core::option::Option, @@ -586,7 +586,7 @@ pub mod backend { /// Nested message and enum types in `BalanceP2c`. pub mod balance_p2c { /// Parameters configuring peak EWMA load estimation. - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PeakEwma { /// Initial latency value used when no latencies have been /// recorded for an endpoint. @@ -597,7 +597,7 @@ pub mod backend { pub decay: ::core::option::Option<::prost_types::Duration>, } /// The load estimation strategy used by this load balancer. - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Load { /// This load balancer uses peak EWMA (exponentially weighted moving /// average) load estimates. @@ -615,7 +615,7 @@ pub mod backend { Balancer(BalanceP2c), } } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Queue { /// The number of requests that may be held in a queue before backpressure is /// exerted. @@ -675,6 +675,17 @@ pub mod outbound_policies_client { pub struct OutboundPoliciesClient { inner: tonic::client::Grpc, } + impl OutboundPoliciesClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } impl OutboundPoliciesClient where T: tonic::client::GrpcService, @@ -752,7 +763,7 @@ pub mod outbound_policies_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.outbound.OutboundPolicies/Get", ); @@ -778,7 +789,7 @@ pub mod outbound_policies_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.outbound.OutboundPolicies/Watch", ); @@ -927,7 +938,7 @@ pub mod outbound_policies_server { let inner = self.inner.clone(); let fut = async move { let method = GetSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, @@ -973,7 +984,7 @@ pub mod outbound_policies_server { let inner = self.inner.clone(); let fut = async move { let method = WatchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, diff --git a/src/gen/io.linkerd.proxy.tap.rs b/src/gen/io.linkerd.proxy.tap.rs index cdd061665..81e8026ae 100644 --- a/src/gen/io.linkerd.proxy.tap.rs +++ b/src/gen/io.linkerd.proxy.tap.rs @@ -26,21 +26,21 @@ pub mod observe_request { #[prost(message, repeated, tag = "1")] pub matches: ::prost::alloc::vec::Vec, } - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Label { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Netmask { #[prost(message, optional, tag = "1")] pub ip: ::core::option::Option< @@ -51,7 +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. - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PortRange { /// Minimum matching port value (inclusive), if specified. #[prost(uint32, tag = "1")] @@ -60,7 +60,7 @@ pub mod observe_request { #[prost(uint32, tag = "2")] pub max: u32, } - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] Netmask(Netmask), @@ -68,21 +68,21 @@ pub mod observe_request { Ports(PortRange), } } - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Http { #[prost(oneof = "http::Match", tags = "1, 3, 2, 4")] pub r#match: ::core::option::Option, } /// Nested message and enum types in `Http`. pub mod http { - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StringMatch { #[prost(oneof = "string_match::Match", tags = "1, 2")] pub r#match: ::core::option::Option, } /// Nested message and enum types in `StringMatch`. pub mod string_match { - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Match { #[prost(string, tag = "1")] Exact(::prost::alloc::string::String), @@ -90,7 +90,7 @@ pub mod observe_request { Prefix(::prost::alloc::string::String), } } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] Scheme(super::super::super::super::http_types::Scheme), @@ -123,43 +123,43 @@ pub mod observe_request { RouteLabel(Label), } } - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Headers {} - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Extract { #[prost(message, tag = "1")] Headers(Headers), } } - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Extract { #[prost(message, tag = "1")] Http(Http), } } } -#[derive(Clone, Copy, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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 { - #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum End { #[prost(uint32, tag = "1")] GrpcStatusCode(u32), @@ -209,7 +209,7 @@ pub mod tap_event { } /// Nested message and enum types in `Http`. pub mod http { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StreamId { /// A randomized base (stable across a process's runtime) #[prost(uint32, tag = "1")] @@ -338,6 +338,17 @@ pub mod tap_client { pub struct TapClient { inner: tonic::client::Grpc, } + impl TapClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } impl TapClient where T: tonic::client::GrpcService, @@ -418,7 +429,7 @@ pub mod tap_client { format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/io.linkerd.proxy.tap.Tap/Observe", ); @@ -561,7 +572,7 @@ pub mod tap_server { let inner = self.inner.clone(); let fut = async move { let method = ObserveSvc(inner); - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( accept_compression_encodings, diff --git a/src/gen/io.linkerd.proxy.tls_route.rs b/src/gen/io.linkerd.proxy.tls_route.rs index 89e72ef5c..cfbde2971 100644 --- a/src/gen/io.linkerd.proxy.tls_route.rs +++ b/src/gen/io.linkerd.proxy.tls_route.rs @@ -1,6 +1,6 @@ // This file is @generated by prost-build. /// Describes how to match an `SNI` ClientHello extension. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SniMatch { #[prost(oneof = "sni_match::Match", tags = "1, 2")] pub r#match: ::core::option::Option, @@ -8,17 +8,17 @@ pub struct SniMatch { /// Nested message and enum types in `SniMatch`. pub mod sni_match { /// A match like `*.example.com` is encoded as \[com, example\]. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Suffix { #[prost(string, repeated, tag = "1")] pub reverse_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Match { /// Match an exact SNI, e.g. www.example.com. #[prost(string, tag = "1")] Exact(::prost::alloc::string::String), - /// Match a SNI as a wildcard suffix, e.g. *.example.com. + /// Match a SNI as a wildcard suffix, e.g. \*.example.com. #[prost(message, tag = "2")] Suffix(Suffix), }