apache / apache/libcloud

Proposal: Sharable upload links for S3 and Azure Blobs

Offen
#1,458 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: storage
Vorherrschende Sprache
Python
Sterne
2.1k
Forks
931
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
4

Beschreibung

## 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
- `"GET"` to `"PUT"` [here](https://github.com/apache/libcloud/blob/trunk/libcloud/storage/drivers/s3.py#L1168)
- `"r"` to `"w"` [here](https://github.com/apache/libcloud/blob/trunk/libcloud/storage/drivers/azure_blobs.py#L530).

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`?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with StorageDriver.get_object_cdn_url and the referenced implementations in libcloud/storage/drivers/s3.py around line 1168 and libcloud/storage/drivers/azure_blobs.py around line 530. Review how the existing read URLs are exposed, then determine the appropriate shared API for write URLs. Done means upload URLs work for both AWS S3 and Azure Blob Storage with a consistent public interface.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, azure, python
Bereich
cloud
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.