From 906cc5ffd77b9f3876b702285d69f25d6f08c753 Mon Sep 17 00:00:00 2001 From: weisd Date: Wed, 4 Jun 2025 19:16:57 +0800 Subject: [PATCH] fix(rustfs):get_object_legal_hold default response --- rustfs/src/storage/ecfs.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index 950717d62..fdefb3b2f 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -2105,13 +2105,15 @@ impl S3 for FS { None }; - if legal_hold.is_none() { - return Err(s3_error!(InvalidRequest, "Object does not have legal hold")); - } + let status = if let Some(v) = legal_hold { + v + } else { + ObjectLockLegalHoldStatus::OFF.to_string() + }; Ok(S3Response::new(GetObjectLegalHoldOutput { legal_hold: Some(ObjectLockLegalHold { - status: Some(ObjectLockLegalHoldStatus::from(legal_hold.unwrap_or_default())), + status: Some(ObjectLockLegalHoldStatus::from(status)), }), })) } @@ -2173,6 +2175,20 @@ impl S3 for FS { request_charged: Some(RequestCharged::from_static(RequestCharged::REQUESTER)), })) } + + async fn get_object_retention( + &self, + _req: S3Request, + ) -> S3Result> { + Err(s3_error!(NotImplemented, "GetObjectRetention is not implemented yet")) + } + + async fn put_object_retention( + &self, + _req: S3Request, + ) -> S3Result> { + Err(s3_error!(NotImplemented, "PutObjectRetention is not implemented yet")) + } } #[allow(dead_code)]