0

I don't know if this is a bug or if I'm just overlooking something here, but I can't seem to get the S3 adapter to use "private" for anything despite passing that to the visibility parameter. A quick rundown of the code:

use League\Flysystem\AwsS3V3\AwsS3V3Adapter;
use League\Flysystem\AwsS3V3\PortableVisibilityConverter;
use League\Flysystem\FilesystemAdapter;
use League\Flysystem\Visibility;

class Fs
{
    protected function createAdapter(): FilesystemAdapter
    {
        return new AwsS3V3Adapter($client, $bucket, $subfolder, new PortableVisibilityConverter(Visibility::PRIVATE), null, [], false);
    }
}

There's more to it than that, but this is the part that's causing me issues at the moment. Despite passing private to the visibility converter, all PutObject requests are setting the ACL to "public-read".

This is in an attempt to use this for Cloudflare R2 storage which currently doesn't support public reads, so all ACLs need to be set to private.

jrrdnx
  • 1,565
  • 3
  • 15
  • 23

1 Answers1

0

Despite Cloudflare advertising R2 as S3-API compatible, I do not believe it is. It appears they do NOT support the x-amx-acl header, and in fact throws a 501 error when attempting to including it when attempting the putObject.

You can see the exact current compatibilty chart for Cloudflare implementation here:

https://developers.cloudflare.com/r2/data-access/s3-api/api/

D B
  • 1
  • 2