Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Bump base64 from 0.13.0 to 0.21.0 in /src/agent #2870

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/agent/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/agent/onefuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion src/agent/storage-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 7 additions & 4 deletions src/agent/storage-queue/src/azure_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

// <QueueMessagesList>
// <QueueMessage>
// <MessageId>7d35e47d-f58e-42da-ba4a-9e6ac7e1214d</MessageId>
Expand Down Expand Up @@ -49,7 +52,7 @@ pub struct AzureQueueMessageSend {

impl AzureQueueMessage {
pub fn parse<T>(&self, parser: impl FnOnce(&[u8]) -> Result<T>) -> Result<T> {
let decoded = base64::decode(&self.message_text)?;
let decoded = BASE64.decode(&self.message_text)?;
parser(&decoded)
}

Expand All @@ -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)
}
Expand All @@ -96,7 +99,7 @@ impl AzureQueueMessage {
}

pub fn get<T: DeserializeOwned>(&self) -> Result<T> {
let decoded = base64::decode(&self.message_text)?;
let decoded = BASE64.decode(&self.message_text)?;
let value = serde_json::from_slice(&decoded)?;
Ok(value)
}
Expand Down Expand Up @@ -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")?;

Expand Down
10 changes: 2 additions & 8 deletions src/proxy-manager/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.