appoxy / aws

Amazon Web Services (AWS) Ruby Gem

Home Page:https://rubygems.org/gems/aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signed urls for S3

gaffo opened this issue · comments

I can't find a method to create the signed url for S3. Is there one?

I don't think the AWS::S3 objects support generating a signed URL, but the lower-level S3Interface class does. See this link: http://rubydoc.info/github/appoxy/aws/master/Aws/S3Interface#get_link-instance_method

The generatrors are what you need:
bucket_gen = Aws::S3Generator::Bucket.create(s3, bucket)

  a_cloud_item.preview_url = metaBucket_gen.get(itemkey, expiresAt) #=> https://s3.amazonaws.com:443/my_awesome_bucket/my_cool_key?Signature=h...M%3D&Expires=1180820032&AWSAccessKeyId=1...2