faraday_middleware-aws-sigv4 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1377fa87ae2a9265349c3706b9e81c886e54fe5
4
- data.tar.gz: 9f6aaed4d6cf055991a01b3c43e90a08fc3c3c5e
3
+ metadata.gz: 42b88ed15297939d63b3e293a18e373c515e1251
4
+ data.tar.gz: e2862c46d2fa4264c581d5d7d54d317ee9924227
5
5
  SHA512:
6
- metadata.gz: dc7a30d1d30f74554d50bb9a3a78f5dc903f6343bf251df311d9754af475bc7cce31bcc0d05d9c184bbd46f3544f4822b688da2cc328661ccf95fdde027874cf
7
- data.tar.gz: ac21f94a8e23780e925a97721d4e2a748abdef6e670d41778a7bcd896de760c963f172965888eb22e6e388ec9d009f666c30fbf07e6a98ca4b6a6e0d336e3092
6
+ metadata.gz: 3bf600b1a92fb0bd8278635c12b28e1cf6b747f79057973df86fd91a769c303b114d3babb0b1a918cc64369b9c70b834f572f9da4025684872e8050dbe655923
7
+ data.tar.gz: babc795cc3c599db0aa595026ca738bdfc9a76610d216777c7167725a07dab183a8a0567abe7e6f92533726c34ad821b0296265a9a5ec54bc81a25fab72f9bfe
data/README.md CHANGED
@@ -47,13 +47,18 @@ end
47
47
  res = conn.get '/account'
48
48
 
49
49
  pp res.body
50
- #=>{"_links"=>
51
- # {"curies"=>
52
- # {"href"=>
53
- # "http://docs.aws.amazon.com/apigateway/latest/developerguide/account-apigateway-{rel}.html",
54
- # "name"=>"account",
55
- # "templated"=>true},
56
- # "self"=>{"href"=>"/account"},
57
- # "account:update"=>{"href"=>"/account"}},
58
- # "throttleSettings"=>{"rateLimit"=>10000.0, "burstLimit"=>5000}}
50
+ #=> {"_links"=>
51
+ # {"curies"=>
52
+ # {"href"=>
53
+ # "http://docs.aws.amazon.com/apigateway/latest/developerguide/account-apigateway-{rel}.html",
54
+ # "name"=>"account",
55
+ # "templated"=>true},
56
+ # "self"=>{"href"=>"/account"},
57
+ # "account:update"=>{"href"=>"/account"}},
58
+ # "throttleSettings"=>{"rateLimit"=>10000.0, "burstLimit"=>5000}}
59
59
  ```
60
+
61
+ ## Related Links
62
+
63
+ * http://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Sigv4/Signer.html
64
+ * https://github.com/winebarrel/faraday_middleware-aws-signers-v4 (aws-sdk-v2 version)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'faraday_middleware-aws-sigv4'
7
- spec.version = '0.1.0'
7
+ spec.version = '0.2.0'
8
8
  spec.authors = ['Genki Sugawara']
9
9
  spec.email = ['sugawara@cookpad.com']
10
10
 
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'rspec', '~> 3.0'
30
30
  spec.add_development_dependency 'timecop'
31
31
  spec.add_development_dependency 'coveralls'
32
+ spec.add_development_dependency 'aws-sdk-core', '~> 3.0'
32
33
  end
@@ -6,7 +6,7 @@ class FaradayMiddleware::AwsSigV4 < Faraday::Middleware
6
6
 
7
7
  def initialize(app, options = nil)
8
8
  super(app)
9
- build_signer(options) # check options
9
+ @signer = Aws::Sigv4::Signer.new(options)
10
10
  @options = options
11
11
  end
12
12
 
@@ -18,14 +18,12 @@ class FaradayMiddleware::AwsSigV4 < Faraday::Middleware
18
18
  private
19
19
 
20
20
  def sign!(env)
21
- signer = build_signer(@options)
22
-
23
21
  if net_http_adapter?
24
22
  normalize_for_net_http!(env)
25
23
  end
26
24
 
27
25
  request = build_aws_sigv4_request(env)
28
- signature = signer.sign_request(request)
26
+ signature = @signer.sign_request(request)
29
27
 
30
28
  env.request_headers.update(signature.headers)
31
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday_middleware-aws-sigv4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: aws-sdk-core
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.0'
125
139
  description: Faraday middleware for AWS Signature Version 4 using aws-sigv4.
126
140
  email:
127
141
  - sugawara@cookpad.com