This is an automated email from the ASF dual-hosted git repository. tison pushed a commit to branch bump-version in repository https://gitbox.apache.org/repos/asf/opendal-reqsign.git
commit c4e902e2dd57f5eecf475cb01452da3a48e91bee Author: tison <[email protected]> AuthorDate: Wed Oct 1 23:06:07 2025 +0800 deps Signed-off-by: tison <[email protected]> --- Cargo.toml | 5 ----- core/Cargo.toml | 1 - core/src/error.rs | 20 ++++++++++++++------ services/aliyun-oss/Cargo.toml | 3 --- services/aliyun-oss/src/sign_request.rs | 8 ++++---- services/aws-v4/Cargo.toml | 4 ---- services/aws-v4/benches/aws.rs | 4 ++-- services/aws-v4/src/sign_request.rs | 1 - services/azure-storage/Cargo.toml | 2 -- services/google/Cargo.toml | 2 -- services/huaweicloud-obs/Cargo.toml | 3 --- services/huaweicloud-obs/src/sign_request.rs | 6 +++--- services/tencent-cos/Cargo.toml | 2 -- 13 files changed, 23 insertions(+), 38 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dceadf1..f8f218d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,6 @@ hmac = "0.12" http = "1" jiff = "0.2" log = "0.4" -macro_rules_attribute = "0.2.0" -once_cell = "1" percent-encoding = "2" pretty_assertions = "1.3" quick-xml = { version = "0.38.1", features = ["serialize"] } @@ -66,8 +64,5 @@ serde = { version = "1", features = ["derive"] } serde_json = { version = "1" } sha1 = "0.10" sha2 = { version = "0.10", features = ["oid"] } -temp-env = "0.3" tempfile = "3.8" -test-case = "3.3.1" -thiserror = "2" tokio = { version = "1", default-features = false } diff --git a/core/Cargo.toml b/core/Cargo.toml index 258e441..117e7e0 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -41,7 +41,6 @@ log = { workspace = true } percent-encoding = { workspace = true } sha1 = { workspace = true } sha2 = { workspace = true } -thiserror = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] windows-sys = { version = "0.61.0", features = [ diff --git a/core/src/error.rs b/core/src/error.rs index c73faee..5a182e0 100644 --- a/core/src/error.rs +++ b/core/src/error.rs @@ -16,11 +16,8 @@ // under the License. use std::fmt; -use thiserror::Error; /// The error type for reqsign operations -#[derive(Error)] -#[error("{message}")] pub struct Error { /// The category of error that occurred kind: ErrorKind, @@ -29,7 +26,6 @@ pub struct Error { message: String, /// The underlying error source - #[source] source: Option<anyhow::Error>, /// Additional context information for debugging @@ -153,6 +149,12 @@ impl Error { } } +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.message) + } +} + // Custom Debug implementation for better error display impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -173,6 +175,12 @@ impl fmt::Debug for Error { } } +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + self.source.as_ref().map(|e| e.as_ref()) + } +} + impl fmt::Display for ErrorKind { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -196,8 +204,8 @@ impl From<anyhow::Error> for Error { } } -impl From<std::fmt::Error> for Error { - fn from(err: std::fmt::Error) -> Self { +impl From<fmt::Error> for Error { + fn from(err: fmt::Error) -> Self { Self::unexpected(err.to_string()).with_source(err) } } diff --git a/services/aliyun-oss/Cargo.toml b/services/aliyun-oss/Cargo.toml index 880fc98..fbbc124 100644 --- a/services/aliyun-oss/Cargo.toml +++ b/services/aliyun-oss/Cargo.toml @@ -32,7 +32,6 @@ async-trait = { workspace = true } http = { workspace = true } jiff = { workspace = true } log = { workspace = true } -once_cell = { workspace = true } percent-encoding = { workspace = true } reqsign-core = { workspace = true } reqwest = { workspace = true, features = ["json"] } @@ -42,9 +41,7 @@ serde_json = { workspace = true } [dev-dependencies] dotenv = { workspace = true } env_logger = { workspace = true } -once_cell = { workspace = true } reqsign-file-read-tokio = { workspace = true } reqsign-http-send-reqwest = { workspace = true } reqwest = { workspace = true, features = ["rustls-tls"] } -temp-env = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/services/aliyun-oss/src/sign_request.rs b/services/aliyun-oss/src/sign_request.rs index fe69a65..e159439 100644 --- a/services/aliyun-oss/src/sign_request.rs +++ b/services/aliyun-oss/src/sign_request.rs @@ -19,7 +19,6 @@ use crate::credential::Credential; use async_trait::async_trait; use http::HeaderValue; use http::header::{AUTHORIZATION, CONTENT_TYPE, DATE}; -use once_cell::sync::Lazy; use percent_encoding::utf8_percent_encode; use reqsign_core::Result; use reqsign_core::hash::base64_hmac_sha1; @@ -27,6 +26,7 @@ use reqsign_core::time::{Timestamp, format_http_date, now}; use reqsign_core::{Context, SignRequest}; use std::collections::HashSet; use std::fmt::Write; +use std::sync::LazyLock; use std::time::Duration; const CONTENT_MD5: &str = "content-md5"; @@ -351,11 +351,11 @@ impl RequestSigner { } fn is_sub_resource(key: &str) -> bool { - SUB_RESOURCES.contains(key) + SUBRESOURCES.contains(key) } -/// This list is copied from <https://github.com/aliyun/aliyun-oss-go-sdk/blob/master/oss/conn.go> -static SUB_RESOURCES: Lazy<HashSet<&'static str>> = Lazy::new(|| { +// This list is copied from https://github.com/aliyun/aliyun-oss-go-sdk/blob/b6e0a2ae/oss/conn.go#L31-L54 +static SUBRESOURCES: LazyLock<HashSet<&'static str>> = LazyLock::new(|| { HashSet::from([ "acl", "uploads", diff --git a/services/aws-v4/Cargo.toml b/services/aws-v4/Cargo.toml index 97216d3..84b1af9 100644 --- a/services/aws-v4/Cargo.toml +++ b/services/aws-v4/Cargo.toml @@ -54,15 +54,11 @@ criterion = { workspace = true } dotenv = { workspace = true } env_logger = { workspace = true } hex = { workspace = true } -macro_rules_attribute = { workspace = true } -once_cell = { workspace = true } pretty_assertions = { workspace = true } reqsign-http-send-reqwest = { workspace = true } reqwest = { workspace = true, features = ["rustls-tls"] } sha2 = { workspace = true } -temp-env = { workspace = true } tempfile = { workspace = true } -test-case = { workspace = true } tokio = { workspace = true, features = ["full"] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] diff --git a/services/aws-v4/benches/aws.rs b/services/aws-v4/benches/aws.rs index c74add0..3d484d4 100644 --- a/services/aws-v4/benches/aws.rs +++ b/services/aws-v4/benches/aws.rs @@ -15,6 +15,7 @@ // specific language governing permissions and limitations // under the License. +use std::sync::LazyLock; use std::time::SystemTime; use aws_sigv4::http_request::PayloadChecksumKind; @@ -26,7 +27,6 @@ use aws_sigv4::sign::v4::SigningParams; use criterion::Criterion; use criterion::criterion_group; use criterion::criterion_main; -use once_cell::sync::Lazy; use reqsign_aws_v4::Credential as AwsCredential; use reqsign_aws_v4::RequestSigner as AwsV4RequestSigner; use reqsign_core::{Context, SignRequest}; @@ -36,7 +36,7 @@ use reqsign_http_send_reqwest::ReqwestHttpSend; criterion_group!(benches, bench); criterion_main!(benches); -static RUNTIME: Lazy<tokio::runtime::Runtime> = Lazy::new(|| { +static RUNTIME: LazyLock<tokio::runtime::Runtime> = LazyLock::new(|| { tokio::runtime::Builder::new_multi_thread() .worker_threads(1) .enable_all() diff --git a/services/aws-v4/src/sign_request.rs b/services/aws-v4/src/sign_request.rs index 7516ea4..8b9e734 100644 --- a/services/aws-v4/src/sign_request.rs +++ b/services/aws-v4/src/sign_request.rs @@ -361,7 +361,6 @@ fn generate_signing_key(secret: &str, time: Timestamp, region: &str, service: &s // Sign service let sign_service = hmac_sha256(sign_region.as_slice(), service.as_bytes()); // Sign request - hmac_sha256(sign_service.as_slice(), "aws4_request".as_bytes()) } diff --git a/services/azure-storage/Cargo.toml b/services/azure-storage/Cargo.toml index 3c0acad..210807e 100644 --- a/services/azure-storage/Cargo.toml +++ b/services/azure-storage/Cargo.toml @@ -40,7 +40,6 @@ reqsign-core = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } sha1 = { workspace = true } -sha2 = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] jsonwebtoken = "9.2" @@ -49,7 +48,6 @@ rsa = { workspace = true } [dev-dependencies] async-trait = { workspace = true } -dotenv = { workspace = true } env_logger = { workspace = true } reqsign-command-execute-tokio = { workspace = true } reqsign-file-read-tokio = { workspace = true } diff --git a/services/google/Cargo.toml b/services/google/Cargo.toml index 05c56f6..44e8a45 100644 --- a/services/google/Cargo.toml +++ b/services/google/Cargo.toml @@ -44,10 +44,8 @@ sha2 = { workspace = true } [dev-dependencies] dotenv = { workspace = true } env_logger = { workspace = true } -pretty_assertions = { workspace = true } reqsign-file-read-tokio = { workspace = true } reqsign-http-send-reqwest = { workspace = true } reqwest = { workspace = true, features = ["rustls-tls"] } sha2 = { workspace = true } -temp-env = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/services/huaweicloud-obs/Cargo.toml b/services/huaweicloud-obs/Cargo.toml index 923ee10..eb6c8f7 100644 --- a/services/huaweicloud-obs/Cargo.toml +++ b/services/huaweicloud-obs/Cargo.toml @@ -32,14 +32,11 @@ async-trait = { workspace = true } http = { workspace = true } jiff = { workspace = true } log = { workspace = true } -once_cell = { workspace = true } percent-encoding = { workspace = true } reqsign-core = { workspace = true } [dev-dependencies] env_logger = { workspace = true } -once_cell = { workspace = true } reqsign-file-read-tokio = { workspace = true } reqsign-http-send-reqwest = { workspace = true } -temp-env = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/services/huaweicloud-obs/src/sign_request.rs b/services/huaweicloud-obs/src/sign_request.rs index 27c40ca..f1beb57 100644 --- a/services/huaweicloud-obs/src/sign_request.rs +++ b/services/huaweicloud-obs/src/sign_request.rs @@ -18,6 +18,7 @@ //! Huawei Cloud Object Storage Service (OBS) builder use std::collections::HashSet; use std::fmt::Write; +use std::sync::LazyLock; use std::time::Duration; use http::HeaderValue; @@ -25,7 +26,6 @@ use http::header::AUTHORIZATION; use http::header::CONTENT_TYPE; use http::header::DATE; use log::debug; -use once_cell::sync::Lazy; use percent_encoding::utf8_percent_encode; use reqsign_core::Result; @@ -244,8 +244,8 @@ fn is_sub_resource(param: &str) -> bool { SUBRESOURCES.contains(param) } -// Please attention: the subsources are case sensitive. -static SUBRESOURCES: Lazy<HashSet<&'static str>> = Lazy::new(|| { +// Please attention: the subresources are case-sensitive. +static SUBRESOURCES: LazyLock<HashSet<&'static str>> = LazyLock::new(|| { HashSet::from([ "CDNNotifyConfiguration", "acl", diff --git a/services/tencent-cos/Cargo.toml b/services/tencent-cos/Cargo.toml index 714e798..e1418ea 100644 --- a/services/tencent-cos/Cargo.toml +++ b/services/tencent-cos/Cargo.toml @@ -40,10 +40,8 @@ serde_json = { workspace = true } [dev-dependencies] dotenv = { workspace = true } env_logger = { workspace = true } -once_cell = { workspace = true } reqsign-core = { workspace = true } reqsign-file-read-tokio = { workspace = true } reqsign-http-send-reqwest = { workspace = true } reqwest = { workspace = true, features = ["rustls-tls"] } -temp-env = { workspace = true } tokio = { workspace = true, features = ["full"] }
