Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
fail-fast: true
matrix:
rust:
- 1.60.0
- stable
- beta
- nightly
Expand All @@ -30,6 +31,7 @@ jobs:
fail-fast: true
matrix:
rust:
- 1.60.0
- stable
- beta
- nightly
Expand Down
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ keywords = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-trait = { version = "^0.1.58", optional = true }
base64 = { version = "^0.13.1", optional = true }
bytes = { version = "^1.3.0", features = ["serde"], optional = true }
async-trait = { version = "^0.1.66", optional = true }
base64 = { version = "^0.21.0", optional = true }
bytes = { version = "^1.4.0", features = ["serde"], optional = true }
cidr = { version = "^0.2.1", optional = true }
crypto-common = { version = "^0.1.6", optional = true }
headers = { version = "^0.3.8", optional = true }
hmac = { version = "^0.12.1", features = ["std"], optional = true }
hyper = { version = "^0.14.23", default-features = false, optional = true }
hyper = { version = "^0.14.24", default-features = false, optional = true }
hyper-tls = { version = "^0.5.0", optional = true }
hyper-proxy = { version = "^0.9.1", default-features = false, features = ["tls"], optional = true }
lazy_static = { version = "^1.4.0", optional = true }
log = { version = "^0.4.17", optional = true }
prometheus = { version = "^0.13.3", optional = true }
serde = { version = "^1.0.147", features = ["derive"], optional = true }
serde_json = { version = "^1.0.88", features = [
serde = { version = "^1.0.152", features = ["derive"], optional = true }
serde_json = { version = "^1.0.94", features = [
"preserve_order",
"float_roundtrip",
], optional = true }
sha2 = { version = "^0.10.6", optional = true }
thiserror = { version = "^1.0.37", optional = true }
thiserror = { version = "^1.0.39", optional = true }
tracing = { version = "^0.1.37", optional = true }
tracing-futures = { version = "^0.2.5", optional = true }
url = { version = "^2.3.1", default-features = false, features = ["serde"], optional = true }
urlencoding = { version = "^2.1.2", optional = true }
uuid = { version = "^1.2.2", features = ["serde", "v4"], optional = true }
uuid = { version = "^1.3.0", features = ["serde", "v4"], optional = true }

[features]
default = ["client", "proxy", "logging"]
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.60.0
21 changes: 11 additions & 10 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::{
};

use async_trait::async_trait;
use base64::{engine::general_purpose::STANDARD as BASE64_ENGINE, Engine};
use bytes::Buf;
use crypto_common::InvalidLength;
use hmac::{Hmac, Mac};
Expand Down Expand Up @@ -242,15 +243,6 @@ impl OAuth1 for Signer {
params
}

#[cfg_attr(feature = "trace", tracing::instrument)]
fn signing_key(&self) -> String {
format!(
"{}&{}",
urlencoding::encode(&self.credentials.consumer_secret.to_owned()),
urlencoding::encode(&self.credentials.secret.to_owned())
)
}

#[cfg_attr(feature = "trace", tracing::instrument)]
fn signature(&self, method: &str, endpoint: &str) -> Result<String, Self::Error> {
let (host, query) = match endpoint.find(|c| '?' == c) {
Expand Down Expand Up @@ -294,7 +286,16 @@ impl OAuth1 for Signer {
hasher.update(base.as_bytes());

let digest = hasher.finalize().into_bytes();
Ok(base64::encode(digest.as_slice()))
Ok(BASE64_ENGINE.encode(digest.as_slice()))
}

#[cfg_attr(feature = "trace", tracing::instrument)]
fn signing_key(&self) -> String {
format!(
"{}&{}",
urlencoding::encode(&self.credentials.consumer_secret.to_owned()),
urlencoding::encode(&self.credentials.secret.to_owned())
)
}
}

Expand Down