This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal-reqsign.git
The following commit(s) were added to refs/heads/main by this push:
new 282b5dc chore: bump version and fix up metadata (#642)
282b5dc is described below
commit 282b5dc716af0f788c50802229652d342e97a33e
Author: tison <[email protected]>
AuthorDate: Thu Oct 2 00:02:19 2025 +0800
chore: bump version and fix up metadata (#642)
This closes https://github.com/apache/opendal-reqsign/pull/640.
---------
Signed-off-by: tison <[email protected]>
Co-authored-by: SuzuyaXJZ <[email protected]>
---
.github/FUNDING.yml | 18 ----
CHANGELOG.md | 111 ---------------------
Cargo.toml | 38 ++++---
context/command-execute-tokio/Cargo.toml | 17 ++--
context/file-read-tokio/Cargo.toml | 19 ++--
context/http-send-reqwest/Cargo.toml | 25 +++--
core/Cargo.toml | 37 ++++---
core/src/context.rs | 26 ++---
core/src/error.rs | 20 ++--
core/src/hash.rs | 2 +-
core/src/request.rs | 8 +-
reqsign/Cargo.toml | 15 +--
reqsign/src/aliyun.rs | 2 +-
reqsign/src/aws.rs | 2 +-
reqsign/src/azure.rs | 2 +-
reqsign/src/google.rs | 2 +-
reqsign/src/huaweicloud.rs | 2 +-
reqsign/src/oracle.rs | 2 +-
reqsign/src/tencent.rs | 2 +-
rust-toolchain.toml | 2 +-
rustfmt.toml | 2 +-
services/aliyun-oss/Cargo.toml | 37 ++++---
services/aliyun-oss/examples/oss_operations.rs | 4 +-
services/aliyun-oss/src/credential.rs | 4 +-
.../provide_credential/assume_role_with_oidc.rs | 4 +-
.../aliyun-oss/src/provide_credential/default.rs | 2 +-
services/aliyun-oss/src/provide_credential/env.rs | 2 +-
services/aliyun-oss/src/sign_request.rs | 14 +--
services/aliyun-oss/tests/main.rs | 4 +-
services/aws-v4/Cargo.toml | 52 +++++-----
services/aws-v4/benches/aws.rs | 6 +-
services/aws-v4/src/credential.rs | 4 +-
.../aws-v4/src/provide_credential/assume_role.rs | 7 +-
.../assume_role_with_web_identity.rs | 8 +-
services/aws-v4/src/provide_credential/default.rs | 2 +-
services/aws-v4/src/provide_credential/env.rs | 2 +-
services/aws-v4/src/provide_credential/imds.rs | 6 +-
services/aws-v4/src/provide_credential/profile.rs | 2 +-
.../src/provide_credential/s3_express_session.rs | 2 +-
services/aws-v4/src/provide_credential/sso.rs | 2 +-
services/aws-v4/src/sign_request.rs | 11 +-
services/aws-v4/tests/credential_providers/ecs.rs | 4 +-
services/aws-v4/tests/signing/special_chars.rs | 2 +-
services/azure-storage/Cargo.toml | 48 +++++----
services/azure-storage/src/account_sas.rs | 5 +-
services/azure-storage/src/credential.rs | 4 +-
.../src/provide_credential/client_certificate.rs | 4 +-
.../src/provide_credential/default.rs | 2 +-
services/azure-storage/src/sign_request.rs | 45 +++++----
services/google/Cargo.toml | 44 ++++----
services/google/src/credential.rs | 2 +-
.../src/provide_credential/authorized_user.rs | 2 +-
.../src/provide_credential/external_account.rs | 4 +-
.../impersonated_service_account.rs | 2 +-
.../src/provide_credential/static_provider.rs | 2 +-
.../google/src/provide_credential/vm_metadata.rs | 2 +-
services/google/src/sign_request.rs | 6 +-
services/huaweicloud-obs/Cargo.toml | 31 +++---
services/huaweicloud-obs/src/credential.rs | 2 +-
.../huaweicloud-obs/src/provide_credential/env.rs | 2 +-
services/huaweicloud-obs/src/sign_request.rs | 14 +--
services/oracle/Cargo.toml | 30 +++---
services/oracle/src/config.rs | 2 +-
services/oracle/src/credential.rs | 4 +-
.../oracle/src/provide_credential/config_file.rs | 2 +-
services/oracle/src/provide_credential/default.rs | 2 +-
services/oracle/src/provide_credential/env.rs | 2 +-
services/oracle/src/sign_request.rs | 8 +-
services/tencent-cos/Cargo.toml | 40 ++++----
services/tencent-cos/src/credential.rs | 4 +-
.../assume_role_with_web_identity.rs | 50 +++++-----
.../tencent-cos/src/provide_credential/default.rs | 2 +-
services/tencent-cos/src/provide_credential/env.rs | 2 +-
services/tencent-cos/src/sign_request.rs | 9 +-
services/tencent-cos/tests/main.rs | 6 +-
75 files changed, 407 insertions(+), 512 deletions(-)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index 31991e8..0000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-github: [Xuanwo]
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 99b9ed0..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,111 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/)
-and this project adheres to [Semantic Versioning](https://semver.org/).
-
-<!-- Release notes generated with: gh release create v_draft --generate-notes
--draft -->
-
-## v1.0.0 - 2025-09-01
-
-* chore(deps): Update quick-xml requirement from 0.35 to 0.36 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/456
-* feat(azure): implement client secret auth for azure by @twuebi in
https://github.com/Xuanwo/reqsign/pull/457
-* feat: add Sign trait by @flaneur2020 in
https://github.com/Xuanwo/reqsign/pull/459
-* chore(deps): Bump google-github-actions/auth from 2.1.3 to 2.1.4 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/461
-* ci: Disable azure client secrets test if not set by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/462
-* refactor!: remove SignableRequest by @flaneur2020 in
https://github.com/Xuanwo/reqsign/pull/463
-* fix: readme about signing Parts instead of Request by @flaneur2020 in
https://github.com/Xuanwo/reqsign/pull/464
-* AWS S3: Add support for assume role duration seconds by @rahull-p in
https://github.com/Xuanwo/reqsign/pull/466
-* refactor: Remove not needed features by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/468
-* docs: correct signer term usage by @jdockerty in
https://github.com/Xuanwo/reqsign/pull/469
-* Add support for assume role session tags by @rahull-p in
https://github.com/Xuanwo/reqsign/pull/470
-* refactor: Split into workspace by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/471
-* refactor: Split reqsign aws v4 crate by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/472
-* refactor: Split reqsign-aliyun-oss crate by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/473
-* refactor: Split reqsign-azure-storage by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/474
-* chore(deps): Bump google-github-actions/auth from 2.1.4 to 2.1.5 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/475
-* refactor: Split google into seperate crate by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/477
-* refactor: Split huaweicloud obs to a new crate by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/478
-* refactor: Split tencent cos in new crate by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/479
-* refactor: Split oracle into seperate crate by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/480
-* refactor: Remove not used dep by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/481
-* feat: Introduce Signer along with Load/Build/Context by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/482
-* chore: Remove not used hash `sha256` by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/483
-* feat: Add FileRead and HttpSend by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/484
-* chore: Remove tokio from reqsign by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/485
-* refactor: Rename to Key to better represents credentails and token by
@Xuanwo in https://github.com/Xuanwo/reqsign/pull/486
-* feat: Add context in Load and Build by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/487
-* feat: Add Env in context by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/488
-* refactor(services/aws-v4): Use context env instead by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/489
-* refactor: Depends on reqsign-core internally by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/490
-* refactor: Split crates into services and context by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/491
-* refactor: Make core's API more clear by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/492
-* chore(deps): Bump google-github-actions/auth from 2.1.5 to 2.1.6 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/493
-* feat: parse endpoint_url from profile and env by @TennyZhuang in
https://github.com/Xuanwo/reqsign/pull/497
-* chore(deps): Bump google-github-actions/auth from 2.1.6 to 2.1.7 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/496
-* chore(deps): Update quick-xml requirement from 0.36 to 0.37 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/495
-* refactor: Migrate aws-v4 to new design by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/502
-* Percent encoding query params for aliyun OSS by @photino in
https://github.com/Xuanwo/reqsign/pull/507
-* chore: Address CI by @Xuanwo in https://github.com/Xuanwo/reqsign/pull/510
-* fix: Aliyun should not encode query like `start-after` by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/517
-* refactor(aliyun): Migrate to reqsign-core based by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/529
-* refactor: Migrate azure storage to core based by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/530
-* refactor: Use enum for azure credential by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/531
-* refactor: Refactor google to core based by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/532
-* refactor: Migrate huaweicloud obs to core based by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/533
-* refactor: Refactor oracle into core based by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/534
-* refactor: Refactor tencent cos to be core based by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/536
-* refactor: Ensure to use file_read and env from context by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/537
-* refactor: Rename Load to ProvideCredential by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/538
-* refactor: Rename Build to SignRequest by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/539
-* refactor: Rename Key to SigningCredential by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/540
-* docs: Add README and examples for crates by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/541
-* refactor: Ensure all credentials are redacted by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/542
-* chore(deps): Update windows-sys requirement from 0.59.0 to 0.60.2 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/527
-* chore(deps): Update criterion requirement from 0.5 to 0.6 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/521
-* chore(deps): Bump google-github-actions/auth from 2.1.7 to 2.1.10 by
@dependabot[bot] in https://github.com/Xuanwo/reqsign/pull/520
-* refactor: Project Layout by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/543
-* refactor: Allow gcs to support both service account and token by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/544
-* refactor: Refactor RawCredential for better names by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/545
-* refactor: Use correct name for filename and fields by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/546
-* docs: Update README with new API by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/547
-* chore: Cleanup code by @Xuanwo in https://github.com/Xuanwo/reqsign/pull/548
-* feat: Add reqsign as wrapper for core by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/549
-* refactor: Introduce provide credentail chain for aws v4 by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/550
-* refactor: Add credential chain for aliyun oss by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/551
-* refactor: Introduce credential chain for azure-storage by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/552
-* refactor: Introduce credential chain for google by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/553
-* refactor: Introduce credential chain for huaweicloud-obs by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/554
-* refactor: Introduce credential chain for oracle and cos by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/555
-* feat: Introduce error handling for reqsign by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/556
-* refactor: Split config credential provider into env,profile,static by
@Xuanwo in https://github.com/Xuanwo/reqsign/pull/557
-* refactor: Remove the concept of config by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/559
-* refactor: Polish the API for aws-v4 by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/560
-* refactor(services/aliyun): Remove the concept of config by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/561
-* refactor(services/azure-storage): Remove the concept of azure-storage by
@Xuanwo in https://github.com/Xuanwo/reqsign/pull/562
-* chore: Cleanup API design by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/563
-* refactor(google): Remove the config concept by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/564
-* refactor(services): Remove the config concepts by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/565
-* feat: Support coginto, ecs, process, sso provider by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/567
-* feat(services/azure): Add AzureCli credential provider by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/568
-* feat(services/azure-storage): Add Client Certificate support by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/569
-* feat(services/azure-storage): Add Azure Piplelines support by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/570
-* chore: Make clippy happy by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/584
-* feat: Add s3 express create session support by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/583
-* chore: upgrade and tidy dependencies by @tisonkun in
https://github.com/Xuanwo/reqsign/pull/588
-* refactor: Refactor s3 tests for different providers by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/586
-* chore(deps): Bump actions/checkout from 4 to 5 by @dependabot[bot] in
https://github.com/Xuanwo/reqsign/pull/589
-* refactor: Refactor reqsign error and aws-v4 usage by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/591
-* refactor: Return reqsign error instead of anyhow by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/592
-* feat: Add CommandExecute in Context by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/593
-* feat(services/aws-v4): Add test for s3 express session by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/596
-* feat: Add integration tests for azure storage by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/597
-* feat(services/aws-v4): Add direct configuration support to
ECSCredentialProvider by @jackye1995 in
https://github.com/Xuanwo/reqsign/pull/598
-* refactor: Add tests for gcs by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/600
-* chore: Set all packages version to 1.0 by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/601
-* refactor: Implement DefaultContext and DefaultSigner by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/602
-* fix: Update repository URL in Cargo.toml by @kingsword09 in
https://github.com/Xuanwo/reqsign/pull/603
-* chore(deps): Bump google-github-actions/auth from 2 to 3 by @dependabot[bot]
in https://github.com/Xuanwo/reqsign/pull/604
-* chore: Using workspace member instead by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/605
-* ci: Add release workflow by @Xuanwo in
https://github.com/Xuanwo/reqsign/pull/606
diff --git a/Cargo.toml b/Cargo.toml
index 90c7dbd..f8f218d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,14 +20,26 @@ members = ["core", "context/*", "services/*", "reqsign"]
resolver = "2"
[workspace.package]
-categories = ["command-line-utilities", "web-programming"]
-description = "Signing API requests without effort."
-documentation = "https://docs.rs/reqsign"
-edition = "2021"
+edition = "2024"
license = "Apache-2.0"
repository = "https://github.com/Xuanwo/reqsign"
+rust-version = "1.85.0"
[workspace.dependencies]
+# Workspace dependencies
+reqsign-aliyun-oss = { version = "1.1.0", path = "services/aliyun-oss" }
+reqsign-aws-v4 = { version = "1.1.0", path = "services/aws-v4" }
+reqsign-azure-storage = { version = "1.1.0", path = "services/azure-storage" }
+reqsign-command-execute-tokio = { version = "1.1.0", path =
"context/command-execute-tokio" }
+reqsign-core = { version = "1.1.0", path = "core" }
+reqsign-file-read-tokio = { version = "1.1.0", path =
"context/file-read-tokio" }
+reqsign-google = { version = "1.1.0", path = "services/google" }
+reqsign-http-send-reqwest = { version = "1.1.0", path =
"context/http-send-reqwest" }
+reqsign-huaweicloud-obs = { version = "1.1.0", path =
"services/huaweicloud-obs" }
+reqsign-oracle = { version = "1.1.0", path = "services/oracle" }
+reqsign-tencent-cos = { version = "1.1.0", path = "services/tencent-cos" }
+
+# Crates.io dependencies
anyhow = "1"
async-trait = "0.1"
base64 = "0.22"
@@ -41,23 +53,10 @@ 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"] }
-rand = "0.8.5"
-reqsign-aliyun-oss = { version = "1.0.0", path = "services/aliyun-oss" }
-reqsign-aws-v4 = { version = "1.0.0", path = "services/aws-v4" }
-reqsign-azure-storage = { version = "1.0.0", path = "services/azure-storage" }
-reqsign-command-execute-tokio = { version = "1.0.0", path =
"context/command-execute-tokio" }
-reqsign-core = { version = "1.0.0", path = "core" }
-reqsign-file-read-tokio = { version = "1.0.0", path =
"context/file-read-tokio" }
-reqsign-google = { version = "1.0.0", path = "services/google" }
-reqsign-http-send-reqwest = { version = "1.0.0", path =
"context/http-send-reqwest" }
-reqsign-huaweicloud-obs = { version = "1.0.0", path =
"services/huaweicloud-obs" }
-reqsign-oracle = { version = "1.0.0", path = "services/oracle" }
-reqsign-tencent-cos = { version = "1.0.0", path = "services/tencent-cos" }
+rand = { version = "0.8.5" }
reqwest = { version = "0.12", default-features = false }
rsa = { version = "0.9.2", features = ["pkcs5", "sha2"] }
rust-ini = { version = "0.21" }
@@ -65,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/context/command-execute-tokio/Cargo.toml
b/context/command-execute-tokio/Cargo.toml
index df9937a..c4981dc 100644
--- a/context/command-execute-tokio/Cargo.toml
+++ b/context/command-execute-tokio/Cargo.toml
@@ -16,18 +16,21 @@
# under the License.
[package]
+name = "reqsign-command-execute-tokio"
+version = "1.1.0"
+
categories = ["asynchronous"]
description = "Tokio-based command execution implementation for reqsign"
-edition = "2021"
keywords = ["command", "tokio", "reqsign", "async"]
-license = "Apache-2.0"
-name = "reqsign-command-execute-tokio"
-repository = "https://github.com/apache/opendal-reqsign"
-version = "1.0.0"
+
+edition.workspace = true
+license.workspace = true
+repository.workspace = true
+rust-version.workspace = true
[dependencies]
-async-trait = "0.1"
-reqsign-core.workspace = true
+async-trait = { workspace = true }
+reqsign-core = { workspace = true }
tokio = { version = "1", features = ["process", "io-util"] }
[dev-dependencies]
diff --git a/context/file-read-tokio/Cargo.toml
b/context/file-read-tokio/Cargo.toml
index 710790d..417e6a0 100644
--- a/context/file-read-tokio/Cargo.toml
+++ b/context/file-read-tokio/Cargo.toml
@@ -16,19 +16,22 @@
# under the License.
[package]
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
+name = "reqsign-file-read-tokio"
+version = "1.1.0"
+
+categories = ["asynchronous"]
+description = "Tokio-based file reader implementation for reqsign"
+keywords = ["command", "tokio", "reqsign", "async"]
+
edition.workspace = true
license.workspace = true
-name = "reqsign-file-read-tokio"
repository.workspace = true
-version = "1.0.0"
+rust-version.workspace = true
[dependencies]
-anyhow = "1"
-async-trait = "0.1"
-reqsign-core.workspace = true
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+reqsign-core = { workspace = true }
tokio = { version = "1", features = ["fs"] }
[dev-dependencies]
diff --git a/context/http-send-reqwest/Cargo.toml
b/context/http-send-reqwest/Cargo.toml
index b960466..9b361b5 100644
--- a/context/http-send-reqwest/Cargo.toml
+++ b/context/http-send-reqwest/Cargo.toml
@@ -16,22 +16,25 @@
# under the License.
[package]
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
+name = "reqsign-http-send-reqwest"
+version = "1.1.0"
+
+categories = ["asynchronous"]
+description = "Reqwest-based HTTP client implementation for reqsign."
+keywords = ["command", "http", "reqsign", "async"]
+
edition.workspace = true
license.workspace = true
-name = "reqsign-http-send-reqwest"
repository.workspace = true
-version = "1.0.0"
+rust-version.workspace = true
[dependencies]
-anyhow = "1"
-async-trait = "0.1"
-bytes.workspace = true
-http.workspace = true
-http-body-util = "0.1.2"
-reqsign-core.workspace = true
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+bytes = { workspace = true }
+http = { workspace = true }
+http-body-util = { version = "0.1.3" }
+reqsign-core = { workspace = true }
reqwest = { workspace = true, default-features = false }
[dev-dependencies]
diff --git a/core/Cargo.toml b/core/Cargo.toml
index e0f5037..117e7e0 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -17,31 +17,30 @@
[package]
name = "reqsign-core"
-version = "1.0.0"
+version = "1.1.0"
+
+categories = ["command-line-utilities", "web-programming"]
+description = "Signing API requests without effort."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
-
+rust-version.workspace = true
[dependencies]
-anyhow.workspace = true
-async-trait.workspace = true
-base64.workspace = true
-bytes.workspace = true
-form_urlencoded.workspace = true
-hex.workspace = true
-hmac.workspace = true
-http.workspace = true
-jiff.workspace = true
-log.workspace = true
-percent-encoding.workspace = true
-sha1.workspace = true
-sha2.workspace = true
-thiserror.workspace = true
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+base64 = { workspace = true }
+bytes = { workspace = true }
+form_urlencoded = { workspace = true }
+hex = { workspace = true }
+hmac = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { workspace = true }
+percent-encoding = { workspace = true }
+sha1 = { workspace = true }
+sha2 = { workspace = true }
[target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.61.0", features = [
diff --git a/core/src/context.rs b/core/src/context.rs
index beeca16..4ac3591 100644
--- a/core/src/context.rs
+++ b/core/src/context.rs
@@ -169,7 +169,7 @@ impl Context {
self.env.var(key)
}
- /// Returns an hashmap of (variable, value) pairs of strings, for all the
+ /// Returns a hashmap of (variable, value) pairs of strings, for all the
/// environment variables of the current process.
#[inline]
pub fn env_vars(&self) -> HashMap<String, String> {
@@ -211,7 +211,7 @@ pub trait Env: Debug + Send + Sync + 'static {
/// - Returns `None` if the environment variable is not found or value is
invalid.
fn var(&self, key: &str) -> Option<String>;
- /// Returns an hashmap of (variable, value) pairs of strings, for all the
+ /// Returns a hashmap of (variable, value) pairs of strings, for all the
/// environment variables of the current process.
fn vars(&self) -> HashMap<String, String>;
@@ -382,7 +382,7 @@ mod windows {
use windows_sys::Win32::Foundation::S_OK;
use windows_sys::Win32::System::Com::CoTaskMemFree;
use windows_sys::Win32::UI::Shell::{
- FOLDERID_Profile, SHGetKnownFolderPath, KF_FLAG_DONT_VERIFY,
+ FOLDERID_Profile, KF_FLAG_DONT_VERIFY, SHGetKnownFolderPath,
};
pub fn home_dir_inner() -> Option<PathBuf> {
@@ -422,8 +422,8 @@ mod windows {
None
}
- extern "C" {
- fn wcslen(buf: *const u16) -> usize;
+ unsafe extern "C" {
+ unsafe fn wcslen(buf: *const u16) -> usize;
}
#[cfg(not(target_vendor = "uwp"))]
@@ -437,18 +437,18 @@ mod windows {
#[test]
fn test_with_without() {
let olduserprofile = env::var_os("USERPROFILE").unwrap();
-
- env::remove_var("HOME");
- env::remove_var("USERPROFILE");
-
+ unsafe {
+ env::remove_var("HOME");
+ env::remove_var("USERPROFILE");
+ }
assert_eq!(home_dir_inner(), Some(PathBuf::from(olduserprofile)));
let home = Path::new(r"C:\Users\foo tar baz");
-
- env::set_var("HOME", home.as_os_str());
+ unsafe {
+ env::set_var("HOME", home.as_os_str());
+ env::set_var("USERPROFILE", home.as_os_str());
+ }
assert_ne!(home_dir_inner().as_ref().map(Deref::deref),
Some(home));
-
- env::set_var("USERPROFILE", home.as_os_str());
assert_eq!(home_dir_inner().as_ref().map(Deref::deref),
Some(home));
}
}
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/core/src/hash.rs b/core/src/hash.rs
index 0976017..14dc1d4 100644
--- a/core/src/hash.rs
+++ b/core/src/hash.rs
@@ -18,8 +18,8 @@
//! Hash related utils.
use crate::Error;
-use base64::prelude::BASE64_STANDARD;
use base64::Engine;
+use base64::prelude::BASE64_STANDARD;
use hmac::Hmac;
use hmac::Mac;
use sha1::Sha1;
diff --git a/core/src/request.rs b/core/src/request.rs
index d9881ed..2265cfe 100644
--- a/core/src/request.rs
+++ b/core/src/request.rs
@@ -20,14 +20,14 @@ use std::mem;
use std::time::Duration;
use crate::{Error, Result};
-use http::header::HeaderName;
-use http::uri::Authority;
-use http::uri::PathAndQuery;
-use http::uri::Scheme;
use http::HeaderMap;
use http::HeaderValue;
use http::Method;
use http::Uri;
+use http::header::HeaderName;
+use http::uri::Authority;
+use http::uri::PathAndQuery;
+use http::uri::Scheme;
use std::str::FromStr;
/// Signing context for request.
diff --git a/reqsign/Cargo.toml b/reqsign/Cargo.toml
index 41f603b..34c1fba 100644
--- a/reqsign/Cargo.toml
+++ b/reqsign/Cargo.toml
@@ -17,22 +17,24 @@
[package]
name = "reqsign"
-version = "0.17.0"
-
-edition.workspace = true
-license.workspace = true
-repository.workspace = true
+version = "0.17.1"
categories = ["authentication", "web-programming::http-client"]
description = "Signing HTTP requests for AWS, Azure, Google, Huawei, Aliyun,
Tencent and Oracle services"
+documentation = "https://docs.rs/reqsign"
keywords = ["http", "requests", "signing", "aws", "azure"]
+edition.workspace = true
+license.workspace = true
+repository.workspace = true
+rust-version.workspace = true
+
[package.metadata.docs.rs]
all-features = true
[dependencies]
# Core functionality (always included)
-reqsign-core.workspace = true
+reqsign-core = { workspace = true }
# Service implementations (optional)
reqsign-aliyun-oss = { workspace = true, optional = true }
@@ -73,7 +75,6 @@ anyhow = "1"
bytes = "1"
env_logger = "0.11"
http = "1"
-tempfile = "3"
tokio = { version = "1", features = ["full"] }
[[example]]
diff --git a/reqsign/src/aliyun.rs b/reqsign/src/aliyun.rs
index 8fac61d..dc31190 100644
--- a/reqsign/src/aliyun.rs
+++ b/reqsign/src/aliyun.rs
@@ -24,7 +24,7 @@
pub use reqsign_aliyun_oss::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default Aliyun OSS Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/reqsign/src/aws.rs b/reqsign/src/aws.rs
index b52305c..113045f 100644
--- a/reqsign/src/aws.rs
+++ b/reqsign/src/aws.rs
@@ -24,7 +24,7 @@
pub use reqsign_aws_v4::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default AWS Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/reqsign/src/azure.rs b/reqsign/src/azure.rs
index 1df5962..1f4267f 100644
--- a/reqsign/src/azure.rs
+++ b/reqsign/src/azure.rs
@@ -24,7 +24,7 @@
pub use reqsign_azure_storage::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default Azure Storage Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/reqsign/src/google.rs b/reqsign/src/google.rs
index c38a8e2..4627a05 100644
--- a/reqsign/src/google.rs
+++ b/reqsign/src/google.rs
@@ -24,7 +24,7 @@
pub use reqsign_google::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default Google Cloud Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/reqsign/src/huaweicloud.rs b/reqsign/src/huaweicloud.rs
index d9373cb..e2bd380 100644
--- a/reqsign/src/huaweicloud.rs
+++ b/reqsign/src/huaweicloud.rs
@@ -24,7 +24,7 @@
pub use reqsign_huaweicloud_obs::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default Huawei Cloud OBS Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/reqsign/src/oracle.rs b/reqsign/src/oracle.rs
index a0ef0a1..8a6520c 100644
--- a/reqsign/src/oracle.rs
+++ b/reqsign/src/oracle.rs
@@ -24,7 +24,7 @@
pub use reqsign_oracle::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default Oracle Cloud Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/reqsign/src/tencent.rs b/reqsign/src/tencent.rs
index 722ff9b..11e3b5d 100644
--- a/reqsign/src/tencent.rs
+++ b/reqsign/src/tencent.rs
@@ -24,7 +24,7 @@
pub use reqsign_tencent_cos::*;
#[cfg(feature = "default-context")]
-use crate::{default_context, Signer};
+use crate::{Signer, default_context};
/// Default Tencent Cloud COS Signer type with commonly used components
#[cfg(feature = "default-context")]
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 870d7eb..24ee9ce 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -17,4 +17,4 @@
[toolchain]
channel = "stable"
-components = ["rustfmt", "clippy"]
+components = ["cargo", "rustfmt", "clippy", "rust-analyzer"]
diff --git a/rustfmt.toml b/rustfmt.toml
index f4c3b57..383062d 100644
--- a/rustfmt.toml
+++ b/rustfmt.toml
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-edition = "2021"
+edition = "2024"
reorder_imports = true
# format_code_in_doc_comments = true
diff --git a/services/aliyun-oss/Cargo.toml b/services/aliyun-oss/Cargo.toml
index ea71e8f..fbbc124 100644
--- a/services/aliyun-oss/Cargo.toml
+++ b/services/aliyun-oss/Cargo.toml
@@ -17,34 +17,31 @@
[package]
name = "reqsign-aliyun-oss"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "Aliyun OSS signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
+rust-version.workspace = true
[dependencies]
-anyhow.workspace = true
-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
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { workspace = true }
+percent-encoding = { workspace = true }
+reqsign-core = { workspace = true }
reqwest = { workspace = true, features = ["json"] }
-serde.workspace = true
-serde_json.workspace = true
+serde = { workspace = true }
+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
+dotenv = { workspace = true }
+env_logger = { 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/examples/oss_operations.rs
b/services/aliyun-oss/examples/oss_operations.rs
index a0e6251..412cc91 100644
--- a/services/aliyun-oss/examples/oss_operations.rs
+++ b/services/aliyun-oss/examples/oss_operations.rs
@@ -49,7 +49,9 @@ async fn main() -> Result<()> {
// Create the signer
let signer = if demo_mode {
println!("No Aliyun credentials found, using demo mode");
- println!("To use real credentials, set ALIBABA_CLOUD_ACCESS_KEY_ID and
ALIBABA_CLOUD_ACCESS_KEY_SECRET");
+ println!(
+ "To use real credentials, set ALIBABA_CLOUD_ACCESS_KEY_ID and
ALIBABA_CLOUD_ACCESS_KEY_SECRET"
+ );
println!();
// Use demo credentials
diff --git a/services/aliyun-oss/src/credential.rs
b/services/aliyun-oss/src/credential.rs
index 9ec61ed..2c66229 100644
--- a/services/aliyun-oss/src/credential.rs
+++ b/services/aliyun-oss/src/credential.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use reqsign_core::time::{now, Timestamp};
-use reqsign_core::utils::Redact;
use reqsign_core::SigningCredential;
+use reqsign_core::time::{Timestamp, now};
+use reqsign_core::utils::Redact;
use std::fmt::{Debug, Formatter};
/// Credential that holds the access_key and secret_key.
diff --git
a/services/aliyun-oss/src/provide_credential/assume_role_with_oidc.rs
b/services/aliyun-oss/src/provide_credential/assume_role_with_oidc.rs
index f30c751..e928d6d 100644
--- a/services/aliyun-oss/src/provide_credential/assume_role_with_oidc.rs
+++ b/services/aliyun-oss/src/provide_credential/assume_role_with_oidc.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-use crate::{constants::*, Credential};
+use crate::{Credential, constants::*};
use async_trait::async_trait;
-use reqsign_core::time::{format_rfc3339, now, parse_rfc3339};
use reqsign_core::Result;
+use reqsign_core::time::{format_rfc3339, now, parse_rfc3339};
use reqsign_core::{Context, ProvideCredential};
use serde::Deserialize;
diff --git a/services/aliyun-oss/src/provide_credential/default.rs
b/services/aliyun-oss/src/provide_credential/default.rs
index d6f7190..dc32732 100644
--- a/services/aliyun-oss/src/provide_credential/default.rs
+++ b/services/aliyun-oss/src/provide_credential/default.rs
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-use crate::provide_credential::{AssumeRoleWithOidcCredentialProvider,
EnvCredentialProvider};
use crate::Credential;
+use crate::provide_credential::{AssumeRoleWithOidcCredentialProvider,
EnvCredentialProvider};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, ProvideCredentialChain, Result};
diff --git a/services/aliyun-oss/src/provide_credential/env.rs
b/services/aliyun-oss/src/provide_credential/env.rs
index b360802..56d700c 100644
--- a/services/aliyun-oss/src/provide_credential/env.rs
+++ b/services/aliyun-oss/src/provide_credential/env.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::{constants::*, Credential};
+use crate::{Credential, constants::*};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, Result};
diff --git a/services/aliyun-oss/src/sign_request.rs
b/services/aliyun-oss/src/sign_request.rs
index 08df07b..e159439 100644
--- a/services/aliyun-oss/src/sign_request.rs
+++ b/services/aliyun-oss/src/sign_request.rs
@@ -17,16 +17,16 @@
use crate::credential::Credential;
use async_trait::async_trait;
-use http::header::{AUTHORIZATION, CONTENT_TYPE, DATE};
use http::HeaderValue;
-use once_cell::sync::Lazy;
+use http::header::{AUTHORIZATION, CONTENT_TYPE, DATE};
use percent_encoding::utf8_percent_encode;
-use reqsign_core::hash::base64_hmac_sha1;
-use reqsign_core::time::{format_http_date, now, Timestamp};
use reqsign_core::Result;
+use reqsign_core::hash::base64_hmac_sha1;
+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/aliyun-oss/tests/main.rs
b/services/aliyun-oss/tests/main.rs
index e0d3250..22e56f4 100644
--- a/services/aliyun-oss/tests/main.rs
+++ b/services/aliyun-oss/tests/main.rs
@@ -19,11 +19,11 @@ use std::env;
use std::str::FromStr;
use std::time::Duration;
-use http::header::CONTENT_LENGTH;
use http::Request;
use http::StatusCode;
+use http::header::CONTENT_LENGTH;
use log::{debug, warn};
-use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
+use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode};
use reqsign_aliyun_oss::{RequestSigner, StaticCredentialProvider};
use reqsign_core::Result;
use reqsign_core::{Context, OsEnv, Signer};
diff --git a/services/aws-v4/Cargo.toml b/services/aws-v4/Cargo.toml
index 47acb30..84b1af9 100644
--- a/services/aws-v4/Cargo.toml
+++ b/services/aws-v4/Cargo.toml
@@ -17,52 +17,48 @@
[package]
name = "reqsign-aws-v4"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "AWS SigV4 signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
+rust-version.workspace = true
[[bench]]
harness = false
name = "aws"
[dependencies]
-anyhow.workspace = true
-async-trait.workspace = true
+anyhow = { workspace = true }
+async-trait = { workspace = true }
bytes = "1.7.2"
-form_urlencoded.workspace = true
-http.workspace = true
-jiff.workspace = true
-log.workspace = true
-percent-encoding.workspace = true
-quick-xml.workspace = true
-reqsign-core.workspace = true
-rust-ini.workspace = true
-serde.workspace = true
-serde_json.workspace = true
+form_urlencoded = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { workspace = true }
+percent-encoding = { workspace = true }
+quick-xml = { workspace = true }
+reqsign-core = { workspace = true }
+rust-ini = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
serde_urlencoded = "0.7"
sha1 = "0.10"
[dev-dependencies]
aws-credential-types = "1.1.8"
aws-sigv4 = "1.2.0"
-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
+criterion = { workspace = true }
+dotenv = { workspace = true }
+env_logger = { workspace = true }
+hex = { 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
+sha2 = { workspace = true }
+tempfile = { 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 6b70135..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;
@@ -23,10 +24,9 @@ use aws_sigv4::http_request::SignableBody;
use aws_sigv4::http_request::SignableRequest;
use aws_sigv4::http_request::SigningSettings;
use aws_sigv4::sign::v4::SigningParams;
+use criterion::Criterion;
use criterion::criterion_group;
use criterion::criterion_main;
-use criterion::Criterion;
-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/credential.rs
b/services/aws-v4/src/credential.rs
index a0a1dbb..edb3806 100644
--- a/services/aws-v4/src/credential.rs
+++ b/services/aws-v4/src/credential.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use reqsign_core::time::{now, Timestamp};
-use reqsign_core::utils::Redact;
use reqsign_core::SigningCredential;
+use reqsign_core::time::{Timestamp, now};
+use reqsign_core::utils::Redact;
use std::fmt::{Debug, Formatter};
/// Credential that holds the access_key and secret_key.
diff --git a/services/aws-v4/src/provide_credential/assume_role.rs
b/services/aws-v4/src/provide_credential/assume_role.rs
index e5ba258..a738a9b 100644
--- a/services/aws-v4/src/provide_credential/assume_role.rs
+++ b/services/aws-v4/src/provide_credential/assume_role.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+use crate::EMPTY_STRING_SHA256;
use crate::constants::X_AMZ_CONTENT_SHA_256;
use crate::credential::Credential;
use crate::provide_credential::utils::{parse_sts_error, sts_endpoint};
-use crate::EMPTY_STRING_SHA256;
use async_trait::async_trait;
use bytes::Bytes;
use quick_xml::de;
@@ -148,7 +148,10 @@ impl ProvideCredential for AssumeRoleCredentialProvider {
.map_err(|e| e.with_context(format!("role_arn: {}",
self.role_arn)))?;
// Construct request to AWS STS Service.
- let mut url =
format!("https://{endpoint}/?Action=AssumeRole&RoleArn={}&Version=2011-06-15&RoleSessionName={}",
self.role_arn, self.role_session_name);
+ let mut url = format!(
+
"https://{endpoint}/?Action=AssumeRole&RoleArn={}&Version=2011-06-15&RoleSessionName={}",
+ self.role_arn, self.role_session_name
+ );
if let Some(external_id) = &self.external_id {
write!(url, "&ExternalId={external_id}")
.map_err(|e| Error::unexpected("failed to format
URL").with_source(e))?;
diff --git
a/services/aws-v4/src/provide_credential/assume_role_with_web_identity.rs
b/services/aws-v4/src/provide_credential/assume_role_with_web_identity.rs
index 7c055d3..87c9933 100644
--- a/services/aws-v4/src/provide_credential/assume_role_with_web_identity.rs
+++ b/services/aws-v4/src/provide_credential/assume_role_with_web_identity.rs
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
-use crate::provide_credential::utils::{parse_sts_error, sts_endpoint};
use crate::Credential;
+use crate::provide_credential::utils::{parse_sts_error, sts_endpoint};
use async_trait::async_trait;
use bytes::Bytes;
use quick_xml::de;
use reqsign_core::time::parse_rfc3339;
-use reqsign_core::{utils::Redact, Context, Error, ProvideCredential, Result};
+use reqsign_core::{Context, Error, ProvideCredential, Result, utils::Redact};
use serde::Deserialize;
use std::fmt::{Debug, Formatter};
use std::path::PathBuf;
@@ -151,7 +151,9 @@ impl ProvideCredential for
AssumeRoleWithWebIdentityCredentialProvider {
.unwrap_or_else(|| "reqsign".to_string());
// Construct request to AWS STS Service.
- let url =
format!("https://{endpoint}/?Action=AssumeRoleWithWebIdentity&RoleArn={role_arn}&WebIdentityToken={token}&Version=2011-06-15&RoleSessionName={session_name}");
+ let url = format!(
+
"https://{endpoint}/?Action=AssumeRoleWithWebIdentity&RoleArn={role_arn}&WebIdentityToken={token}&Version=2011-06-15&RoleSessionName={session_name}"
+ );
let req = http::request::Request::builder()
.method("GET")
.uri(url)
diff --git a/services/aws-v4/src/provide_credential/default.rs
b/services/aws-v4/src/provide_credential/default.rs
index 0b388f4..ca3cc46 100644
--- a/services/aws-v4/src/provide_credential/default.rs
+++ b/services/aws-v4/src/provide_credential/default.rs
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
+use crate::Credential;
use crate::provide_credential::{
AssumeRoleWithWebIdentityCredentialProvider, ECSCredentialProvider,
EnvCredentialProvider,
IMDSv2CredentialProvider, ProfileCredentialProvider,
};
#[cfg(not(target_arch = "wasm32"))]
use crate::provide_credential::{ProcessCredentialProvider,
SSOCredentialProvider};
-use crate::Credential;
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, ProvideCredentialChain, Result};
diff --git a/services/aws-v4/src/provide_credential/env.rs
b/services/aws-v4/src/provide_credential/env.rs
index 0256b3c..daa8fb3 100644
--- a/services/aws-v4/src/provide_credential/env.rs
+++ b/services/aws-v4/src/provide_credential/env.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::{constants::*, Credential};
+use crate::{Credential, constants::*};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, Result};
diff --git a/services/aws-v4/src/provide_credential/imds.rs
b/services/aws-v4/src/provide_credential/imds.rs
index a25af58..01eedc9 100644
--- a/services/aws-v4/src/provide_credential/imds.rs
+++ b/services/aws-v4/src/provide_credential/imds.rs
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
-use crate::provide_credential::utils::parse_imds_error;
use crate::Credential;
+use crate::provide_credential::utils::parse_imds_error;
use async_trait::async_trait;
use bytes::Bytes;
-use http::header::CONTENT_LENGTH;
use http::Method;
-use reqsign_core::time::{now, parse_rfc3339, Timestamp};
+use http::header::CONTENT_LENGTH;
+use reqsign_core::time::{Timestamp, now, parse_rfc3339};
use reqsign_core::{Context, Error, ProvideCredential, Result};
use serde::Deserialize;
use std::sync::{Arc, Mutex};
diff --git a/services/aws-v4/src/provide_credential/profile.rs
b/services/aws-v4/src/provide_credential/profile.rs
index 7d9d6ae..09806d7 100644
--- a/services/aws-v4/src/provide_credential/profile.rs
+++ b/services/aws-v4/src/provide_credential/profile.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+use crate::Credential;
#[cfg(not(target_arch = "wasm32"))]
use crate::constants::*;
-use crate::Credential;
use async_trait::async_trait;
#[cfg(not(target_arch = "wasm32"))]
use ini::Ini;
diff --git a/services/aws-v4/src/provide_credential/s3_express_session.rs
b/services/aws-v4/src/provide_credential/s3_express_session.rs
index 723b2bb..c1c5e79 100644
--- a/services/aws-v4/src/provide_credential/s3_express_session.rs
+++ b/services/aws-v4/src/provide_credential/s3_express_session.rs
@@ -18,7 +18,7 @@
use crate::Credential;
use async_trait::async_trait;
use bytes::Bytes;
-use http::{header, Method, Request};
+use http::{Method, Request, header};
use log::debug;
use reqsign_core::time::parse_rfc3339;
use reqsign_core::{Context, Error, ProvideCredential, Result, SignRequest};
diff --git a/services/aws-v4/src/provide_credential/sso.rs
b/services/aws-v4/src/provide_credential/sso.rs
index a0adaec..04f9ece 100644
--- a/services/aws-v4/src/provide_credential/sso.rs
+++ b/services/aws-v4/src/provide_credential/sso.rs
@@ -20,7 +20,7 @@ use async_trait::async_trait;
use http::{Method, Request, StatusCode};
use ini::Ini;
use log::{debug, warn};
-use reqsign_core::time::{now, Timestamp};
+use reqsign_core::time::{Timestamp, now};
use reqsign_core::{Context, Error, ProvideCredential, Result};
use serde::Deserialize;
diff --git a/services/aws-v4/src/sign_request.rs
b/services/aws-v4/src/sign_request.rs
index 6b27ddf..8b9e734 100644
--- a/services/aws-v4/src/sign_request.rs
+++ b/services/aws-v4/src/sign_request.rs
@@ -15,18 +15,18 @@
// specific language governing permissions and limitations
// under the License.
+use crate::Credential;
use crate::constants::{
AWS_QUERY_ENCODE_SET, X_AMZ_CONTENT_SHA_256, X_AMZ_DATE,
X_AMZ_S3_SESSION_TOKEN,
X_AMZ_SECURITY_TOKEN,
};
-use crate::Credential;
use async_trait::async_trait;
use http::request::Parts;
-use http::{header, HeaderValue};
+use http::{HeaderValue, header};
use log::debug;
use percent_encoding::{percent_decode_str, utf8_percent_encode};
use reqsign_core::hash::{hex_hmac_sha256, hex_sha256, hmac_sha256};
-use reqsign_core::time::{format_date, format_iso8601, now, Timestamp};
+use reqsign_core::time::{Timestamp, format_date, format_iso8601, now};
use reqsign_core::{Context, Result, SignRequest, SigningRequest};
use std::fmt::Write;
use std::time::Duration;
@@ -361,9 +361,8 @@ 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
- let sign_request = hmac_sha256(sign_service.as_slice(),
"aws4_request".as_bytes());
- sign_request
+ hmac_sha256(sign_service.as_slice(), "aws4_request".as_bytes())
}
#[cfg(test)]
@@ -381,8 +380,8 @@ mod tests {
use aws_sigv4::http_request::SignatureLocation;
use aws_sigv4::http_request::SigningSettings;
use aws_sigv4::sign::v4;
- use http::header;
use http::Request;
+ use http::header;
use reqsign_core::ProvideCredential;
use reqsign_file_read_tokio::TokioFileRead;
use reqsign_http_send_reqwest::ReqwestHttpSend;
diff --git a/services/aws-v4/tests/credential_providers/ecs.rs
b/services/aws-v4/tests/credential_providers/ecs.rs
index d9b19c0..6b555d8 100644
--- a/services/aws-v4/tests/credential_providers/ecs.rs
+++ b/services/aws-v4/tests/credential_providers/ecs.rs
@@ -49,7 +49,9 @@ async fn test_ecs_credential_provider() {
envs.insert("AWS_CONTAINER_AUTHORIZATION_TOKEN".to_string(),
token);
}
} else {
- panic!("Either AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or
AWS_CONTAINER_CREDENTIALS_FULL_URI must be set");
+ panic!(
+ "Either AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or
AWS_CONTAINER_CREDENTIALS_FULL_URI must be set"
+ );
}
let ctx = create_test_context_with_env(envs);
diff --git a/services/aws-v4/tests/signing/special_chars.rs
b/services/aws-v4/tests/signing/special_chars.rs
index f1204bf..5ae3b24 100644
--- a/services/aws-v4/tests/signing/special_chars.rs
+++ b/services/aws-v4/tests/signing/special_chars.rs
@@ -19,7 +19,7 @@ use super::{init_signing_test, load_static_credential,
send_signed_request};
use anyhow::Result;
use http::{Method, Request, StatusCode};
use log::warn;
-use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
+use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode};
use std::str::FromStr;
#[tokio::test]
diff --git a/services/azure-storage/Cargo.toml
b/services/azure-storage/Cargo.toml
index ca3cfe7..210807e 100644
--- a/services/azure-storage/Cargo.toml
+++ b/services/azure-storage/Cargo.toml
@@ -17,42 +17,40 @@
[package]
name = "reqsign-azure-storage"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "Azure Storage signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
+rust-version.workspace = true
[dependencies]
-anyhow.workspace = true
-async-trait.workspace = true
-base64.workspace = true
-bytes.workspace = true
-form_urlencoded.workspace = true
-http.workspace = true
-jiff.workspace = true
-log.workspace = true
-percent-encoding.workspace = true
-reqsign-core.workspace = true
-serde.workspace = true
-serde_json.workspace = true
-sha1.workspace = true
-sha2.workspace = true
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+base64 = { workspace = true }
+bytes = { workspace = true }
+form_urlencoded = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { workspace = true }
+percent-encoding = { workspace = true }
+reqsign-core = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sha1 = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
jsonwebtoken = "9.2"
pem = "3.0"
-rsa.workspace = true
+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
-reqsign-http-send-reqwest.workspace = true
+async-trait = { workspace = true }
+env_logger = { workspace = true }
+reqsign-command-execute-tokio = { workspace = true }
+reqsign-file-read-tokio = { workspace = true }
+reqsign-http-send-reqwest = { workspace = true }
reqwest = { workspace = true, features = ["rustls-tls"] }
tokio = { workspace = true, features = ["full"] }
diff --git a/services/azure-storage/src/account_sas.rs
b/services/azure-storage/src/account_sas.rs
index 7eff18a..e7c79fc 100644
--- a/services/azure-storage/src/account_sas.rs
+++ b/services/azure-storage/src/account_sas.rs
@@ -141,6 +141,9 @@ mod tests {
.collect::<Vec<String>>()
.join("&");
- assert_eq!(token,
"sv=2018-11-09&ss=bqtf&srt=sco&se=2022-03-01T08%3A17%3A34Z&sp=rwdlacu&sig=jgK9nDUT0ntH%2Fp28LPs0jzwxsk91W6hePLPlfrElv4k%3D");
+ assert_eq!(
+ token,
+
"sv=2018-11-09&ss=bqtf&srt=sco&se=2022-03-01T08%3A17%3A34Z&sp=rwdlacu&sig=jgK9nDUT0ntH%2Fp28LPs0jzwxsk91W6hePLPlfrElv4k%3D"
+ );
}
}
diff --git a/services/azure-storage/src/credential.rs
b/services/azure-storage/src/credential.rs
index e824bc9..faaa4c4 100644
--- a/services/azure-storage/src/credential.rs
+++ b/services/azure-storage/src/credential.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use reqsign_core::time::{now, Timestamp};
-use reqsign_core::utils::Redact;
use reqsign_core::SigningCredential;
+use reqsign_core::time::{Timestamp, now};
+use reqsign_core::utils::Redact;
use std::fmt::{Debug, Formatter};
/// Credential enum for different Azure Storage authentication methods.
diff --git
a/services/azure-storage/src/provide_credential/client_certificate.rs
b/services/azure-storage/src/provide_credential/client_certificate.rs
index 7268568..97bff76 100644
--- a/services/azure-storage/src/provide_credential/client_certificate.rs
+++ b/services/azure-storage/src/provide_credential/client_certificate.rs
@@ -20,13 +20,13 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
use crate::credential::Credential;
use async_trait::async_trait;
-use base64::engine::general_purpose::URL_SAFE_NO_PAD;
use base64::Engine;
+use base64::engine::general_purpose::URL_SAFE_NO_PAD;
use jsonwebtoken::{Algorithm, EncodingKey, Header};
use reqsign_core::time::now;
use reqsign_core::{Context, ProvideCredential};
-use rsa::pkcs8::DecodePrivateKey;
use rsa::RsaPrivateKey;
+use rsa::pkcs8::DecodePrivateKey;
use serde::{Deserialize, Serialize};
use sha1::{Digest, Sha1};
diff --git a/services/azure-storage/src/provide_credential/default.rs
b/services/azure-storage/src/provide_credential/default.rs
index 02ab0a9..0e698fa 100644
--- a/services/azure-storage/src/provide_credential/default.rs
+++ b/services/azure-storage/src/provide_credential/default.rs
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
+use crate::Credential;
#[cfg(not(target_arch = "wasm32"))]
use crate::provide_credential::{AzureCliCredentialProvider,
ClientCertificateCredentialProvider};
use crate::provide_credential::{
AzurePipelinesCredentialProvider, ClientSecretCredentialProvider,
EnvCredentialProvider,
ImdsCredentialProvider, WorkloadIdentityCredentialProvider,
};
-use crate::Credential;
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, ProvideCredentialChain, Result};
diff --git a/services/azure-storage/src/sign_request.rs
b/services/azure-storage/src/sign_request.rs
index c528a07..aceb460 100644
--- a/services/azure-storage/src/sign_request.rs
+++ b/services/azure-storage/src/sign_request.rs
@@ -15,15 +15,15 @@
// specific language governing permissions and limitations
// under the License.
-use crate::constants::*;
use crate::Credential;
+use crate::constants::*;
use async_trait::async_trait;
use http::request::Parts;
-use http::{header, HeaderValue};
+use http::{HeaderValue, header};
use log::debug;
use percent_encoding::percent_encode;
use reqsign_core::hash::{base64_decode, base64_hmac_sha256};
-use reqsign_core::time::{format_http_date, now, Timestamp};
+use reqsign_core::time::{Timestamp, format_http_date, now};
use reqsign_core::{Context, Result, SignRequest, SigningMethod,
SigningRequest};
use std::fmt::Write;
use std::time::Duration;
@@ -428,7 +428,9 @@ mod tests {
.with_file_read(TokioFileRead)
.with_http_send(ReqwestHttpSend::default())
.with_env(OsEnv);
- let cred =
Credential::with_sas_token("sv=2021-01-01&ss=b&srt=c&sp=rwdlaciytfx&se=2022-01-01T11:00:14Z&st=2022-01-02T03:00:14Z&spr=https&sig=KEllk4N8f7rJfLjQCmikL2fRVt%2B%2Bl73UBkbgH%2FK3VGE%3D");
+ let cred = Credential::with_sas_token(
+
"sv=2021-01-01&ss=b&srt=c&sp=rwdlaciytfx&se=2022-01-01T11:00:14Z&st=2022-01-02T03:00:14Z&spr=https&sig=KEllk4N8f7rJfLjQCmikL2fRVt%2B%2Bl73UBkbgH%2FK3VGE%3D",
+ );
let builder = RequestSigner::new();
@@ -440,11 +442,16 @@ mod tests {
let (mut parts, _) = req.into_parts();
// Test query signing
- assert!(builder
- .sign_request(&ctx, &mut parts, Some(&cred),
Some(Duration::from_secs(1)))
- .await
- .is_ok());
- assert_eq!(parts.uri,
"https://test.blob.core.windows.net/testbucket/testblob?sv=2021-01-01&ss=b&srt=c&sp=rwdlaciytfx&se=2022-01-01T11:00:14Z&st=2022-01-02T03:00:14Z&spr=https&sig=KEllk4N8f7rJfLjQCmikL2fRVt%2B%2Bl73UBkbgH%2FK3VGE%3D")
+ assert!(
+ builder
+ .sign_request(&ctx, &mut parts, Some(&cred),
Some(Duration::from_secs(1)))
+ .await
+ .is_ok()
+ );
+ assert_eq!(
+ parts.uri,
+
"https://test.blob.core.windows.net/testbucket/testblob?sv=2021-01-01&ss=b&srt=c&sp=rwdlaciytfx&se=2022-01-01T11:00:14Z&st=2022-01-02T03:00:14Z&spr=https&sig=KEllk4N8f7rJfLjQCmikL2fRVt%2B%2Bl73UBkbgH%2FK3VGE%3D"
+ )
}
#[tokio::test]
@@ -466,10 +473,12 @@ mod tests {
let (mut parts, _) = req.into_parts();
// Can effectively sign request with header method
- assert!(builder
- .sign_request(&ctx, &mut parts, Some(&cred), None)
- .await
- .is_ok());
+ assert!(
+ builder
+ .sign_request(&ctx, &mut parts, Some(&cred), None)
+ .await
+ .is_ok()
+ );
let authorization = parts
.headers
.get("Authorization")
@@ -484,9 +493,11 @@ mod tests {
.body(())
.unwrap();
let (mut parts, _) = req.into_parts();
- assert!(builder
- .sign_request(&ctx, &mut parts, Some(&cred),
Some(Duration::from_secs(1)))
- .await
- .is_err());
+ assert!(
+ builder
+ .sign_request(&ctx, &mut parts, Some(&cred),
Some(Duration::from_secs(1)))
+ .await
+ .is_err()
+ );
}
}
diff --git a/services/google/Cargo.toml b/services/google/Cargo.toml
index 58d3864..44e8a45 100644
--- a/services/google/Cargo.toml
+++ b/services/google/Cargo.toml
@@ -17,37 +17,35 @@
[package]
name = "reqsign-google"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "Goole Cloud Platform signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
+rust-version.workspace = true
[dependencies]
-async-trait.workspace = true
-http.workspace = true
-jiff.workspace = true
+async-trait = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
jsonwebtoken = "9.2"
-log.workspace = true
-percent-encoding.workspace = true
-rand.workspace = true
-reqsign-core.workspace = true
-reqwest.workspace = true
-rsa.workspace = true
-serde.workspace = true
-serde_json.workspace = true
-sha2.workspace = true
+log = { workspace = true }
+percent-encoding = { workspace = true }
+rand = { workspace = true }
+reqsign-core = { workspace = true }
+reqwest = { workspace = true }
+rsa = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+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
+dotenv = { workspace = true }
+env_logger = { 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
+sha2 = { workspace = true }
tokio = { workspace = true, features = ["full"] }
diff --git a/services/google/src/credential.rs
b/services/google/src/credential.rs
index ace9f94..700ead0 100644
--- a/services/google/src/credential.rs
+++ b/services/google/src/credential.rs
@@ -16,7 +16,7 @@
// under the License.
use reqsign_core::{
- time::now, time::Timestamp, utils::Redact, Result, SigningCredential as
KeyTrait,
+ Result, SigningCredential as KeyTrait, time::Timestamp, time::now,
utils::Redact,
};
use std::fmt::{self, Debug};
diff --git a/services/google/src/provide_credential/authorized_user.rs
b/services/google/src/provide_credential/authorized_user.rs
index e510e5e..f805175 100644
--- a/services/google/src/provide_credential/authorized_user.rs
+++ b/services/google/src/provide_credential/authorized_user.rs
@@ -19,7 +19,7 @@ use http::header::CONTENT_TYPE;
use log::{debug, error};
use serde::{Deserialize, Serialize};
-use reqsign_core::{time::now, Context, ProvideCredential, Result};
+use reqsign_core::{Context, ProvideCredential, Result, time::now};
use crate::credential::{Credential, OAuth2Credentials, Token};
diff --git a/services/google/src/provide_credential/external_account.rs
b/services/google/src/provide_credential/external_account.rs
index 4cd7c2a..a4dba76 100644
--- a/services/google/src/provide_credential/external_account.rs
+++ b/services/google/src/provide_credential/external_account.rs
@@ -21,9 +21,9 @@ use http::header::{ACCEPT, CONTENT_TYPE};
use log::{debug, error};
use serde::{Deserialize, Serialize};
-use crate::credential::{external_account, Credential, ExternalAccount, Token};
+use crate::credential::{Credential, ExternalAccount, Token, external_account};
use reqsign_core::time::parse_rfc3339;
-use reqsign_core::{time::now, Context, ProvideCredential, Result};
+use reqsign_core::{Context, ProvideCredential, Result, time::now};
/// The maximum impersonated token lifetime allowed, 1 hour.
const MAX_LIFETIME: Duration = Duration::from_secs(3600);
diff --git
a/services/google/src/provide_credential/impersonated_service_account.rs
b/services/google/src/provide_credential/impersonated_service_account.rs
index 5760488..6035a6f 100644
--- a/services/google/src/provide_credential/impersonated_service_account.rs
+++ b/services/google/src/provide_credential/impersonated_service_account.rs
@@ -23,7 +23,7 @@ use serde::{Deserialize, Serialize};
use crate::credential::{Credential, ImpersonatedServiceAccount, Token};
use reqsign_core::time::parse_rfc3339;
-use reqsign_core::{time::now, Context, ProvideCredential, Result};
+use reqsign_core::{Context, ProvideCredential, Result, time::now};
/// The maximum impersonated token lifetime allowed, 1 hour.
const MAX_LIFETIME: Duration = Duration::from_secs(3600);
diff --git a/services/google/src/provide_credential/static_provider.rs
b/services/google/src/provide_credential/static_provider.rs
index 73bb2df..b893bda 100644
--- a/services/google/src/provide_credential/static_provider.rs
+++ b/services/google/src/provide_credential/static_provider.rs
@@ -17,7 +17,7 @@
use log::debug;
-use reqsign_core::{hash::base64_decode, Context, ProvideCredential, Result};
+use reqsign_core::{Context, ProvideCredential, Result, hash::base64_decode};
use crate::credential::{Credential, CredentialFile};
diff --git a/services/google/src/provide_credential/vm_metadata.rs
b/services/google/src/provide_credential/vm_metadata.rs
index 48b2421..abf8839 100644
--- a/services/google/src/provide_credential/vm_metadata.rs
+++ b/services/google/src/provide_credential/vm_metadata.rs
@@ -18,7 +18,7 @@
use log::debug;
use serde::Deserialize;
-use reqsign_core::{time::now, Context, ProvideCredential, Result};
+use reqsign_core::{Context, ProvideCredential, Result, time::now};
use crate::credential::{Credential, Token};
diff --git a/services/google/src/sign_request.rs
b/services/google/src/sign_request.rs
index b2d58a4..e7aa3f7 100644
--- a/services/google/src/sign_request.rs
+++ b/services/google/src/sign_request.rs
@@ -28,11 +28,11 @@ use std::borrow::Cow;
use std::time::Duration;
use reqsign_core::{
- hash::hex_sha256, time::*, Context, Result, SignRequest,
SigningCredential, SigningMethod,
- SigningRequest,
+ Context, Result, SignRequest, SigningCredential, SigningMethod,
SigningRequest,
+ hash::hex_sha256, time::*,
};
-use crate::constants::{DEFAULT_SCOPE, GOOGLE_SCOPE, GOOG_QUERY_ENCODE_SET,
GOOG_URI_ENCODE_SET};
+use crate::constants::{DEFAULT_SCOPE, GOOG_QUERY_ENCODE_SET,
GOOG_URI_ENCODE_SET, GOOGLE_SCOPE};
use crate::credential::{Credential, ServiceAccount, Token};
/// Claims is used to build JWT for Google Cloud.
diff --git a/services/huaweicloud-obs/Cargo.toml
b/services/huaweicloud-obs/Cargo.toml
index 3f0c464..eb6c8f7 100644
--- a/services/huaweicloud-obs/Cargo.toml
+++ b/services/huaweicloud-obs/Cargo.toml
@@ -17,29 +17,26 @@
[package]
name = "reqsign-huaweicloud-obs"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "Huawei Cloud OBS signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
+rust-version.workspace = true
[dependencies]
-anyhow.workspace = true
-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
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { 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
+env_logger = { workspace = true }
+reqsign-file-read-tokio = { workspace = true }
+reqsign-http-send-reqwest = { workspace = true }
tokio = { workspace = true, features = ["full"] }
diff --git a/services/huaweicloud-obs/src/credential.rs
b/services/huaweicloud-obs/src/credential.rs
index 0ae76a1..19999a3 100644
--- a/services/huaweicloud-obs/src/credential.rs
+++ b/services/huaweicloud-obs/src/credential.rs
@@ -17,7 +17,7 @@
use std::fmt::{Debug, Formatter};
-use reqsign_core::{utils::Redact, SigningCredential};
+use reqsign_core::{SigningCredential, utils::Redact};
/// Credential for obs.
#[derive(Clone)]
diff --git a/services/huaweicloud-obs/src/provide_credential/env.rs
b/services/huaweicloud-obs/src/provide_credential/env.rs
index 38616f8..8d4c555 100644
--- a/services/huaweicloud-obs/src/provide_credential/env.rs
+++ b/services/huaweicloud-obs/src/provide_credential/env.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::{constants::*, Credential};
+use crate::{Credential, constants::*};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, Result};
diff --git a/services/huaweicloud-obs/src/sign_request.rs
b/services/huaweicloud-obs/src/sign_request.rs
index 893c0a1..f1beb57 100644
--- a/services/huaweicloud-obs/src/sign_request.rs
+++ b/services/huaweicloud-obs/src/sign_request.rs
@@ -18,23 +18,23 @@
//! 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;
use http::header::AUTHORIZATION;
use http::header::CONTENT_TYPE;
use http::header::DATE;
-use http::HeaderValue;
use log::debug;
-use once_cell::sync::Lazy;
use percent_encoding::utf8_percent_encode;
use reqsign_core::Result;
use super::constants::*;
use super::credential::Credential;
use reqsign_core::hash::base64_hmac_sha1;
+use reqsign_core::time::Timestamp;
use reqsign_core::time::format_http_date;
use reqsign_core::time::now;
-use reqsign_core::time::Timestamp;
use reqsign_core::{SignRequest, SigningMethod, SigningRequest};
/// RequestSigner that implement Huawei Cloud Object Storage Service
Authorization.
@@ -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",
@@ -303,10 +303,10 @@ static SUBRESOURCES: Lazy<HashSet<&'static str>> =
Lazy::new(|| {
mod tests {
use std::str::FromStr;
- use http::header::HeaderName;
use http::Uri;
- use reqsign_core::time::parse_rfc2822;
+ use http::header::HeaderName;
use reqsign_core::Result;
+ use reqsign_core::time::parse_rfc2822;
use reqsign_core::{Context, OsEnv, Signer};
use reqsign_file_read_tokio::TokioFileRead;
use reqsign_http_send_reqwest::ReqwestHttpSend;
diff --git a/services/oracle/Cargo.toml b/services/oracle/Cargo.toml
index 8531cea..1e258f6 100644
--- a/services/oracle/Cargo.toml
+++ b/services/oracle/Cargo.toml
@@ -17,28 +17,28 @@
[package]
name = "reqsign-oracle"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "Oracle Cloud signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
+rust-version.workspace = true
[dependencies]
-anyhow.workspace = true
-async-trait.workspace = true
-base64.workspace = true
-http.workspace = true
-jiff.workspace = true
-log.workspace = true
-reqsign-core.workspace = true
-rsa.workspace = true
-rust-ini.workspace = true
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+base64 = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { workspace = true }
+reqsign-core = { workspace = true }
+rsa = { workspace = true }
+rust-ini = { workspace = true }
[dev-dependencies]
env_logger = "0.11"
-reqsign-file-read-tokio.workspace = true
-reqsign-http-send-reqwest.workspace = true
+reqsign-file-read-tokio = { workspace = true }
+reqsign-http-send-reqwest = { workspace = true }
tokio = { version = "1", features = ["test-util", "macros", "rt-multi-thread"]
}
diff --git a/services/oracle/src/config.rs b/services/oracle/src/config.rs
index e53c277..ffa521b 100644
--- a/services/oracle/src/config.rs
+++ b/services/oracle/src/config.rs
@@ -19,9 +19,9 @@
use crate::constants::*;
use ini::Ini;
-use reqsign_core::utils::Redact;
use reqsign_core::Context;
use reqsign_core::Result;
+use reqsign_core::utils::Redact;
use std::fmt::{Debug, Formatter};
/// Config for Oracle Cloud Infrastructure services.
diff --git a/services/oracle/src/credential.rs
b/services/oracle/src/credential.rs
index eb9731c..a43052a 100644
--- a/services/oracle/src/credential.rs
+++ b/services/oracle/src/credential.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use reqsign_core::time::{now, Timestamp};
-use reqsign_core::utils::Redact;
use reqsign_core::SigningCredential;
+use reqsign_core::time::{Timestamp, now};
+use reqsign_core::utils::Redact;
use std::fmt::{Debug, Formatter};
/// Credential that holds the API private key information.
diff --git a/services/oracle/src/provide_credential/config_file.rs
b/services/oracle/src/provide_credential/config_file.rs
index 8b7ebea..a222b5f 100644
--- a/services/oracle/src/provide_credential/config_file.rs
+++ b/services/oracle/src/provide_credential/config_file.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+use crate::Credential;
use crate::constants::{
ORACLE_CONFIG_FILE, ORACLE_CONFIG_PATH, ORACLE_DEFAULT_PROFILE,
ORACLE_PROFILE,
};
-use crate::Credential;
use async_trait::async_trait;
use log::debug;
use reqsign_core::{Context, ProvideCredential, Result};
diff --git a/services/oracle/src/provide_credential/default.rs
b/services/oracle/src/provide_credential/default.rs
index 83c7c3c..e7265ad 100644
--- a/services/oracle/src/provide_credential/default.rs
+++ b/services/oracle/src/provide_credential/default.rs
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-use crate::provide_credential::{ConfigFileCredentialProvider,
EnvCredentialProvider};
use crate::Credential;
+use crate::provide_credential::{ConfigFileCredentialProvider,
EnvCredentialProvider};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, ProvideCredentialChain, Result};
diff --git a/services/oracle/src/provide_credential/env.rs
b/services/oracle/src/provide_credential/env.rs
index 582828d..9f3c41a 100644
--- a/services/oracle/src/provide_credential/env.rs
+++ b/services/oracle/src/provide_credential/env.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::{constants::*, Credential};
+use crate::{Credential, constants::*};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, Result};
diff --git a/services/oracle/src/sign_request.rs
b/services/oracle/src/sign_request.rs
index 4817b91..06ea20c 100644
--- a/services/oracle/src/sign_request.rs
+++ b/services/oracle/src/sign_request.rs
@@ -17,20 +17,20 @@
use crate::Credential;
use async_trait::async_trait;
-use base64::{engine::general_purpose, Engine as _};
+use base64::{Engine as _, engine::general_purpose};
use http::request::Parts;
use http::{
- header::{AUTHORIZATION, DATE},
HeaderValue,
+ header::{AUTHORIZATION, DATE},
};
use log::debug;
-use reqsign_core::time::{format_http_date, now};
use reqsign_core::Result;
+use reqsign_core::time::{format_http_date, now};
use reqsign_core::{Context, SignRequest, SigningRequest};
use rsa::pkcs1v15::SigningKey;
use rsa::sha2::Sha256;
use rsa::signature::{SignatureEncoding, Signer};
-use rsa::{pkcs8::DecodePrivateKey, RsaPrivateKey};
+use rsa::{RsaPrivateKey, pkcs8::DecodePrivateKey};
use std::fmt::Write;
use std::time::Duration;
diff --git a/services/tencent-cos/Cargo.toml b/services/tencent-cos/Cargo.toml
index f513dcc..e1418ea 100644
--- a/services/tencent-cos/Cargo.toml
+++ b/services/tencent-cos/Cargo.toml
@@ -17,35 +17,31 @@
[package]
name = "reqsign-tencent-cos"
-version = "1.0.0"
+version = "1.1.0"
+
+description = "Tencent Cloud COS signing implementation for reqsign."
-categories.workspace = true
-description.workspace = true
-documentation.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
-
+rust-version.workspace = true
[dependencies]
-anyhow.workspace = true
-async-trait.workspace = true
-http.workspace = true
-jiff.workspace = true
-log.workspace = true
-percent-encoding.workspace = true
-reqsign-core.workspace = true
-serde.workspace = true
-serde_json.workspace = true
-
+anyhow = { workspace = true }
+async-trait = { workspace = true }
+http = { workspace = true }
+jiff = { workspace = true }
+log = { workspace = true }
+percent-encoding = { workspace = true }
+reqsign-core = { workspace = true }
+serde = { workspace = true }
+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
+dotenv = { workspace = true }
+env_logger = { 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"] }
diff --git a/services/tencent-cos/src/credential.rs
b/services/tencent-cos/src/credential.rs
index cb317b0..1c04713 100644
--- a/services/tencent-cos/src/credential.rs
+++ b/services/tencent-cos/src/credential.rs
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use reqsign_core::time::{now, Timestamp};
-use reqsign_core::utils::Redact;
use reqsign_core::SigningCredential;
+use reqsign_core::time::{Timestamp, now};
+use reqsign_core::utils::Redact;
use std::fmt::{Debug, Formatter};
/// Credential for Tencent COS.
diff --git
a/services/tencent-cos/src/provide_credential/assume_role_with_web_identity.rs
b/services/tencent-cos/src/provide_credential/assume_role_with_web_identity.rs
index fb00487..96cb55e 100644
---
a/services/tencent-cos/src/provide_credential/assume_role_with_web_identity.rs
+++
b/services/tencent-cos/src/provide_credential/assume_role_with_web_identity.rs
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
-use crate::constants::*;
use crate::Credential;
+use crate::constants::*;
use async_trait::async_trait;
use http::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE};
use log::debug;
-use reqsign_core::time::{now, parse_rfc3339};
use reqsign_core::Result;
+use reqsign_core::time::{now, parse_rfc3339};
use reqsign_core::{Context, ProvideCredential};
use serde::{Deserialize, Serialize};
@@ -59,30 +59,34 @@ impl ProvideCredential for
AssumeRoleWithWebIdentityCredentialProvider {
.or_else(|| ctx.env_var(TKE_ROLE_SESSSION_NAME))
.unwrap_or_else(|| "reqsign".to_string());
- let (region, token_file, role_arn, provider_id) =
- match (region, token_file, role_arn, provider_id) {
- (Some(region), Some(token_file), Some(role_arn),
Some(provider_id)) => {
- (region, token_file, role_arn, provider_id)
- }
- (region, token_file, role_arn, provider_id) => {
- let missing = [
- ("region", region.is_none()),
- ("web_identity_token_file", token_file.is_none()),
- ("role_arn", role_arn.is_none()),
- ("provider_id", provider_id.is_none()),
- ]
- .iter()
- .filter_map(|&(k, v)| if v { Some(k) } else { None })
- .collect::<Vec<_>>()
- .join(", ");
-
- debug!(
+ let (region, token_file, role_arn, provider_id) = match (
+ region,
+ token_file,
+ role_arn,
+ provider_id,
+ ) {
+ (Some(region), Some(token_file), Some(role_arn),
Some(provider_id)) => {
+ (region, token_file, role_arn, provider_id)
+ }
+ (region, token_file, role_arn, provider_id) => {
+ let missing = [
+ ("region", region.is_none()),
+ ("web_identity_token_file", token_file.is_none()),
+ ("role_arn", role_arn.is_none()),
+ ("provider_id", provider_id.is_none()),
+ ]
+ .iter()
+ .filter_map(|&(k, v)| if v { Some(k) } else { None })
+ .collect::<Vec<_>>()
+ .join(", ");
+
+ debug!(
"assume_role_with_web_identity is not configured fully:
[{missing}] is missing"
);
- return Ok(None);
- }
- };
+ return Ok(None);
+ }
+ };
let token = ctx.file_read_as_string(&token_file).await?;
diff --git a/services/tencent-cos/src/provide_credential/default.rs
b/services/tencent-cos/src/provide_credential/default.rs
index 1dcf191..fd7e72f 100644
--- a/services/tencent-cos/src/provide_credential/default.rs
+++ b/services/tencent-cos/src/provide_credential/default.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+use crate::Credential;
use crate::provide_credential::{
AssumeRoleWithWebIdentityCredentialProvider, EnvCredentialProvider,
};
-use crate::Credential;
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, ProvideCredentialChain, Result};
diff --git a/services/tencent-cos/src/provide_credential/env.rs
b/services/tencent-cos/src/provide_credential/env.rs
index ba61f6f..de129dd 100644
--- a/services/tencent-cos/src/provide_credential/env.rs
+++ b/services/tencent-cos/src/provide_credential/env.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use crate::{constants::*, Credential};
+use crate::{Credential, constants::*};
use async_trait::async_trait;
use reqsign_core::{Context, ProvideCredential, Result};
diff --git a/services/tencent-cos/src/sign_request.rs
b/services/tencent-cos/src/sign_request.rs
index 779a1c7..f81249d 100644
--- a/services/tencent-cos/src/sign_request.rs
+++ b/services/tencent-cos/src/sign_request.rs
@@ -15,15 +15,15 @@
// specific language governing permissions and limitations
// under the License.
-use crate::constants::TENCENT_URI_ENCODE_SET;
use crate::Credential;
+use crate::constants::TENCENT_URI_ENCODE_SET;
use async_trait::async_trait;
use http::header::{AUTHORIZATION, DATE};
use http::request::Parts;
use log::debug;
use percent_encoding::{percent_decode_str, utf8_percent_encode};
use reqsign_core::hash::{hex_hmac_sha1, hex_sha1};
-use reqsign_core::time::{format_http_date, now, Timestamp};
+use reqsign_core::time::{Timestamp, format_http_date, now};
use reqsign_core::{Context, Result, SignRequest, SigningRequest};
use std::time::Duration;
@@ -200,5 +200,8 @@ fn build_signature(
let signature = hex_hmac_sha1(sign_key.as_bytes(),
string_to_sign.as_bytes());
-
format!("q-sign-algorithm=sha1&q-ak={}&q-sign-time={}&q-key-time={}&q-header-list={}&q-url-param-list={}&q-signature={}",
cred.secret_id, key_time, key_time, header_list, param_list, signature)
+ format!(
+
"q-sign-algorithm=sha1&q-ak={}&q-sign-time={}&q-key-time={}&q-header-list={}&q-url-param-list={}&q-signature={}",
+ cred.secret_id, key_time, key_time, header_list, param_list, signature
+ )
}
diff --git a/services/tencent-cos/tests/main.rs
b/services/tencent-cos/tests/main.rs
index a36bebc..cf14cfb 100644
--- a/services/tencent-cos/tests/main.rs
+++ b/services/tencent-cos/tests/main.rs
@@ -18,14 +18,14 @@
use std::env;
use std::time::Duration;
-use http::header::AUTHORIZATION;
-use http::header::CONTENT_LENGTH;
use http::Request;
use http::StatusCode;
+use http::header::AUTHORIZATION;
+use http::header::CONTENT_LENGTH;
use log::debug;
use log::warn;
-use percent_encoding::utf8_percent_encode;
use percent_encoding::NON_ALPHANUMERIC;
+use percent_encoding::utf8_percent_encode;
use reqsign_core::Result;
use reqsign_core::{Context, OsEnv, Signer};
use reqsign_file_read_tokio::TokioFileRead;