This is an automated email from the ASF dual-hosted git repository.
xuanwo 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 87d614570 fix(correctess check): validate copy capability and request
(#7322)
87d614570 is described below
commit 87d6145702992f80f6bbc7ca0d697d4f74a563b0
Author: dentiny <[email protected]>
AuthorDate: Thu Mar 26 08:19:23 2026 -0700
fix(correctess check): validate copy capability and request (#7322)
---
core/core/src/layers/correctness_check.rs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/core/core/src/layers/correctness_check.rs
b/core/core/src/layers/correctness_check.rs
index 9ed9845e9..2620111c6 100644
--- a/core/core/src/layers/correctness_check.rs
+++ b/core/core/src/layers/correctness_check.rs
@@ -217,6 +217,19 @@ impl<A: Access> LayeredAccess for CorrectnessAccessor<A> {
})
}
+ async fn copy(&self, from: &str, to: &str, args: OpCopy) -> Result<RpCopy>
{
+ let capability = self.info.full_capability();
+ if args.if_not_exists() && !capability.copy_with_if_not_exists {
+ return Err(new_unsupported_error(
+ &self.info,
+ Operation::Copy,
+ "if_not_exists",
+ ));
+ }
+
+ self.inner.copy(from, to, args).await
+ }
+
async fn list(&self, path: &str, args: OpList) -> Result<(RpList,
Self::Lister)> {
self.inner.list(path, args).await
}