-
Notifications
You must be signed in to change notification settings - Fork 275
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
download_endpoint: Adds support for expiring URLs #708
base: master
Are you sure you want to change the base?
download_endpoint: Adds support for expiring URLs #708
Conversation
- Adds `expires_in` and `verifier_secret` to `download_endpoint` plugin - This allows calling `attachment.download_url(expires_in: 5 * 60)` to generate a URL that expires in 5 minutes. - The URL is signed and verified with ActiveSupport::MessageVerifier.
I suspect the use of AS::Verifier is going to be an issue. We might need to go with |
I'll try it out 🙂 |
Yes, Shrine doesn't depend on Active Support, so I want to avoid it if possible, even as an optional dependency. The |
Now I rewrote it to use OpenSSL-directly 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done adapting it for OpenSSL::HMAC
. Few comments but overall looks good IMHO. Will leave final sign-off for Janko ofc.
@janko could you allow the tests to run? They crash on my side because of |
@janko Sorry for a second (and last) ping, do you think there would be bandwidth for handling this PR within November? |
expires_in
andsecret_key
todownload_endpoint
pluginattachment.download_url(expires_in: 5 * 60)
to generate a URL including
signature
andexpires_at
as query parameters. The timestamp is included in the signature and will only work before that timestamp.