diff --git a/Cargo.lock b/Cargo.lock index 33e7f06d928..cac630522ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2516,9 +2516,9 @@ dependencies = [ [[package]] name = "object_store" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f930c88a43b1c3f6e776dfe495b4afab89882dbc81530c632db2ed65451ebcb4" +checksum = "2524735495ea1268be33d200e1ee97455096a0846295a21548cd2f3541de7050" dependencies = [ "async-trait", "base64 0.21.5", @@ -2533,7 +2533,7 @@ dependencies = [ "quick-xml", "rand", "reqwest", - "ring 0.16.20", + "ring", "serde", "serde_json", "snafu", @@ -2918,9 +2918,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", "serde", @@ -3138,21 +3138,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.5" @@ -3162,8 +3147,8 @@ dependencies = [ "cc", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.48.0", ] @@ -3202,7 +3187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", - "ring 0.17.5", + "ring", "rustls-webpki", "sct", ] @@ -3234,8 +3219,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -3289,8 +3274,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -3692,12 +3677,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -4298,12 +4277,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index 75cc0d4e7d0..34e700b3c9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,7 @@ lettre = { version = "=0.11.1", default-features = false, features = ["file-tran minijinja = "=1.0.9" moka = { version = "=0.12.1", features = ["future"] } oauth2 = { version = "=4.4.2", default-features = false, features = ["reqwest"] } -object_store = { version = "=0.7.1", features = ["aws"] } +object_store = { version = "=0.8.0", features = ["aws"] } once_cell = "=1.18.0" p256 = "=0.13.2" parking_lot = "=0.12.1" diff --git a/src/storage.rs b/src/storage.rs index 0924b26841b..bd041327238 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -253,23 +253,27 @@ impl Storage { #[instrument(skip(self, bytes))] pub async fn upload_crate_file(&self, name: &str, version: &str, bytes: Bytes) -> Result<()> { let path = crate_file_path(name, version); - self.crate_upload_store.put(&path, bytes).await + self.crate_upload_store.put(&path, bytes).await?; + Ok(()) } #[instrument(skip(self, bytes))] pub async fn upload_readme(&self, name: &str, version: &str, bytes: Bytes) -> Result<()> { let path = readme_path(name, version); - self.readme_upload_store.put(&path, bytes).await + self.readme_upload_store.put(&path, bytes).await?; + Ok(()) } #[instrument(skip(self, content))] pub async fn sync_index(&self, name: &str, content: Option) -> Result<()> { let path = crates_io_index::Repository::relative_index_file_for_url(name).into(); if let Some(content) = content { - self.index_upload_store.put(&path, content.into()).await + self.index_upload_store.put(&path, content.into()).await?; } else { - self.index_store.delete(&path).await + self.index_store.delete(&path).await?; } + + Ok(()) } #[instrument(skip(self))] @@ -302,7 +306,7 @@ impl Storage { } async fn delete_all_with_prefix(&self, prefix: &Path) -> Result<()> { - let objects = self.store.list(Some(prefix)).await?; + let objects = self.store.list(Some(prefix)); let locations = objects.map(|meta| meta.map(|m| m.location)).boxed(); self.store @@ -378,7 +382,7 @@ mod tests { } pub async fn stored_files(store: &dyn ObjectStore) -> Vec { - let stream = store.list(None).await.unwrap(); + let stream = store.list(None); let list = stream.try_collect::>().await.unwrap(); list.into_iter() diff --git a/src/tests/util/test_app.rs b/src/tests/util/test_app.rs index d307266a7e1..861dcc4b43b 100644 --- a/src/tests/util/test_app.rs +++ b/src/tests/util/test_app.rs @@ -154,7 +154,7 @@ impl TestApp { .unwrap(); let list = rt.block_on(async { - let stream = store.list(None).await.unwrap(); + let stream = store.list(None); stream.try_collect::>().await.unwrap() });