stacker_bee 2.0.0.pre170 → 2.0.0.pre178
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 +8 -8
- data/lib/stacker_bee/connection.rb +6 -3
- data/spec/units/stacker_bee/connection_spec.rb +18 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjhmNmYwOWEwNDE5NmViNTkxMTZiZTIxNmQwNjA0NmFlMjUzOTk4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2IyNGIxYWI1ZTM1ODYwYTNkODM3MTlmMGYyZDZhNGNhYWQwYmU2OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yzc3ZDZhNDIzNjcyNTdiYTFhNjcxMTE4NTRhZjRmNzk3ZmZiZDYzY2UyZTBm
|
10
|
+
MzVjMWY1YjRlNWJkNTQ1MWE3ZjEyNTcxMWM5YjdmMTNkODg2YTNhMzUzYTUx
|
11
|
+
ZDk5NWY4MjU3ZGRiN2ZkNDNhZGM3MzJlYjliOTk4YjAwMjE0MDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWQ5YzMwNmI1ODA0ZjAyZmIzM2M0N2E1MzE3MGFmMjJkOGUxMmU0MDFiNThi
|
14
|
+
YjAxMDJlM2Q0OGU2NzNkZjE5MTViY2ZjOTgyNWZiM2ZiNWIwZWMyMDExZTlh
|
15
|
+
MTZmMDBkYjFmZWQ1ODZjZWVmMmYwYjQ1N2M5Y2JiMGI4NzM4Y2E=
|
@@ -14,12 +14,15 @@ module StackerBee
|
|
14
14
|
@configuration = configuration
|
15
15
|
uri = URI.parse(self.configuration.url)
|
16
16
|
uri.path = ''
|
17
|
+
ssl_verify = !self.configuration.ssl_verify.nil? ?
|
18
|
+
self.configuration.ssl_verify : true
|
17
19
|
fail ConnectionError, "no protocol specified" unless uri.scheme
|
18
|
-
initialize_faraday(uri
|
20
|
+
initialize_faraday(url: uri.to_s,
|
21
|
+
ssl: { verify: ssl_verify })
|
19
22
|
end
|
20
23
|
|
21
|
-
def initialize_faraday(
|
22
|
-
@faraday = Faraday.new(
|
24
|
+
def initialize_faraday(options)
|
25
|
+
@faraday = Faraday.new(options) do |faraday|
|
23
26
|
faraday.use Middleware::Detokenizer
|
24
27
|
faraday.use Middleware::SignedQuery, configuration.secret_key
|
25
28
|
configuration.middlewares.call faraday
|
@@ -4,13 +4,17 @@ describe StackerBee::Connection do
|
|
4
4
|
let(:url) { "http://test.com:1234/foo/bar/" }
|
5
5
|
let(:path) { "/foo/bar" }
|
6
6
|
let(:secret_key) { "shhh" }
|
7
|
-
let(:configuration) { double url: url, secret_key: secret_key }
|
8
7
|
let(:query_params) { [[:foo, :bar]] }
|
9
8
|
let(:request) { double query_params: query_params }
|
10
9
|
let(:response) { double }
|
11
10
|
let(:faraday) { double get: response }
|
12
11
|
let(:connection) { StackerBee::Connection.new configuration }
|
12
|
+
let(:configuration) do
|
13
|
+
double url: url, secret_key: secret_key, ssl_verify: nil
|
14
|
+
end
|
15
|
+
|
13
16
|
subject(:get) { connection.get request, path }
|
17
|
+
|
14
18
|
before do
|
15
19
|
Faraday.stub(:new) { faraday }
|
16
20
|
end
|
@@ -22,7 +26,8 @@ describe StackerBee::Connection do
|
|
22
26
|
it { should be response }
|
23
27
|
it "specifies url without path when creating connection" do
|
24
28
|
get
|
25
|
-
Faraday.should have_received(:new).with(url: "http://test.com:1234"
|
29
|
+
Faraday.should have_received(:new).with(url: "http://test.com:1234",
|
30
|
+
ssl: { verify: true })
|
26
31
|
end
|
27
32
|
end
|
28
33
|
|
@@ -51,4 +56,15 @@ describe StackerBee::Connection do
|
|
51
56
|
connection.get request, path
|
52
57
|
end
|
53
58
|
end
|
59
|
+
|
60
|
+
context "when verifying an ssl connection" do
|
61
|
+
let(:configuration) do
|
62
|
+
double url: url, secret_key: secret_key, ssl_verify: false
|
63
|
+
end
|
64
|
+
it "specifies the ssl verify option when creating a connection" do
|
65
|
+
get
|
66
|
+
Faraday.should have_received(:new).with(url: "http://test.com:1234",
|
67
|
+
ssl: { verify: false })
|
68
|
+
end
|
69
|
+
end
|
54
70
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stacker_bee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.pre178
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Sterndale
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|