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: 20803ab69ce7de1114071b9920664f7f48824c66
4
- data.tar.gz: 290ea395354b4122de84a607f684919b99a91ff0
3
+ metadata.gz: 2184e9575553c8a69f05b2a7665f5c70948b06a8
4
+ data.tar.gz: 896248de0a0c7c6d19d4ae7dfec15587929db2a8
5
5
  SHA512:
6
- metadata.gz: 908d1db1d4356dbe878d2373c7092c1ed007482a490a199c5fb7045d02dcc57775e1378627714e1e7e07310e3419551194af9816eb291080ea778362b978e89a
7
- data.tar.gz: 5dab25c5ec872af637559ea7ac255b9614c4b630963bf0ac9698a089d0771cdf19f5c164c351944835f8c4fa759cb4335064af5737f8733d660c3b2cb2266a50
6
+ metadata.gz: 890f78b04b7778391c0c2c7536c1ec153e080a48c4724f01be27ed77373e2fd472b8aed151e7420b4ccf9b4d453a6bb1907c1525c4295f8464eacccb1939684f
7
+ data.tar.gz: 43688a515f9719b74666fb584fa9b80ed1b0d4951d64a0b75964710373bbd089bced0962201dfc627288e9e26d761d58628fedb9fa8dd3b15bc77914c48450d1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ <a name="v1.9.0"></a>
2
+ ### v1.9.0 (2019-02-22)
3
+
4
+
5
+ #### Features
6
+
7
+ * allow bearer token to be used to retrieve a pact ([ab997c5](/../../commit/ab997c5))
8
+
9
+
1
10
  <a name="v1.8.1"></a>
2
11
  ### v1.8.1 (2018-11-15)
3
12
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.8.1"
3
+ VERSION = "1.9.0"
4
4
  end
5
5
  end
@@ -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.8.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: 2018-11-15 00:00:00.000000000 Z
15
+ date: 2019-02-21 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: randexp