apache / libcloud

Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API.
https://libcloud.apache.org
Apache License 2.0
2.04k stars 925 forks source link

Proposal: Sharable upload links for S3 and Azure Blobs #1458

Open avirshup opened 4 years ago

avirshup commented 4 years ago

Proposal -

This is a follow-up to @rvolykh's proposal in #1403 -

AWS S3 has the support of Presigned Object URL and Azure Blob Storage has the support of Shared access signature. [...] My proposal is to extend get_object_cdn_url with additional parameter (mode=["read", "write"]) and implement support for AWS S3 and Azure Blob Storage.

The "read" version of this functionality was implemented AWS S3 in #1453 and for Azure Blobs in #1408 via the StorageDriver.get_object_cdn_url method.

Here I'm proposing the "write" version - a method that generates a pre-authorized, time-limited URL that allows upload of a given object. I think the implementation would be trivial - just change

I'd be happy to contribute a PR for this. But I'm not sure where the new function would go, though. Would it make sense to add a new abstract method to StorageDriver, e.g., StorageDriver.get_presigned_upload_url(container: str, object_name: str) -> str?

c-w commented 4 years ago

This would be a great addition. I would suggest to for now use the extension method naming convention to introduce these methods to select storage drivers (e.g. ex_get_presigned_upload_url) and if the functionality gets implemented more widely we can promote the new methods to the core API. To validate the Azure Blobs functionality, I would suggest to also add some integration tests here.

stale[bot] commented 3 years ago

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.