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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04d01d53019744035c4c7e174ca7059ee76fd256
4
- data.tar.gz: 1b1d4951867ba4a4b1014c72a6076cee08553e63
3
+ metadata.gz: 6e1c634322ee8d870834ad6d06e8d36e99cee405
4
+ data.tar.gz: 59e9fa72e629916c1d8259a231630f865a6c813d
5
5
  SHA512:
6
- metadata.gz: 443bd19a591d6f770de0b313e045583d495525df7fa06d94940f6137dcbbe9efce2e369f1bacb74470c269e9fa415ad9b1e1e78b3c6762b5d66baa1b78eac49f
7
- data.tar.gz: ea17b7749b17fb5adf63a59ee10fe7361a517d8231eac057c98f1013e1e6cd90d0fd1f8fd10f7b95e7bbb259f8896736cc5d9039852f6b901425ef69ce0d512c
6
+ metadata.gz: f7d50f1373c7061c61a46a04c1715c73445556e72b5e11090e6498e151c2e533dc2064b73a9e2eae4e13e3babf559f84ad24307b693664544adb037e32aa73bc
7
+ data.tar.gz: 17acbe1cd9401f31e9218add7405f0a985dcf8a1888323f445dff1c15ad05694f1a07464f6efe049c1beebfc879b6439a46bf52527b168ea34e0887ef30df22b
@@ -1,4 +1,4 @@
1
1
  require_relative "elasticsearch/transport/transport/http/aws"
2
2
  module AwsEsTransport
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
@@ -29,19 +29,23 @@ class AwsV4Signer < Faraday::Middleware
29
29
  end
30
30
  end
31
31
 
32
- def initialize(app, options = nil)
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
- credentials = options.fetch(:credentials)
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
- @signer.sign(req)
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.2
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-10-22 00:00:00.000000000 Z
11
+ date: 2015-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler