Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

s3_sig_gen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3_sig_gen

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

S3SigGen

Authenticate requests for browser based direct uploads to AWS S3.

Direct upload to AWS S3

Installation

gem 's3_sig_gen', :git => 'git@github.com:diakonovm/s3_sig_gen.git'

Usage

s3_sig_gen = S3SigGen::Generator.new do |g|
  g.aws_access_key_id = ENV["AWS_ACCESS_KEY_ID"]
  g.aws_secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
  g.region = "us-east-1"
  g.bucket = "sample-bucket"
  g.key = "sample_key"
  g.acl = "public-read"
end
@signature = s3_sig_gen.signature

or

options = {
  aws_access_key_id: ENV["AWS_ACCESS_KEY_ID"],
  aws_secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"],
  region: 'us-east-1',
  bucket: 'sample-bucket',
  key: 'sample_key',
  acl: 'public-read'
}
s3_sig_gen = S3SigGen::Generator.new(options)
@signature = s3_sig_gen.signature
<!-- views/photos/new.html.erb -->

<form action="https://asdf.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
  <input type="hidden" name="key" value="<%= @signature["key"] %>" />
  <input type="hidden" name="acl" value="<%= @signature["acl"] %>" />
  <!-- <input type="hidden" name="x-amz-server-side-encryption" value="AES256" />  -->
  <input type="hidden" name="success_action_status" value="<%= @signature["success_action_status"] %>" />
  <input type="hidden" name="X-Amz-Credential" value="<%= @signature["x-amz-credential"] %>" />
  <input type="hidden" name="X-Amz-Algorithm" value="<%= @signature["x-amz-algorithm"] %>" />
  <input type="hidden" name="X-Amz-Date" value="<%= @signature["x-amz-date"] %>" />
  <input type="hidden" name="Policy" value="<%= @signature["policy"] %>" />
  <input type="hidden" name="X-Amz-Signature" value="<%= @signature["x-amz-signature"] %>" />
  File:
  <input type="file" name="file" /> <br />
  <input type="submit" name="submit" value="upload"/>
</form>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/diakonovm/s3_sig_gen.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 09 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc