First off, arc_ecto's support for signed S3 urls is fantastic. The library in general makes it easy to version & apply transforms to your assets. Kudos!
However, for the library to support signed cloudfront URL's, I had to do a little regex to remove the versioning[0]:
# In reality, I take the version number and pass it as an additional parameter after signing
String.replace(App.Record.url({song.record, song}), ~r/(\?v=).*$/, "")
Because otherwise running the Cloudfront signing script[1] would now have two ?'s in the URL, thereby breaking the URL and having Cloudfront cache a 403 response for that asset. It would be kewl to add support for passing in your Cloudfront key pair. Would this be an issue for ex_aws?
[0] Thanks to #31 for the idea
[1] This is what I'm using https://github.com/Frameio/cloudfront-signer
First off, arc_ecto's support for signed S3 urls is fantastic. The library in general makes it easy to version & apply transforms to your assets. Kudos!
However, for the library to support signed cloudfront URL's, I had to do a little regex to remove the versioning[0]:
Because otherwise running the Cloudfront signing script[1] would now have two ?'s in the URL, thereby breaking the URL and having Cloudfront cache a 403 response for that asset. It would be kewl to add support for passing in your Cloudfront key pair. Would this be an issue for ex_aws?
[0] Thanks to #31 for the idea
[1] This is what I'm using https://github.com/Frameio/cloudfront-signer