aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/error.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-23 16:49:50 +0100
committerAlex Auvolat <alex@adnab.me>2024-03-07 15:43:47 +0100
commit57acc60082089e1a24fd47588f6ff3cb20ed4eef (patch)
treed616a16a2225d81da6996386d19417bc04d785ac /src/api/s3/error.rs
parentfe2dc5d51c206c21ab15d9cc93fa1d1c52d95c46 (diff)
downloadgarage-57acc60082089e1a24fd47588f6ff3cb20ed4eef.tar.gz
garage-57acc60082089e1a24fd47588f6ff3cb20ed4eef.zip
[sse-c] Implement SSE-C encryption
Diffstat (limited to 'src/api/s3/error.rs')
-rw-r--r--src/api/s3/error.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/s3/error.rs b/src/api/s3/error.rs
index f86c19a6..5cb5d04e 100644
--- a/src/api/s3/error.rs
+++ b/src/api/s3/error.rs
@@ -65,6 +65,10 @@ pub enum Error {
#[error(display = "Invalid HTTP range: {:?}", _0)]
InvalidRange(#[error(from)] (http_range::HttpRangeParseError, u64)),
+ /// The client sent a range header with invalid value
+ #[error(display = "Invalid encryption algorithm: {:?}, should be AES256", _0)]
+ InvalidEncryptionAlgorithm(String),
+
/// The client sent a request for an action not supported by garage
#[error(display = "Unimplemented action: {}", _0)]
NotImplemented(String),
@@ -126,6 +130,7 @@ impl Error {
Error::InvalidXml(_) => "MalformedXML",
Error::InvalidRange(_) => "InvalidRange",
Error::InvalidUtf8Str(_) | Error::InvalidUtf8String(_) => "InvalidRequest",
+ Error::InvalidEncryptionAlgorithm(_) => "InvalidEncryptionAlgorithmError",
}
}
}
@@ -143,6 +148,7 @@ impl ApiError for Error {
| Error::InvalidPart
| Error::InvalidPartOrder
| Error::EntityTooSmall
+ | Error::InvalidEncryptionAlgorithm(_)
| Error::InvalidXml(_)
| Error::InvalidUtf8Str(_)
| Error::InvalidUtf8String(_) => StatusCode::BAD_REQUEST,