aboutsummaryrefslogtreecommitdiff
path: root/src/api/signature.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-07-08 13:33:02 +0200
committerAlex Auvolat <alex@adnab.me>2020-07-08 13:33:02 +0200
commit86fb7bbba5aefc797f359bd84676637f0232b709 (patch)
tree22e90454f0c5ccd50a0e9dbdeec516ddd7955edf /src/api/signature.rs
parentf22ecb60a8e1848de95e1bd3104b0ceec7058f0c (diff)
downloadgarage-86fb7bbba5aefc797f359bd84676637f0232b709.tar.gz
garage-86fb7bbba5aefc797f359bd84676637f0232b709.zip
Apply cargo fmt; add trace output when request signature is bad
Diffstat (limited to 'src/api/signature.rs')
-rw-r--r--src/api/signature.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/api/signature.rs b/src/api/signature.rs
index 65f31f21..798ba7fb 100644
--- a/src/api/signature.rs
+++ b/src/api/signature.rs
@@ -91,6 +91,9 @@ pub async fn check_signature(garage: &Garage, request: &Request<Body>) -> Result
let signature = hex::encode(hmac.result().code());
if authorization.signature != signature {
+ trace!("Canonical request: ``{}``", canonical_request);
+ trace!("String to sign: ``{}``", string_to_sign);
+ trace!("Expected: {}, got: {}", signature, authorization.signature);
return Err(Error::Forbidden(format!("Invalid signature")));
}