This is an automated email from the ASF dual-hosted git repository.
asukaminato0721 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 66407852d feat(core): enable presign delete (#7386)
66407852d is described below
commit 66407852d402bc95b5fb15350975e8275089052e
Author: Anand Dubey <[email protected]>
AuthorDate: Tue Jul 7 17:27:57 2026 +0530
feat(core): enable presign delete (#7386)
* feat(core): enable presign delete
* refactor(services/s3): keep sync delete request builder and async
s3_delete_object sender
Address review feedback: make s3_delete_object_request a plain fn and
restore s3_delete_object mirroring the s3_head_object pattern.
---
core/services/s3/src/backend.rs | 6 ++----
core/services/s3/src/core.rs | 17 +++++++++++------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/core/services/s3/src/backend.rs b/core/services/s3/src/backend.rs
index 624351c6c..f6002d5a2 100644
--- a/core/services/s3/src/backend.rs
+++ b/core/services/s3/src/backend.rs
@@ -1006,6 +1006,7 @@ impl Builder for S3Builder {
presign_stat: true,
presign_read: true,
presign_write: true,
+ presign_delete: true,
shared: true,
@@ -1209,10 +1210,7 @@ impl Service for S3Backend {
self.core
.s3_put_object_request(path, None, &v, Buffer::new())
}
- PresignOperation::Delete(_) => Err(Error::new(
- ErrorKind::Unsupported,
- "operation is not supported",
- )),
+ PresignOperation::Delete(v) =>
self.core.s3_delete_object_request(path, &v),
_ => Err(Error::new(
ErrorKind::Unsupported,
"operation is not supported",
diff --git a/core/services/s3/src/core.rs b/core/services/s3/src/core.rs
index 77877b341..a66d204ee 100644
--- a/core/services/s3/src/core.rs
+++ b/core/services/s3/src/core.rs
@@ -646,12 +646,7 @@ impl S3Core {
self.send(ctx, req).await
}
- pub async fn s3_delete_object(
- &self,
- ctx: &OperationContext,
- path: &str,
- args: &OpDelete,
- ) -> Result<Response<Buffer>> {
+ pub fn s3_delete_object_request(&self, path: &str, args: &OpDelete) ->
Result<Request<Buffer>> {
let p = build_abs_path(&self.root, path);
let mut url = format!("{}/{}", self.endpoint, percent_encode_path(&p));
@@ -682,6 +677,16 @@ impl S3Core {
.body(Buffer::new())
.map_err(new_request_build_error)?;
+ Ok(req)
+ }
+
+ pub async fn s3_delete_object(
+ &self,
+ ctx: &OperationContext,
+ path: &str,
+ args: &OpDelete,
+ ) -> Result<Response<Buffer>> {
+ let req = self.s3_delete_object_request(path, args)?;
self.send(ctx, req).await
}