Skip to content

Commit 423859e

Browse files
authored
Merge pull request #74 from AaronDewes/bump-base64
Update to base64 0.22.1
2 parents 594a305 + e6eb8e5 commit 423859e

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

Cargo-minimal.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ dependencies = [
3232

3333
[[package]]
3434
name = "base64"
35-
version = "0.13.1"
35+
version = "0.21.7"
3636
source = "registry+https://github.com/rust-lang/crates.io-index"
37-
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
37+
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
3838

3939
[[package]]
4040
name = "base64"
41-
version = "0.21.7"
41+
version = "0.22.1"
4242
source = "registry+https://github.com/rust-lang/crates.io-index"
43-
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
43+
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
4444

4545
[[package]]
4646
name = "bech32"
@@ -282,7 +282,7 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
282282
name = "jsonrpc"
283283
version = "0.18.0"
284284
dependencies = [
285-
"base64 0.13.1",
285+
"base64 0.22.1",
286286
"minreq",
287287
"serde",
288288
"serde_json",

Cargo-recent.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ dependencies = [
3232

3333
[[package]]
3434
name = "base64"
35-
version = "0.13.1"
35+
version = "0.21.7"
3636
source = "registry+https://github.com/rust-lang/crates.io-index"
37-
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
37+
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
3838

3939
[[package]]
4040
name = "base64"
41-
version = "0.21.7"
41+
version = "0.22.1"
4242
source = "registry+https://github.com/rust-lang/crates.io-index"
43-
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
43+
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
4444

4545
[[package]]
4646
name = "bech32"
@@ -282,7 +282,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
282282
name = "jsonrpc"
283283
version = "0.18.0"
284284
dependencies = [
285-
"base64 0.13.1",
285+
"base64 0.22.1",
286286
"minreq",
287287
"serde",
288288
"serde_json",

jsonrpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ proxy = ["socks"]
3333
serde = { version = "1", features = ["derive"] }
3434
serde_json = { version = "1", features = [ "raw_value" ] }
3535

36-
base64 = { version = "0.13.0", optional = true }
36+
base64 = { version = "0.22.1", optional = true }
3737
minreq = { version = "2.7.0", features = ["json-using-serde"], optional = true }
3838
socks = { version = "0.3.4", optional = true}
3939

jsonrpc/src/http/minreq_http.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ use std::{error, fmt};
1313
use crate::client::Transport;
1414
use crate::{Request, Response};
1515

16+
use base64::engine::general_purpose::STANDARD as BASE64;
17+
use base64::Engine;
18+
1619
const DEFAULT_URL: &str = "http://localhost";
1720
const DEFAULT_PORT: u16 = 8332; // the default RPC port for bitcoind.
1821
#[cfg(not(jsonrpc_fuzz))]
@@ -123,7 +126,7 @@ impl Builder {
123126
if let Some(ref pass) = pass {
124127
s.push_str(pass.as_ref());
125128
}
126-
self.tp.basic_auth = Some(format!("Basic {}", &base64::encode(s.as_bytes())));
129+
self.tp.basic_auth = Some(format!("Basic {}", &BASE64.encode(s.as_bytes())));
127130
self
128131
}
129132

@@ -144,7 +147,7 @@ impl Builder {
144147
/// let client = MinreqHttpTransport::builder().cookie_auth(cookie);
145148
/// ```
146149
pub fn cookie_auth<S: AsRef<str>>(mut self, cookie: S) -> Self {
147-
self.tp.basic_auth = Some(format!("Basic {}", &base64::encode(cookie.as_ref().as_bytes())));
150+
self.tp.basic_auth = Some(format!("Basic {}", &BASE64.encode(cookie.as_ref().as_bytes())));
148151
self
149152
}
150153

jsonrpc/src/http/simple_http.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ use std::sync::{Arc, Mutex, MutexGuard};
1414
use std::time::Duration;
1515
use std::{error, fmt, io, net, num};
1616

17+
use base64::engine::general_purpose::STANDARD as BASE64;
18+
use base64::Engine;
19+
1720
#[cfg(feature = "proxy")]
1821
use socks::Socks5Stream;
1922

@@ -377,13 +380,13 @@ impl Builder {
377380
if let Some(ref pass) = pass {
378381
auth.push_str(pass.as_ref());
379382
}
380-
self.tp.basic_auth = Some(format!("Basic {}", &base64::encode(auth.as_bytes())));
383+
self.tp.basic_auth = Some(format!("Basic {}", &BASE64.encode(auth.as_bytes())));
381384
self
382385
}
383386

384387
/// Adds authentication information to the transport using a cookie string ('user:pass').
385388
pub fn cookie_auth<S: AsRef<str>>(mut self, cookie: S) -> Self {
386-
self.tp.basic_auth = Some(format!("Basic {}", &base64::encode(cookie.as_ref().as_bytes())));
389+
self.tp.basic_auth = Some(format!("Basic {}", &BASE64.encode(cookie.as_ref().as_bytes())));
387390
self
388391
}
389392

0 commit comments

Comments
 (0)