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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a03c4e8216425e44748cebbcf5ecdadf194f25c
|
4
|
+
data.tar.gz: 381414ca6fa0e15c30b82e2dfe28c2c4f1f42591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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', '
|
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'
|
@@ -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.
|
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-
|
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:
|
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:
|
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:
|
178
|
+
version: 1.3.1
|
185
179
|
requirements: []
|
186
180
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
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.
|