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.