diplomat 0.11.0 → 0.12.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: 445d464dc2988296098c16f891bb2b46720f692c
4
- data.tar.gz: a4ee11cee9896935714210c1c59e7ddeb61cf986
3
+ metadata.gz: 2dd54168c7c65cea06154d8f9e4ba3e69bab7c04
4
+ data.tar.gz: 42f4033666bbe21e3ee2e47008d544be6dd573d4
5
5
  SHA512:
6
- metadata.gz: 1aed47485771894373cb7d45962d25462ac052943ae8a8be07c1b8e2cd44243f78c82f9872dff1036394da000f304391b0bebd26c6e4cf9cacb00f59e87f8b96
7
- data.tar.gz: 7d81ef5a30156f58b43bb3668b40c2f8c0291f024d9146c50720d02d856b71541d2927c17027ccbf7e6740dafb2d5598b65ff947e7b45ab8aa9576d36425d930
6
+ metadata.gz: ef4255c1bfd8befb00b543d681bbdfb10c757941b6beda2bf42e582574537198ccf16496ef79e2fd80ac7db9e6225b44c95d4196b49dcd887744ee505489985e
7
+ data.tar.gz: 46854909ad71908ccb8de42fefb8b97c9be1889011f830d7180d9fd01b11e0ec0cb39b869ea389754d88dc74e0723e0acece5330c0edde8bd24a2fcab3162dad
data/README.md CHANGED
@@ -184,6 +184,8 @@ Diplomat.configure do |config|
184
184
  config.middleware = MyCustomMiddleware
185
185
  # Connect into consul with custom access token (ACL)
186
186
  config.acl_token = "xxxxxxxx-yyyy-zzzz-1111-222222222222"
187
+ # Set extra Faraday configuration options
188
+ config.options = {ssl: { version: :TLSv1_2 }}
187
189
  end
188
190
  ```
189
191
 
@@ -194,7 +196,7 @@ This is traditionally kept inside the `config/initializers` directory if you're
194
196
  - [ ] Updating Docs with latest changes
195
197
  - [ ] Using custom objects for response objects (instead of openStruct)
196
198
  - [ ] PUTing and DELETEing services
197
- - [ ] Custom SSL Cert Middleware for faraday
199
+ - [x] Custom SSL Cert Middleware for faraday
198
200
  - [x] Allowing the custom configuration of the consul url to connect to
199
201
  - [x] Deleting Keys
200
202
  - [x] Listing available services
@@ -1,15 +1,17 @@
1
1
  module Diplomat
2
2
  class Configuration
3
3
  attr_accessor :middleware
4
- attr_accessor :url, :acl_token
4
+ attr_accessor :url, :acl_token, :options
5
5
 
6
6
  # Override defaults for configuration
7
7
  # @param url [String] consul's connection URL
8
8
  # @param acl_token [String] a connection token used when making requests to consul
9
- def initialize(url="http://localhost:8500", acl_token=nil)
9
+ # @param options [Hash] extra options to configure Faraday::Connection
10
+ def initialize(url="http://localhost:8500", acl_token=nil, options = {})
10
11
  @middleware = []
11
12
  @url = url
12
13
  @acl_token = acl_token
14
+ @options = options
13
15
  end
14
16
 
15
17
  # Define a middleware for Faraday
@@ -58,7 +58,7 @@ module Diplomat
58
58
  end
59
59
 
60
60
  def build_connection(api_connection, raise_error=false)
61
- return api_connection || Faraday.new(:url => Diplomat.configuration.url) do |faraday|
61
+ return api_connection || Faraday.new(Diplomat.configuration.url, Diplomat.configuration.options) do |faraday|
62
62
  faraday.adapter Faraday.default_adapter
63
63
  faraday.request :url_encoded
64
64
  faraday.response :raise_error unless raise_error
@@ -1,3 +1,3 @@
1
1
  module Diplomat
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hamelink
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-24 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler