From c2a59c94b3116ab9b1d610cb756d40caf7954b45 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Fri, 22 Jul 2022 10:48:22 -0700 Subject: [PATCH 1/2] Bump jsonwebtoken to version 8. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ff87f662..fc867fe0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ dirs = { version = "3.0", optional = true } futures = { version = "0.3", default-features = false } http = "0.2" hyperx = "1" -jsonwebtoken = { version = "7", optional = true } +jsonwebtoken = { version = "8", optional = true } log = "0.4" mime = "0.3" percent-encoding = "2" From 4cbd5d07d3e4ba7cf3a0a3e92c49b7befe090178 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Sat, 20 May 2023 16:08:02 -0700 Subject: [PATCH 2/2] base64 0.21. --- Cargo.toml | 2 +- src/content.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fc867fe0..4e1cd461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ pretty_env_logger = "0.4" tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } [dependencies] -base64 = "0.13" +base64 = "0.21" data-encoding = "2" dirs = { version = "3.0", optional = true } futures = { version = "0.3", default-features = false } diff --git a/src/content.rs b/src/content.rs index 74dcba9b..1276194d 100644 --- a/src/content.rs +++ b/src/content.rs @@ -248,15 +248,19 @@ impl<'de> Deserialize<'de> for DecodedContents { where E: de::Error, { + use base64::engine::{Engine, general_purpose::STANDARD}; // GitHub wraps the base64 to column 60. The base64 crate // doesn't handle whitespace, nor does it take a reader, so we // must unfortunately allocate again and remove all new lines. let v = v.replace("\n", ""); - let decoded = base64::decode_config(&v, base64::STANDARD).map_err(|e| match e { + let decoded = STANDARD.decode(&v).map_err(|e| match e { base64::DecodeError::InvalidLength => { E::invalid_length(v.len(), &"invalid base64 length") } + base64::DecodeError::InvalidPadding => { + E::invalid_length(v.len(), &"invalid base64 padding") + } base64::DecodeError::InvalidByte(offset, byte) => E::invalid_value( de::Unexpected::Bytes(&[byte]), &format!("valid base64 character at offset {}", offset).as_str(),