robinrodricks / FluentStorage

A polycloud .NET cloud storage abstraction layer. Provides Blob storage (AWS S3, GCP, FTP, SFTP, Azure Blob/File/Event Hub/Data Lake) and Messaging (AWS SQS, Azure Queue/ServiceBus). Supports .NET 5+ and .NET Standard 2.0+. Pure C#.
MIT License
263 stars 33 forks source link

GCP Storage provider DeleteAsync will delete all files in bucket if target full path object is not found #60

Closed geoffreytran closed 2 weeks ago

geoffreytran commented 7 months ago

When a call to DeleteAsync() is provided with an invalid path, it will fall back to recursively deleting from the root of the bucket.

There appears to be an rm -rf /* type of issue with the way the recursive folder deletion is handled. It looks like this List call was supposed to be a ListAt call rather than listing the contents of the bucket.

https://github.com/robinrodricks/FluentStorage/blob/9cf945ed0ea3feaafacdb7d3dc5afb91eb7e2f12/FluentStorage.GCP/Blobs/GoogleCloudStorageBlobStorage.cs#L119

robinrodricks commented 7 months ago

If you can fix this and submit a PR, I would gladly accept it.

geoffreytran commented 7 months ago

Sure thing, I'll submit later this week!

robinrodricks commented 2 weeks ago

Closing this as fixed.