diplomat 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/diplomat/configuration.rb +4 -2
- data/lib/diplomat/rest_client.rb +1 -1
- data/lib/diplomat/version.rb +1 -1
- 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: 2dd54168c7c65cea06154d8f9e4ba3e69bab7c04
|
4
|
+
data.tar.gz: 42f4033666bbe21e3ee2e47008d544be6dd573d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
- [
|
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
|
-
|
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
|
data/lib/diplomat/rest_client.rb
CHANGED
@@ -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(
|
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
|
data/lib/diplomat/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|