pact-support 1.8.1 → 1.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2184e9575553c8a69f05b2a7665f5c70948b06a8
|
4
|
+
data.tar.gz: 896248de0a0c7c6d19d4ae7dfec15587929db2a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890f78b04b7778391c0c2c7536c1ec153e080a48c4724f01be27ed77373e2fd472b8aed151e7420b4ccf9b4d453a6bb1907c1525c4295f8464eacccb1939684f
|
7
|
+
data.tar.gz: 43688a515f9719b74666fb584fa9b80ed1b0d4951d64a0b75964710373bbd089bced0962201dfc627288e9e26d761d58628fedb9fa8dd3b15bc77914c48450d1
|
data/CHANGELOG.md
CHANGED
@@ -78,6 +78,7 @@ module Pact
|
|
78
78
|
def get_remote(uri, options)
|
79
79
|
request = Net::HTTP::Get.new(uri)
|
80
80
|
request.basic_auth(options[:username], options[:password]) if options[:username]
|
81
|
+
request['Authorization'] = "Bearer #{options[:token]}" if options[:token]
|
81
82
|
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
82
83
|
http.open_timeout = options[:open_timeout] || OPEN_TIMEOUT
|
83
84
|
http.read_timeout = options[:read_timeout] || READ_TIMEOUT
|
data/lib/pact/support/version.rb
CHANGED
@@ -75,6 +75,21 @@ module Pact
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
context 'with a token' do
|
79
|
+
let(:token) { 'askfjlksjf'}
|
80
|
+
let(:options) { { token: token } }
|
81
|
+
|
82
|
+
let!(:request) do
|
83
|
+
stub_request(:get, uri_without_userinfo).with(headers: {'Authorization' => 'Bearer askfjlksjf'}).to_return(body: pact_content)
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'sets the Bearer Authorization header' do
|
87
|
+
PactFile.render_pact(uri_without_userinfo, options)
|
88
|
+
expect(request).to have_been_made
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
78
93
|
describe 'retry feature' do
|
79
94
|
before { allow(PactFile).to receive(:delay_retry).with(kind_of(Integer)) }
|
80
95
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Fraser
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|