omeka / Omeka

A flexible web publishing platform for the display of library, museum and scholarly collections, archives and exhibitions.
http://omeka.org
GNU General Public License v3.0
472 stars 193 forks source link

S3 storage for buckets with V4 authorization #755

Open mikesname opened 7 years ago

mikesname commented 7 years ago

We would find S3 object storage extremely useful but I was not able to get it work when configured via the Omeka_Storage_Adapter_ZendS3. It turns out that this is because we're using the Frankfurt region, which requires a newer (v4) authorisation mechanism than older regions. The specific error is:

InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

Presumably, newer versions of the Zend S3 library add support for this, but is there any chance of getting it in Omeka?

zerocrates commented 7 years ago

Presumably, newer versions of the Zend S3 library add support for this

Zend support is complicated because they've shifted to a different branch of things for their ongoing development (versions 2 and 3 of the framework) while Omeka is using version 1.

Even putting that aside, from what I can see of their most up-to-date version of their AWS support library, it doesn't support this newer auth method anyway.

So, we'd have to implement it ourselves or switch to another library for implementing our AWS storage. A plugin could implement an S3 storage adapter using the official Amazon PHP SDK, for example, which does use the newer auth.

mikesname commented 7 years ago

Thanks for the background. I've made a plugin adapter with the official SDK (PHP 5.5+) and, although not tested much yet, it seems to work for my use-case:

https://github.com/EHRI/omeka-amazon-s3-storage-adapter

zerocrates commented 7 years ago

Cool!

A plugin's probably the most natural place for this because the official SDK has so much higher minimum requirements than Omeka itself.