seung-lab / cloud-files

Threaded Python and CLI client library for AWS S3, Google Cloud Storage (GCS), in-memory, and the local filesystem.
BSD 3-Clause "New" or "Revised" License
36 stars 8 forks source link

No-credentials access to public S3 buckets #99

Closed ceesem closed 4 months ago

ceesem commented 5 months ago

Would it be possible to add the equivalent of the --no-sign-request flag used in aws s3 CLI options to the CloudFiles s3 interface? This would be functionally like use_https for gcs, albeit implemented differently.

At the boto client level, it appears like the pattern would be (untested by me):

import boto3
from botocore import UNSIGNED
from botocore.config import Config
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))
william-silversmith commented 4 months ago

Hi Casey!

This is a good idea. I've been annoyed by this missing feature too on occasion. Let me think about the right keyword to use. CloudFiles(..., public=True) or unsigned=True?

ceesem commented 4 months ago

I would suggest no_sign_request=True. It is clunky, but it aligns with the aws CLI and so is more likely to be discoverable.

william-silversmith commented 4 months ago

Hi Casey,

I added this feature in https://github.com/seung-lab/cloud-files/pull/103

Do you have a nice example file for me to test?

Will