From 746b0090e4ad02e98b08aa1cfefd77a22d9490fe Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 18 May 2023 00:06:03 +0200 Subject: k2v signature verification: double urlencoding (see comment in source code) --- src/garage/tests/common/custom_requester.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/garage/tests/common') diff --git a/src/garage/tests/common/custom_requester.rs b/src/garage/tests/common/custom_requester.rs index 609eda97..4133bb8b 100644 --- a/src/garage/tests/common/custom_requester.rs +++ b/src/garage/tests/common/custom_requester.rs @@ -209,6 +209,7 @@ impl<'a> RequestBuilder<'a> { all_headers.extend(self.unsigned_headers.clone()); let canonical_request = signature::payload::canonical_request( + self.service, &self.method, &Uri::try_from(&uri).unwrap(), &all_headers, -- cgit v1.2.3 From e2ce5970c6c1ee26e5aabf6b5dba8d641416fb53 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 19 May 2023 12:52:14 +0200 Subject: Add basic k2v_client integration tests --- src/garage/tests/common/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/garage/tests/common') diff --git a/src/garage/tests/common/mod.rs b/src/garage/tests/common/mod.rs index eca3e42b..0b8c6755 100644 --- a/src/garage/tests/common/mod.rs +++ b/src/garage/tests/common/mod.rs @@ -1,5 +1,6 @@ use aws_sdk_s3::{Client, Region}; use ext::*; +use k2v_client::K2vClient; #[macro_use] pub mod macros; @@ -68,6 +69,19 @@ impl Context { bucket_name } + + /// Build a K2vClient for a given bucket + pub fn k2v_client(&self, bucket: &str) -> K2vClient { + let config = k2v_client::K2vClientConfig { + region: REGION.to_string(), + endpoint: self.garage.k2v_uri().to_string(), + aws_access_key_id: self.key.id.clone(), + aws_secret_access_key: self.key.secret.clone(), + bucket: bucket.to_string(), + user_agent: None, + }; + K2vClient::new(config).expect("Could not create K2V client") + } } pub fn context() -> Context { -- cgit v1.2.3