faraday_middleware-aws-signers-v4 0.1.9 → 0.2.0.beta

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: e51ab083a12196ffff95baaa679c8e97f28c9808
4
- data.tar.gz: 6e9a768361ff3324d17ec87950f62abd1cf2ef87
3
+ metadata.gz: 2a03c4e8216425e44748cebbcf5ecdadf194f25c
4
+ data.tar.gz: 381414ca6fa0e15c30b82e2dfe28c2c4f1f42591
5
5
  SHA512:
6
- metadata.gz: 54094f40bea88a65ab3a881d979e1727b490db066c1025b7150e8b026e22965946b0a4e1f5bedb654dd46121ecfd71e41127d696894a98c7c312b4c804a2e508
7
- data.tar.gz: 18c3665bd56978eab9e0105f91757cf8ce4045f7364f6dcb33a6311e431a1be9d2f2bf2993fba8e0913814074956b683a83a4d2665c324a7778b84ca7cec4019
6
+ metadata.gz: f4a91de995ed4c938f6f402e50d8741a0a6a5eeea37e38fe165e6cc414e3519e218873561fef1d6e394736fb9ce90f29ab39245ae7c96dd48d84a9a7952634a9
7
+ data.tar.gz: 51454e9993c7f7461f4324d1c6356729af0a750b6a9e4c54016be3b4397a33c13b57aec1d072b06edad922a60df2ed51898d120a2ac8be930ce949bb98b05aa8
data/README.md CHANGED
@@ -6,10 +6,6 @@
6
6
  [![Build Status](https://travis-ci.org/winebarrel/faraday_middleware-aws-signers-v4.svg)](https://travis-ci.org/winebarrel/faraday_middleware-aws-signers-v4)
7
7
  [![Coverage Status](https://coveralls.io/repos/winebarrel/faraday_middleware-aws-signers-v4/badge.svg?branch=master&service=github)](https://coveralls.io/github/winebarrel/faraday_middleware-aws-signers-v4?branch=master)
8
8
 
9
- **Currently developing new gem to support aws-sdk-v3.**
10
-
11
- **see https://github.com/winebarrel/faraday_middleware-aws-sigv4**
12
-
13
9
  ## Installation
14
10
 
15
11
  Add this line to your application's Gemfile:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = 'faraday_middleware-aws-signers-v4'
4
- spec.version = '0.1.9'
4
+ spec.version = '0.2.0.beta'
5
5
  spec.authors = ['Genki Sugawara']
6
6
  spec.email = ['sgwr_dts@yahoo.co.jp']
7
7
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.require_paths = ['lib']
17
17
 
18
18
  spec.add_dependency 'faraday', '~> 0.9'
19
- spec.add_dependency 'aws-sdk-resources', '>= 2', '< 3'
19
+ spec.add_dependency 'aws-sdk-resources', '~> 3.0.0.rc2'
20
20
 
21
21
  spec.add_development_dependency 'bundler'
22
22
  spec.add_development_dependency 'rake'
@@ -1,4 +1,4 @@
1
- require 'aws-sdk-core/signers/v4'
1
+ require 'aws-sdk/signers/v4'
2
2
 
3
3
  module AwsSignersV4Ext
4
4
  def signed_headers(request)
@@ -47,11 +47,29 @@ class FaradayMiddleware::AwsSignersV4 < Faraday::Middleware
47
47
  @credentials = options.fetch(:credentials)
48
48
  @service_name = options.fetch(:service_name)
49
49
  @region = options.fetch(:region)
50
+ @net_http = net_http?(app)
50
51
  end
51
52
 
52
53
  def call(env)
54
+ normalize_for_net_http!(env)
53
55
  req = Request.new(env)
54
56
  Aws::Signers::V4.new(@credentials, @service_name, @region).sign(req)
55
57
  @app.call(env)
56
58
  end
59
+
60
+ private
61
+
62
+ def net_http?(app)
63
+ app.is_a?(Faraday::Adapter::NetHttp)
64
+ end
65
+
66
+ def normalize_for_net_http!(env)
67
+ return unless @net_http
68
+
69
+ if Net::HTTP::HAVE_ZLIB
70
+ env.request_headers['Accept-Encoding'] ||= 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3'
71
+ end
72
+
73
+ env.request_headers['Accept'] ||= '*/*'
74
+ end
57
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday_middleware-aws-signers-v4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -28,22 +28,16 @@ dependencies:
28
28
  name: aws-sdk-resources
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '2'
34
- - - "<"
31
+ - - "~>"
35
32
  - !ruby/object:Gem::Version
36
- version: '3'
33
+ version: 3.0.0.rc2
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '2'
44
- - - "<"
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '3'
40
+ version: 3.0.0.rc2
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: bundler
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -179,12 +173,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
173
  version: '0'
180
174
  required_rubygems_version: !ruby/object:Gem::Requirement
181
175
  requirements:
182
- - - ">="
176
+ - - ">"
183
177
  - !ruby/object:Gem::Version
184
- version: '0'
178
+ version: 1.3.1
185
179
  requirements: []
186
180
  rubyforge_project:
187
- rubygems_version: 2.6.13
181
+ rubygems_version: 2.5.2
188
182
  signing_key:
189
183
  specification_version: 4
190
184
  summary: Faraday middleware for AWS Signature Version 4.