Skip to content

Commit

Permalink
Replace base64 with data-encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Oct 4, 2023
1 parent 6c12eb6 commit 743eaa2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ async-multipart = ["futures-util", "pin-utils"]
doctest = false

[dependencies]
# Follows version used by rustls
base64 = "0.21"
data-encoding = "2.4"
# Follows version used by http
bytes = "1.0"
futures-util = { version = "0.3", optional = true, features = ["io"] }
http = "0.2"
percent-encoding = "2.1"
pin-utils = { version = "0.1.0", optional = true }
ring = { version = "0.16.16", optional = true }
# Keep aligned with rustls
ring = { version = "0.16", optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_urlencoded = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum Error {
#[error("I/O error occurred")]
Io(#[source] IoError),
#[error("Unable to decode base64")]
Base64Decode(#[source] base64::DecodeError),
Base64Decode(#[source] data_encoding::DecodeError),
#[error("Unable to encode url")]
UrlEncode(#[source] serde_urlencoded::ser::Error),
}
Expand Down
3 changes: 1 addition & 2 deletions src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ impl ServiceAccount {
},
);

use base64::Engine;
let key_bytes = base64::engine::general_purpose::STANDARD
let key_bytes = data_encoding::BASE64
.decode(key_string.as_bytes())
.map_err(Error::Base64Decode)?;

Expand Down

0 comments on commit 743eaa2

Please sign in to comment.