Objects in S3 Bucket

17 views
Skip to first unread message

David Merrick

unread,
Feb 15, 2019, 11:27:51 PM2/15/19
to Ruby on Rails: Talk
Is there a way stop logged in users copying and pasting resources in a S3 Bucket to other people?


The 91155-EXP.pdf file only people who are logged can see.

I was wanting to know if something like this https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html would work 
or is there  cheaper easier option?

Cheers Dave

Rob Jonson

unread,
Feb 16, 2019, 4:41:33 AM2/16/19
to Ruby on Rails: Talk

On Saturday, 16 February 2019 04:27:51 UTC, David Merrick wrote:
Is there a way stop logged in users copying and pasting resources in a S3 Bucket to other people?

The easiest way to handle this is to deal with the doc through ActiveStorage where you let rails upload it into an amazon s3 bucket.

Active Storage will then generate an indirect link which goes through your app, and returns a signed time-limited AWS link.

You can add logic at the active storage controller to make sure the user is logged in, and if they copy and paste the redirected link - it won't work for long.

There is some good chat here about how it would be really nice to avoid this complication
but it should give you some background info anyway!

Alternatively, you could roll your own - I assume the private content doc you linked is what rails is using under the hood.


David Merrick

unread,
Feb 16, 2019, 1:53:08 PM2/16/19
to Ruby on Rails: Talk
Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/22a63ca8-cbee-4b76-b39d-8e6d007f3925%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Dave Merrick

Daves Web Designs

Website http://www.daveswebdesigns.co.nz

Email merri...@gmail.com

Ph   03 216 2053

Cell 027 3089 169
Reply all
Reply to author
Forward
0 new messages