Re: Generate S3 signed URL expiration

1,763 views
Skip to first unread message

geemus (Wesley Beary)

unread,
Sep 19, 2012, 5:41:20 PM9/19/12
to ruby...@googlegroups.com
No problem. It appear to be controlled by the
fog_authenticated_url_expiration setting in carrierwave (and it does
in fact default to 10 minutes from when you request the link). See:
https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/storage/fog.rb#L25

On Wed, Sep 19, 2012 at 11:58 AM, Richard Michael
<rmic...@edgeofthenet.org> wrote:
> Hello,
>
> I'm new to fog and S3; I'm using it via CarrierWave.
>
> I haven't seen much discussion of the expiration of the signed URLs for S3
> objects. The URLs have 'Expires=xxxx', where xxxx appears to be 10 minutes
> from "now" in seconds. Is that correct? Then, where is the amount time
> being controlled? Fog, CarrierWave, or AWS S3 policy?
>
> I'd like to print a nice "Download link will expire at ...." message for my
> users.
>
> Thank you; sorry if this is off-topic.

Richard Michael

unread,
Sep 19, 2012, 5:52:03 PM9/19/12
to ruby...@googlegroups.com
On Wednesday, September 19, 2012 11:41:20 PM UTC+2, geemus wrote:
No problem.  It appear to be controlled by the
fog_authenticated_url_expiration setting in carrierwave (and it does
in fact default to 10 minutes from when you request the link).  See:
https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/storage/fog.rb#L25

Wow, odd timing, I just found this CW code as well and was returning to answer [or kill] my post.

I read through your Fog tutorial, the AWS dev guide (noticed the 15 minute time-limit) and a good portion of the AWS-related Fog code to discover Fog::Storage::AWS::File#url in aws/models/storage/file.rb, which lead me back to CarrierWave's fog.rb code.  We must have been browsing it at the same time. :-)

Thanks Wesley!

geemus (Wesley Beary)

unread,
Sep 19, 2012, 5:55:49 PM9/19/12
to ruby...@googlegroups.com
Sure thing.
Reply all
Reply to author
Forward
0 new messages