diff --git a/Cargo.lock b/Cargo.lock index 081cbbd..4ba4c0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -360,7 +360,7 @@ dependencies = [ "http 1.0.0", "http-body 1.0.0", "http-body-util", - "hyper 1.0.1", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -427,6 +427,12 @@ version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "1.3.2" @@ -1069,9 +1075,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d308f63daf4181410c242d34c11f928dcb3aa105852019e043c9d1f4e4368a" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" dependencies = [ "bytes", "fnv", @@ -1233,21 +1239,23 @@ dependencies = [ [[package]] name = "hyper" -version = "1.0.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f9214f3e703236b221f1a9cd88ec8b4adfa5296de01ab96216361f4692f56" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.0", + "h2 0.4.4", "http 1.0.0", "http-body 1.0.0", "httparse", "httpdate", "itoa", "pin-project-lite", + "smallvec", "tokio", + "want", ] [[package]] @@ -1263,18 +1271,34 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca339002caeb0d159cc6e023dff48e199f081e42fa039895c7c6f38b37f2e9d" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.0.0", "http-body 1.0.0", - "hyper 1.0.1", + "hyper 1.3.1", "pin-project-lite", "socket2 0.5.5", "tokio", @@ -1975,9 +1999,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.24.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd" +checksum = "6472825949c09872e8f2c50bde59fcefc17748b6be5c90fd67cd8b4daca73bfd" dependencies = [ "arc-swap", "async-trait", @@ -1990,7 +2014,7 @@ dependencies = [ "pin-project-lite", "ryu", "sha1_smol", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tokio-retry", "tokio-util", @@ -2048,9 +2072,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.5", "bytes", @@ -2061,7 +2085,7 @@ dependencies = [ "http 0.2.11", "http-body 0.4.5", "hyper 0.14.27", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -2070,9 +2094,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -2083,7 +2109,49 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.4.4", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.1.2", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.52.0", ] [[package]] @@ -2132,7 +2200,7 @@ dependencies = [ "minidom", "percent-encoding", "quick-xml", - "reqwest", + "reqwest 0.11.27", "serde", "serde_derive", "sha2", @@ -2222,7 +2290,7 @@ 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", ] @@ -2236,6 +2304,22 @@ dependencies = [ "base64 0.21.5", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -2252,7 +2336,7 @@ version = "0.7.6" dependencies = [ "async-trait", "axum", - "base64 0.21.5", + "base64 0.22.1", "bytes", "chrono", "clap", @@ -2267,7 +2351,7 @@ dependencies = [ "mime_guess", "mobc", "redis", - "reqwest", + "reqwest 0.12.4", "rust-s3", "rustc-hash", "sentry", @@ -2381,7 +2465,7 @@ checksum = "9b596ee5f4e76638de6063ca96fd3d923675416461fc7f1b77406dc2f32d1979" dependencies = [ "httpdate", "native-tls", - "reqwest", + "reqwest 0.11.27", "sentry-backtrace", "sentry-contexts", "sentry-core", @@ -2606,9 +2690,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smartstring" @@ -2664,18 +2748,18 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", @@ -2748,7 +2832,7 @@ dependencies = [ "cfg-if", "p12", "rustls-connector", - "rustls-pemfile", + "rustls-pemfile 1.0.4", ] [[package]] @@ -3245,9 +3329,9 @@ checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -3445,6 +3529,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "yasna" version = "0.5.2" diff --git a/Cargo.toml b/Cargo.toml index 639fc25..21f5e73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.74" axum = { version = "0.7.1" } -base64 = "0.21.5" +base64 = "0.22.1" bytes = "1.5.0" chrono = { version = "0.4.26", features = ["serde"] } clap = { version = "4.3.21", features = ["env", "derive"] } @@ -28,11 +28,11 @@ log = "0.4.20" mime = "0.3.17" mime_guess = "2.0.4" mobc = "0.8.3" -redis = { version = "0.24.0", features = ["tokio-comp", "connection-manager"] } +redis = { version = "0.25.3", features = ["tokio-comp", "connection-manager"] } rustc-hash = "1.1.0" serde = { version = "1.0.192", features = ["derive"] } serde_json = "1.0.108" -strum = { version = "0.25.0", features = ["derive"] } +strum = { version = "0.26.2", features = ["derive"] } thiserror = "1.0.50" tokio = { version = "1.31.0", features = ["full", "bytes"] } tokio-util = { version = "0.7.10", features = ["io"] } @@ -44,7 +44,7 @@ sha1 = { version = "^0.10.1", features = ["compress"] } sha2 = { version = "^0.10.1", features = ["compress"] } md-5 = "^0.10.1" digest = "^0.10.1" -reqwest = "0.11.22" +reqwest = "0.12.4" lapin = "2.3.1" tower-http = { version = "0.5.0", features = ["cors", "trace"] } wildmatch = "2.1.1" diff --git a/src/info_storages/impls/redis_info_storage.rs b/src/info_storages/impls/redis_info_storage.rs index 20c5926..81ab10d 100644 --- a/src/info_storages/impls/redis_info_storage.rs +++ b/src/info_storages/impls/redis_info_storage.rs @@ -1,5 +1,5 @@ use mobc::{Manager, Pool}; -use redis::aio::Connection; +use redis::aio::MultiplexedConnection; use crate::{ errors::{RustusError, RustusResult}, @@ -19,11 +19,11 @@ impl RedisConnectionManager { #[async_trait::async_trait] impl Manager for RedisConnectionManager { - type Connection = redis::aio::Connection; + type Connection = redis::aio::MultiplexedConnection; type Error = redis::RedisError; async fn connect(&self) -> Result { - Ok(self.client.get_async_connection().await?) + Ok(self.client.get_multiplexed_async_connection().await?) } async fn check(&self, mut conn: Self::Connection) -> Result { @@ -69,7 +69,8 @@ impl InfoStorage for RedisStorage { if let Some(expiration) = self.expiration.as_ref() { cmd = cmd.arg("EX").arg(expiration); } - cmd.query_async::(&mut conn).await?; + cmd.query_async::(&mut conn) + .await?; Ok(()) } @@ -77,7 +78,7 @@ impl InfoStorage for RedisStorage { let mut conn = self.pool.get().await?; let res = redis::cmd("GET") .arg(file_id) - .query_async::>(&mut conn) + .query_async::>(&mut conn) .await?; if let Some(res) = res { @@ -91,7 +92,7 @@ impl InfoStorage for RedisStorage { let mut conn = self.pool.get().await?; let resp = redis::cmd("DEL") .arg(file_id) - .query_async::>(&mut conn) + .query_async::>(&mut conn) .await?; match resp { None | Some(0) => Err(RustusError::FileNotFound),