From 03aed8b2df0c5c0589467b920fcbbb99ef5750b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 23:59:59 +0000 Subject: [PATCH 1/2] Bump base64 from 0.13.0 to 0.21.0 in /src/agent Bumps [base64](https://github.com/marshallpierce/rust-base64) from 0.13.0 to 0.21.0. - [Release notes](https://github.com/marshallpierce/rust-base64/releases) - [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md) - [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.13.0...v0.21.0) --- updated-dependencies: - dependency-name: base64 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/agent/Cargo.lock | 12 ++++++------ src/agent/onefuzz/Cargo.toml | 2 +- src/agent/storage-queue/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/agent/Cargo.lock b/src/agent/Cargo.lock index 1d856f278d..05724c3f2e 100644 --- a/src/agent/Cargo.lock +++ b/src/agent/Cargo.lock @@ -302,9 +302,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" @@ -1456,7 +1456,7 @@ checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" dependencies = [ "anyhow", "async-channel", - "base64 0.13.0", + "base64 0.13.1", "futures-lite", "http", "infer", @@ -2195,7 +2195,7 @@ dependencies = [ "anyhow", "async-trait", "backoff", - "base64 0.13.0", + "base64 0.21.0", "bytes", "clap", "cpp_demangle", @@ -2913,7 +2913,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -3387,7 +3387,7 @@ dependencies = [ "anyhow", "async-trait", "backoff", - "base64 0.13.0", + "base64 0.21.0", "bincode", "bytes", "derivative", diff --git a/src/agent/onefuzz/Cargo.toml b/src/agent/onefuzz/Cargo.toml index 506cfb84ae..7d3ce68062 100644 --- a/src/agent/onefuzz/Cargo.toml +++ b/src/agent/onefuzz/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" [dependencies] anyhow = "1.0" async-trait = "0.1" -base64 = "0.13" +base64 = "0.21" bytes = "1.4" dunce = "1.0" dynamic-library = { path = "../dynamic-library" } diff --git a/src/agent/storage-queue/Cargo.toml b/src/agent/storage-queue/Cargo.toml index 5a00a60366..d5c1c09d08 100644 --- a/src/agent/storage-queue/Cargo.toml +++ b/src/agent/storage-queue/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" anyhow = "1.0" async-trait = "0.1" backoff = { version = "0.4", features = ["tokio"] } -base64 = "0.13" +base64 = "0.21" bytes = { version = "1.4", features = ["serde"] } derivative = "2.2" flume = "0.10" From 90e048f791707646586ae74825a81b11955411ef Mon Sep 17 00:00:00 2001 From: George Pollard Date: Wed, 9 Aug 2023 00:11:31 +0000 Subject: [PATCH 2/2] Update to new API --- src/agent/storage-queue/src/azure_queue.rs | 11 +++++++---- src/proxy-manager/Cargo.lock | 10 ++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/agent/storage-queue/src/azure_queue.rs b/src/agent/storage-queue/src/azure_queue.rs index 1ad24f4d01..9679f3e519 100644 --- a/src/agent/storage-queue/src/azure_queue.rs +++ b/src/agent/storage-queue/src/azure_queue.rs @@ -2,6 +2,7 @@ // Licensed under the MIT License. use anyhow::{Context, Result}; +use base64::Engine; use bytes::Buf; use reqwest::{Client, Url}; use reqwest_retry::SendRetry; @@ -11,6 +12,8 @@ use uuid::Uuid; pub const EMPTY_QUEUE_DELAY: Duration = Duration::from_secs(10); +const BASE64: base64::engine::GeneralPurpose = base64::engine::general_purpose::STANDARD; + // // // 7d35e47d-f58e-42da-ba4a-9e6ac7e1214d @@ -49,7 +52,7 @@ pub struct AzureQueueMessageSend { impl AzureQueueMessage { pub fn parse(&self, parser: impl FnOnce(&[u8]) -> Result) -> Result { - let decoded = base64::decode(&self.message_text)?; + let decoded = BASE64.decode(&self.message_text)?; parser(&decoded) } @@ -70,7 +73,7 @@ impl AzureQueueMessage { .error_for_status() .context("AzureQueueMessage.claim status body")?; } - let decoded = base64::decode(self.message_text)?; + let decoded = BASE64.decode(self.message_text)?; let value: T = serde_json::from_slice(&decoded)?; Ok(value) } @@ -96,7 +99,7 @@ impl AzureQueueMessage { } pub fn get(&self) -> Result { - let decoded = base64::decode(&self.message_text)?; + let decoded = BASE64.decode(&self.message_text)?; let value = serde_json::from_slice(&decoded)?; Ok(value) } @@ -132,7 +135,7 @@ impl AzureQueueClient { pub async fn enqueue(&self, data: impl Serialize) -> Result<()> { let serialized = serde_json::to_string(&data).unwrap(); let body = quick_xml::se::to_string(&AzureQueueMessageSend { - message_text: base64::encode(&serialized), + message_text: BASE64.encode(&serialized), }) .context("serializing queue message")?; diff --git a/src/proxy-manager/Cargo.lock b/src/proxy-manager/Cargo.lock index a5205a47ba..0abe8bc52c 100644 --- a/src/proxy-manager/Cargo.lock +++ b/src/proxy-manager/Cargo.lock @@ -150,12 +150,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - [[package]] name = "base64" version = "0.21.0" @@ -1174,7 +1168,7 @@ version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ - "base64 0.21.0", + "base64", "bytes", "encoding_rs", "futures-core", @@ -1430,7 +1424,7 @@ dependencies = [ "anyhow", "async-trait", "backoff", - "base64 0.13.0", + "base64", "bincode", "bytes", "derivative",