Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Split crate in features #278

Merged
merged 1 commit into from
Apr 3, 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
54 changes: 43 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,43 @@ version = "0.8.5"
all-features = true

[features]
native-tls = ["reqwest/default-tls"]
rustls = ["reqwest/rustls-tls"]
default = ["reqwest_request", "services-all"]

reqwest_blocking_request = ["reqwest/blocking"]
native-tls = ["reqwest?/default-tls"]
rustls = ["reqwest?/rustls-tls"]

# requests that reqwest supports
reqwest_blocking_request = ["reqwest?/blocking"]
reqwest_request = ["dep:reqwest"]

# services that reqsign supports
services-all = [
"services-aliyun",
"services-aws",
"services-azblob",
"services-google",
"services-huaweicloud",
"services-tencent",
]

services-aliyun = ["dep:reqwest", "dep:serde", "dep:serde_json"]
services-aws = [
"dep:reqwest",
"dep:serde",
"dep:serde_json",
"dep:quick-xml",
"dep:rust-ini",
]
services-azblob = ["dep:serde", "dep:serde_json"]
services-google = [
"dep:reqwest",
"dep:serde",
"dep:serde_json",
"dep:jsonwebtoken",
"dep:tokio",
]
services-huaweicloud = ["dep:serde", "dep:serde_json"]
services-tencent = ["dep:serde", "dep:serde_json"]

[[bench]]
harness = false
Expand All @@ -24,29 +57,28 @@ name = "aws"
[dependencies]
anyhow = "1"
async-trait = "0.1"
backon = "0.4"
base64 = "0.21"
bytes = "1"
dirs = "5"
form_urlencoded = "1"
hex = "0.4"
hmac = "0.12"
http = "0.2"
jsonwebtoken = "8"
jsonwebtoken = { version = "8", optional = true }
log = "0.4"
once_cell = "1"
percent-encoding = "2"
quick-xml = { version = "0.28", features = ["serialize"] }
quick-xml = { version = "0.28", features = ["serialize"], optional = true }
rand = "0.8.5"
reqwest = { version = "0.11", default-features = false }
reqwest = { version = "0.11", default-features = false, optional = true }
rsa = { version = "0.8.1", features = ["sha2"] }
rust-ini = "0.18"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rust-ini = { version = "0.18", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
sha1 = "0.10"
sha2 = "0.10"
time = { version = "0.3", features = ["macros", "formatting", "parsing"] }
tokio = { version = "1", features = ["fs"] }
tokio = { version = "1", features = ["fs"], optional = true }

[dev-dependencies]
aws-sigv4 = "0.55"
Expand Down
1 change: 0 additions & 1 deletion src/azure/storage/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::fmt::Write;

use ::time::Duration;
use anyhow::anyhow;
use anyhow::Ok;
use anyhow::Result;
use http::header::*;
use log::debug;
Expand Down
13 changes: 12 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,40 @@
//!
//! - `reqwest_request`: Enable to support signing [`reqwest::Request`]
//! - `reqwest_blocking_request`: Enable to support signing [`reqwest::blocking::Request`]
//! - `http_types_request`: Enable to support signing [`http_types::Request`]

// Make sure all our public APIs have docs.
#![warn(missing_docs)]

pub mod credential;

#[cfg(feature = "services-aliyun")]
mod aliyun;
#[cfg(feature = "services-aliyun")]
pub use aliyun::*;

#[cfg(feature = "services-aws")]
mod aws;
#[cfg(feature = "services-aws")]
pub use aws::*;

#[cfg(feature = "services-azblob")]
mod azure;
#[cfg(feature = "services-azblob")]
pub use azure::*;

#[cfg(feature = "services-google")]
mod google;
#[cfg(feature = "services-google")]
pub use google::*;

#[cfg(feature = "services-huaweicloud")]
mod huaweicloud;
#[cfg(feature = "services-huaweicloud")]
pub use huaweicloud::*;

#[cfg(feature = "services-tencent")]
mod tencent;
#[cfg(feature = "services-tencent")]
pub use tencent::*;

mod ctx;
Expand Down