From 93cf515a17eb200ccb041a85f532f7a43a1b2985 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 12 Mar 2024 10:25:22 +0100 Subject: [PATCH] Add missing ACL ops handling Signed-off-by: Ben --- src/sdk/namespace_gcp.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/sdk/namespace_gcp.js b/src/sdk/namespace_gcp.js index c06cbbe97e..81a63168f2 100644 --- a/src/sdk/namespace_gcp.js +++ b/src/sdk/namespace_gcp.js @@ -429,15 +429,22 @@ class NamespaceGCP { ////////// // ACLs // ////////// - + /* + NooBaa does not support ACLs - not for buckets, nor objects. + However, some S3 clients fail to function entirely without a valid response to execution of ACL operations. + Thus, we opted to implement a faux-support for the operation - enough to allow the clients to work, but still without supporting ACLs. + The reason that read_object_md() is used, is to allow potential errors to rise up if necessary - + for example, if the user tries to interact with an object that does not exist, the operation would fail as expected with NoSuchObject. + */ async get_object_acl(params, object_sdk) { dbg.log0('NamespaceGCP.get_object_acl:', this.bucket, inspect(params)); - throw new S3Error(S3Error.NotImplemented); + await this.read_object_md(params, object_sdk); + return s3_utils.DEFAULT_OBJECT_ACL; } async put_object_acl(params, object_sdk) { dbg.log0('NamespaceGCP.put_object_acl:', this.bucket, inspect(params)); - throw new S3Error(S3Error.NotImplemented); + await this.read_object_md(params, object_sdk); } ///////////////////