tweedegolf / storage-abstraction

Provides an abstraction layer for interacting with a storage; the storage can be local or in the cloud.
MIT License
106 stars 18 forks source link

Google cloud storage adapter assumes create bucket IAM permissions #42

Closed rupurt closed 10 months ago

rupurt commented 11 months ago

The GCS adapter assumes that the configured credentials have been granted the permissions to create buckets. This is often not true and results in most calls failing when put object is granted but create bucket is not

e.g. init https://github.com/tweedegolf/storage-abstraction/blob/master/src/AdapterGoogleCloudStorage.ts#L84

How do you feel about changing the adapter to accept an argument such as assumeCreated: true so that it can bypass bucket creation but still list files and put/delete objects?

abudaan commented 10 months ago

Yes good point! I am working on a complete overhaul of the API; the new init() method won't create a bucket automatically anymore. That said: if you do not supply a bucket name in the config then init() won't call the createBucket() method.

abudaan commented 10 months ago

fixed in 1.4.7

rupurt commented 10 months ago

Awesome. Thank you!

abudaan commented 10 months ago

You're welcome! I had issues with publishing to npm to the latest version is 1.5.2