diff --git a/Cargo.lock b/Cargo.lock index 79305c73a..bdc981ae8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1290,13 +1290,14 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "8.3.0" +version = "9.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" +checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4" dependencies = [ "base64 0.21.5", + "js-sys", "pem", - "ring 0.16.20", + "ring 0.17.7", "serde", "serde_json", "simple_asn1", @@ -1844,31 +1845,31 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbjson" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048f9ac93c1eab514f9470c4bc8d97ca2a0a236b84f45cc19d69a59fc11467f6" +checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", "serde", ] [[package]] name = "pbjson-build" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" +checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" dependencies = [ "heck", - "itertools 0.10.5", + "itertools 0.11.0", "prost", "prost-types", ] [[package]] name = "pbjson-types" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a88c8d87f99a4ac14325e7a4c24af190fca261956e3b82dd7ed67e77e6c7043" +checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" dependencies = [ "bytes", "chrono", @@ -1887,11 +1888,12 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pem" -version = "1.1.1" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", + "serde", ] [[package]] @@ -1962,12 +1964,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.52", ] [[package]] @@ -1981,9 +1983,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -1991,44 +1993,44 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", "itertools 0.10.5", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", "prettyplease", "prost", "prost-types", "regex", - "syn 1.0.109", + "syn 2.0.52", "tempfile", "which 4.4.2", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools 0.10.5", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.52", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] @@ -2159,7 +2161,7 @@ dependencies = [ "thiserror", "tokio", "toml 0.7.8", - "tonic 0.9.2", + "tonic", "tracing", "tracing-subscriber", "uuid", @@ -2183,7 +2185,7 @@ dependencies = [ [[package]] name = "qcs-api-client-common" version = "0.7.12-rc.0" -source = "git+https://github.com/rigetti/qcs-api-client-rust?branch=grpc-web#3d05cd0bfd697a82dcafa22d2b24a175a22078b1" +source = "git+https://github.com/rigetti/qcs-api-client-rust?branch=grpc-web-hyper#20484ae208939d19eb8dbece209e9c7008072a19" dependencies = [ "async-trait", "backoff", @@ -2205,7 +2207,7 @@ dependencies = [ [[package]] name = "qcs-api-client-grpc" version = "0.7.14-rc.0" -source = "git+https://github.com/rigetti/qcs-api-client-rust?branch=grpc-web#3d05cd0bfd697a82dcafa22d2b24a175a22078b1" +source = "git+https://github.com/rigetti/qcs-api-client-rust?branch=grpc-web-hyper#20484ae208939d19eb8dbece209e9c7008072a19" dependencies = [ "backoff", "http", @@ -2225,7 +2227,7 @@ dependencies = [ "serde", "thiserror", "tokio", - "tonic 0.9.2", + "tonic", "tonic-build", "tonic-web", "tower", @@ -2237,7 +2239,7 @@ dependencies = [ [[package]] name = "qcs-api-client-openapi" version = "0.8.13-rc.0" -source = "git+https://github.com/rigetti/qcs-api-client-rust?branch=grpc-web#3d05cd0bfd697a82dcafa22d2b24a175a22078b1" +source = "git+https://github.com/rigetti/qcs-api-client-rust?branch=grpc-web-hyper#20484ae208939d19eb8dbece209e9c7008072a19" dependencies = [ "anyhow", "qcs-api-client-common", @@ -2433,7 +2435,7 @@ dependencies = [ "pin-project-lite", "rustls 0.21.9", "rustls-native-certs 0.6.3", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -2627,10 +2629,24 @@ checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", "ring 0.17.7", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct 0.7.1", ] +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.5.0" @@ -2650,7 +2666,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "schannel", "security-framework", ] @@ -2664,6 +2693,22 @@ dependencies = [ "base64 0.21.5", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +dependencies = [ + "base64 0.21.5", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -2674,6 +2719,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring 0.17.7", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -2961,6 +3017,12 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -3238,6 +3300,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.2", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-socks" version = "0.5.1" @@ -3336,17 +3409,15 @@ dependencies = [ [[package]] name = "tonic" -version = "0.9.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", "axum", "base64 0.21.5", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", @@ -3355,10 +3426,11 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "rustls-native-certs 0.6.3", - "rustls-pemfile", + "rustls-native-certs 0.7.0", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.25.0", "tokio-stream", "tower", "tower-layer", @@ -3366,36 +3438,17 @@ dependencies = [ "tracing", ] -[[package]] -name = "tonic" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" -dependencies = [ - "base64 0.21.5", - "bytes", - "http", - "http-body", - "percent-encoding", - "pin-project", - "tokio", - "tokio-stream", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic-build" -version = "0.9.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" +checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "quote", - "syn 1.0.109", + "syn 2.0.52", ] [[package]] @@ -3411,7 +3464,7 @@ dependencies = [ "hyper", "pin-project", "tokio-stream", - "tonic 0.11.0", + "tonic", "tower-http", "tower-layer", "tower-service", @@ -3757,7 +3810,7 @@ dependencies = [ "mime_guess", "percent-encoding", "pin-project", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "scoped-tls", "serde", "serde_json", @@ -4151,6 +4204,12 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + [[package]] name = "zeromq-src" version = "0.2.6+4.3.4" diff --git a/Cargo.toml b/Cargo.toml index b760526d7..280680414 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,9 +4,9 @@ resolver = "2" [workspace.dependencies] qcs-api = "0.2.1" -qcs-api-client-common = { git = "https://github.com/rigetti/qcs-api-client-rust", branch = "grpc-web" } -qcs-api-client-grpc = { git = "https://github.com/rigetti/qcs-api-client-rust", branch = "grpc-web" } -qcs-api-client-openapi = { git = "https://github.com/rigetti/qcs-api-client-rust", branch = "grpc-web" } +qcs-api-client-common = { git = "https://github.com/rigetti/qcs-api-client-rust", branch = "grpc-web-hyper" } +qcs-api-client-grpc = { git = "https://github.com/rigetti/qcs-api-client-rust", branch = "grpc-web-hyper" } +qcs-api-client-openapi = { git = "https://github.com/rigetti/qcs-api-client-rust", branch = "grpc-web-hyper" } serde_json = "1.0.86" thiserror = "1.0.57" tokio = "1.36.0" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 84ccf4f3c..ad92fe887 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -42,7 +42,7 @@ tokio = { workspace = true, features = ["fs", "rt-multi-thread"] } toml = "0.7.3" tracing = { version = "0.1", optional = true, features = ["log"] } uuid = { version = "1.2.1", features = ["v4"] } -tonic = { version = "0.9.2", features = ["tls", "tls-roots"] } +tonic = { version = "0.11.0", features = ["tls", "tls-roots"] } zmq = { version = "0.10.0" } itertools = "0.11.0" derive_builder = "0.12.0" diff --git a/crates/lib/src/client.rs b/crates/lib/src/client.rs index 3726ac679..6f8f03bca 100644 --- a/crates/lib/src/client.rs +++ b/crates/lib/src/client.rs @@ -6,7 +6,7 @@ use std::time::Duration; use qcs_api_client_common::configuration::{ClientConfiguration, RefreshError}; #[cfg(feature = "grpc-web")] -use qcs_api_client_grpc::channel::{wrap_channel_with_grpc_web, GrpcWebType}; +use qcs_api_client_grpc::grpc_web::{wrap_channel_with_grpc_web, GrpcWebWrapperLayerService}; use qcs_api_client_grpc::{ channel::{ get_channel, parse_uri, wrap_channel_with, wrap_channel_with_retry, RefreshService, @@ -33,7 +33,8 @@ pub type GrpcConnection = RetryService>>; +pub type GrpcConnection = + GrpcWebWrapperLayerService>>; /// TODO: make configurable at the client level. /// diff --git a/crates/lib/src/qpu/api.rs b/crates/lib/src/qpu/api.rs index aba2d9642..f0c0fa0df 100644 --- a/crates/lib/src/qpu/api.rs +++ b/crates/lib/src/qpu/api.rs @@ -6,9 +6,9 @@ use std::{fmt, time::Duration}; use cached::proc_macro::cached; use derive_builder::Builder; use qcs_api_client_common::configuration::RefreshError; -#[cfg(feature = "grpc-web")] -use qcs_api_client_grpc::channel::wrap_channel_with_grpc_web; pub use qcs_api_client_grpc::channel::Error as GrpcError; +#[cfg(feature = "grpc-web")] +use qcs_api_client_grpc::grpc_web::wrap_channel_with_grpc_web; use qcs_api_client_grpc::{ channel::{parse_uri, wrap_channel_with, wrap_channel_with_retry}, get_channel_with_timeout,