couchrest 2.0.0.beta1 → 2.0.0.beta2
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/VERSION +1 -1
- data/lib/couchrest/connection.rb +5 -0
- data/spec/couchrest/connection_spec.rb +13 -0
- 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: 56c6ad538f2b4fce792fe1e86f397af9c9fd02e1
|
4
|
+
data.tar.gz: 5fc268898ee98554d7810dc0ce1bae37ee9953aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04bacd2673fa3782fc91218dff8e54fd777b086a1aea409210b16756c0fd4904a045fc792f10101568df92f243bea717ead2719671ae3f1de9991d374718a11
|
7
|
+
data.tar.gz: 52fc7bb62a48eaff3f848eea5b13fe8c9d79be1a68c74603e55d24d3c7972354c8a9d390f2544eeb02576f622047386b9d96127779fdb662e2180b2a77fac447
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.
|
1
|
+
2.0.0.beta2
|
data/lib/couchrest/connection.rb
CHANGED
@@ -110,6 +110,11 @@ module CouchRest
|
|
110
110
|
def prepare_http_connection(opts)
|
111
111
|
@http = HTTPClient.new(opts[:proxy] || self.class.proxy)
|
112
112
|
|
113
|
+
# Authentication
|
114
|
+
unless uri.user.to_s.empty?
|
115
|
+
http.set_auth(uri.to_s, uri.user, uri.password)
|
116
|
+
end
|
117
|
+
|
113
118
|
# SSL Certificate option mapping
|
114
119
|
if opts.include?(:verify_ssl)
|
115
120
|
http.ssl_config.verify_mode = opts[:verify_ssl] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
@@ -37,6 +37,7 @@ describe CouchRest::Connection do
|
|
37
37
|
it "should have instantiated an HTTP connection" do
|
38
38
|
conn = CouchRest::Connection.new(URI "http://localhost:5984")
|
39
39
|
expect(conn.http).to be_a(HTTPClient)
|
40
|
+
expect(conn.http.www_auth.basic_auth.set?).to be_false
|
40
41
|
end
|
41
42
|
|
42
43
|
it "should use the proxy if defined in parameters" do
|
@@ -58,6 +59,11 @@ describe CouchRest::Connection do
|
|
58
59
|
expect(conn.http.proxy.to_s).to eql('http://proxy2')
|
59
60
|
CouchRest::Connection.proxy = nil
|
60
61
|
end
|
62
|
+
|
63
|
+
it "should pass through authentication details" do
|
64
|
+
conn = CouchRest::Connection.new(URI "http://user:pass@mock")
|
65
|
+
expect(conn.http.www_auth.basic_auth.set?).to be_true
|
66
|
+
end
|
61
67
|
|
62
68
|
describe "with SSL options" do
|
63
69
|
it "should leave the default if nothing set" do
|
@@ -196,6 +202,13 @@ describe CouchRest::Connection do
|
|
196
202
|
mock_conn.get("db/test", :quirks_mode => true)
|
197
203
|
end
|
198
204
|
|
205
|
+
it "should forward user and password details" do
|
206
|
+
stub_request(:get, "http://user:pass@mock/db/test")
|
207
|
+
.to_return(:body => doc.to_json)
|
208
|
+
conn = CouchRest::Connection.new(URI "http://user:pass@mock")
|
209
|
+
conn.get("db/test")
|
210
|
+
end
|
211
|
+
|
199
212
|
context 'when decode_json_objects is true' do
|
200
213
|
class TestObject
|
201
214
|
def self.json_create(args)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J. Chris Anderson
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-07-
|
15
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: httpclient
|