Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

refactor(services/azblob): Adopt new reqsign #1902

Merged
merged 4 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ redis = { version = "0.22", features = [
"tokio-comp",
"connection-manager",
], optional = true }
# NOTE: we keep this for service migration one by one. And finally we will replace reqsign by v0.9.
reqsign = "0.8.5"
reqsign_0_9 = { package = "reqsign", git = "https://github.com/Xuanwo/reqsign", rev = "c1e44223a984a612b63c80ee8092f0c089ff62bd" }
reqwest = { version = "0.11.13", features = [
"multipart",
"stream",
Expand Down
10 changes: 10 additions & 0 deletions core/src/raw/http_util/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ pub fn new_request_build_error(err: http::Error) -> Error {
.set_source(err)
}

/// Create a new error happened during signing request.
pub fn new_request_credential_error(err: anyhow::Error) -> Error {
Error::new(
ErrorKind::Unexpected,
"loading credentail to sign http request",
)
.with_operation("reqsign::LoadCredential")
.set_source(err)
}

/// Create a new error happened during signing request.
pub fn new_request_sign_error(err: anyhow::Error) -> Error {
Error::new(ErrorKind::Unexpected, "signing http request")
Expand Down
1 change: 1 addition & 0 deletions core/src/raw/http_util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub use uri::percent_encode_path;

mod error;
pub use error::new_request_build_error;
pub use error::new_request_credential_error;
pub use error::new_request_sign_error;
pub use error::parse_error_response;
pub use error::ErrorResponse;
Expand Down
Loading