tweedegolf / storage-abstraction

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

Google cloud storage adapter assumes create bucket IAM permissions #42

Closed rupurt closed 1 year ago

rupurt commented 1 year 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 1 year 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 1 year ago

fixed in 1.4.7

rupurt commented 1 year ago

Awesome. Thank you!

abudaan commented 1 year ago

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