Skip to content
Faraday middleware for AWS Signature Version 4.
Branch: master
Clone or download
Genki Sugawara
Genki Sugawara Merge pull request #15 from winebarrel/remove_net_http_normarize
Remove net/http normalization
Latest commit 6c872f4 Oct 5, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin first commit Jul 26, 2015
lib Remove net/http normalization Oct 5, 2017
spec Remove net/http normalization Oct 5, 2017
.gitignore first commit Jul 26, 2015
.rspec first commit Jul 26, 2015
.travis.yml Fix rvm: add 2.4.0 Feb 26, 2017
Gemfile first commit Jul 26, 2015
LICENSE.txt first commit Jul 26, 2015
README.md Update README.md Sep 12, 2017
Rakefile first commit Jul 26, 2015
faraday_middleware-aws-signers-v4.gemspec Removing Accept-Encoding header & bump version to 0.1.9 Oct 5, 2017

README.md

FaradayMiddleware::AwsSignersV4

Faraday middleware for AWS Signature Version 4.

Gem Version Build Status Coverage Status

Currently developing new gem to support aws-sdk-v3.

see https://github.com/winebarrel/faraday_middleware-aws-sigv4

Installation

Add this line to your application's Gemfile:

gem 'faraday_middleware-aws-signers-v4'

And then execute:

$ bundle

Or install it yourself as:

$ gem install faraday_middleware-aws-signers-v4

Usage

require 'faraday_middleware'
require 'faraday_middleware/aws_signers_v4'
require 'pp'

conn = Faraday.new(url: 'https://apigateway.us-east-1.amazonaws.com') do |faraday|
  faraday.request :aws_signers_v4,
    credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']),
    # If you use the credentials file:
    #credentials: Aws::SharedCredentials.new.credentials,
    service_name: 'apigateway',
    region: 'us-east-1'

  faraday.response :json, :content_type => /\bjson\b/
  faraday.response :raise_error

  faraday.adapter Faraday.default_adapter
end

res = conn.get '/account'
pp res.body
# => {"accountUpdate"=>
#      {"name"=>nil,
#       "template"=>false,
#       "templateSkipList"=>nil,
#       "title"=>nil,
#       "updateAccountInput"=>nil},
#     "cloudwatchRoleArn"=>nil,
#     "self"=>
#      {"__type"=>
#        "GetAccountRequest:http://internal.amazon.com/coral/com.amazonaws.backplane.controlplane/",
#       "name"=>nil,
#       "template"=>false,
#       "templateSkipList"=>nil,
#       "title"=>nil},
#     "throttleSettings"=>{"burstLimit"=>1000, "rateLimit"=>500.0}}
You can’t perform that action at this time.