Skip to content

Commit e7d6cea

Browse files
committed
Add missing ACL ops handling
Signed-off-by: Ben <[email protected]>
1 parent 324d7f6 commit e7d6cea

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/sdk/namespace_gcp.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,15 +429,22 @@ class NamespaceGCP {
429429
//////////
430430
// ACLs //
431431
//////////
432-
432+
/*
433+
NooBaa does not support ACLs - not for buckets, nor objects.
434+
However, some S3 clients fail to function entirely without a valid response to execution of ACL operations.
435+
Thus, we opted to implement a faux-support for the operation - enough to allow the clients to work, but still without supporting ACLs.
436+
The reason that read_object_md() is used, is to allow potential errors to rise up if necessary -
437+
for example, if the user tries to interact with an object that does not exist, the operation would fail as expected with NoSuchObject.
438+
*/
433439
async get_object_acl(params, object_sdk) {
434440
dbg.log0('NamespaceGCP.get_object_acl:', this.bucket, inspect(params));
435-
throw new S3Error(S3Error.NotImplemented);
441+
await this.read_object_md(params, object_sdk);
442+
return s3_utils.DEFAULT_OBJECT_ACL;
436443
}
437444

438445
async put_object_acl(params, object_sdk) {
439446
dbg.log0('NamespaceGCP.put_object_acl:', this.bucket, inspect(params));
440-
throw new S3Error(S3Error.NotImplemented);
447+
await this.read_object_md(params, object_sdk);
441448
}
442449

443450
///////////////////

0 commit comments

Comments
 (0)