aws-es-transport 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws_es_transport.rb +1 -1
- data/lib/aws_v4_signer_impl.rb +10 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e1c634322ee8d870834ad6d06e8d36e99cee405
|
4
|
+
data.tar.gz: 59e9fa72e629916c1d8259a231630f865a6c813d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7d50f1373c7061c61a46a04c1715c73445556e72b5e11090e6498e151c2e533dc2064b73a9e2eae4e13e3babf559f84ad24307b693664544adb037e32aa73bc
|
7
|
+
data.tar.gz: 17acbe1cd9401f31e9218add7405f0a985dcf8a1888323f445dff1c15ad05694f1a07464f6efe049c1beebfc879b6439a46bf52527b168ea34e0887ef30df22b
|
data/lib/aws_es_transport.rb
CHANGED
data/lib/aws_v4_signer_impl.rb
CHANGED
@@ -29,19 +29,23 @@ class AwsV4Signer < Faraday::Middleware
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def signer
|
33
|
+
credentials = @options.fetch(:credentials)
|
34
|
+
service_name = @options.fetch(:service_name)
|
35
|
+
region = @options.fetch(:region)
|
36
|
+
Aws::Signers::V4.new(credentials, service_name, region)
|
37
|
+
end
|
38
|
+
|
39
|
+
def initialize(app, options = nil)
|
33
40
|
super(app)
|
34
|
-
|
35
|
-
service_name = options.fetch(:service_name)
|
36
|
-
region = options.fetch(:region) || "us-east-1"
|
37
|
-
@signer = Aws::Signers::V4.new(credentials, service_name, region)
|
41
|
+
@options = options
|
38
42
|
@net_http = app.is_a?(Faraday::Adapter::NetHttp)
|
39
43
|
end
|
40
44
|
|
41
45
|
def call(env)
|
42
46
|
normalize_for_net_http!(env)
|
43
47
|
req = Request.new(env)
|
44
|
-
|
48
|
+
signer().sign(req)
|
45
49
|
@app.call(env)
|
46
50
|
end
|
47
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-es-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cary Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|