Support STREAMING-AWS4-HMAC-SHA256-PAYLOAD (#64) #156

Merged
lx merged 11 commits from KokaKiwi/garage:aws4-payload-signing into main 2022-01-17 09:55:31 +00:00
Showing only changes of commit 11a1f3f6cf - Show all commits

View file

@ -504,11 +504,11 @@ pub async fn handle_complete_multipart_upload(
upload_id: &str,
content_sha256: Option<Hash>,
KokaKiwi marked this conversation as resolved Outdated
Outdated
Review

Is there a good reason to make this generic on error type E ? Most things in Garage aren't generic and just return an error::Error and that's simpler

Is there a good reason to make this generic on error type E ? Most things in Garage aren't generic and just return an `error::Error` and that's simpler
) -> Result<Response<Body>, Error> {
let content_sha256 =
content_sha256.ok_or_bad_request("Request content hash not signed, aborting.")?;
let body = hyper::body::to_bytes(req.into_body()).await?;
lx marked this conversation as resolved Outdated
Outdated
Review

In the current codebase, nothing is generic on the error type, we always use garage_api::error::Error. Is there a reason why StreamChunker needs a generic error type?

In the current codebase, nothing is generic on the error type, we always use `garage_api::error::Error`. Is there a reason why StreamChunker needs a generic error type?
if let Some(content_sha256) = content_sha256 {
verify_signed_content(content_sha256, &body[..])?;
}
let body_xml = roxmltree::Document::parse(std::str::from_utf8(&body)?)?;
let body_list_of_parts = parse_complete_multpart_upload_body(&body_xml)