Split presigned signature verification + fix conditions #735

Merged
lx merged 6 commits from fix-presigned into main 2024-02-28 11:38:01 +00:00
Showing only changes of commit 2efa9c5a1a - Show all commits

View file

@ -449,6 +449,16 @@ impl Authorization {
}
pub(crate) fn parse_form(params: &HeaderMap) -> Result<Self, Error> {
let algorithm = params
.get(X_AMZ_ALGORITHM)
.ok_or_bad_request("Missing X-Amz-Algorithm header")?
.to_str()?;
if algorithm != AWS4_HMAC_SHA256 {
return Err(Error::bad_request(
"Unsupported authorization method".to_string(),
));
}
let credential = params
.get(X_AMZ_CREDENTIAL)
.ok_or_else(|| Error::forbidden("Garage does not support anonymous access yet"))?