Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for signed Cloudfront web distributions. #112

Open
silentsilas opened this issue Feb 22, 2019 · 0 comments
Open

Support for signed Cloudfront web distributions. #112

silentsilas opened this issue Feb 22, 2019 · 0 comments

Comments

@silentsilas
Copy link

silentsilas commented Feb 22, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant