vsphere-automation-runtime 0.4.4 → 0.4.5.pre

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
  SHA256:
3
- metadata.gz: f8648ffa1c05b3725ad75630c04135d295d4b7cb5297b30143d3ba8bdd09ca36
4
- data.tar.gz: 2f5d4b1511549f5175e15ea87717df9543d407c1d33d296d2a3b9158994414e7
3
+ metadata.gz: a11e85b56ea9367f1fa7a60144037605ab7cb9894573593bbcd2fa71dc8745f7
4
+ data.tar.gz: ce6701b15e3ebf88db6d09ce07a0ff0ad55f3c7e1fe9a1a23f8000340981e42a
5
5
  SHA512:
6
- metadata.gz: 01eb7380314cd7dc4d2efb5992203dd8f6295d136a38d08a8f3c558932b67aeacc3e7400525a439f4787ebc3d3cb9c22da7940cdb1f31ef9f90b63b934c149b0
7
- data.tar.gz: 210545975a6ec7e1ecafb0510ee5a00d5e155a8a7c3984998f62c44d9bcba55ceb0d1531bc5a3dada40e2d1433d00a44ac37bbafb92b7b9256c656f8c0096dde
6
+ metadata.gz: 6275b427a717b8d773e90b1bbc0c1bd69a5dc8e3b8e2e2162359d19c0ee9c71908ecc595ec5245c9bfbd1a8c13b082ba53c745d3bcd0bdac463d1b0a8b7c4909
7
+ data.tar.gz: 98406220e9154dd4b9f4da28d35499736e845ec219235af74cd114cded237cd9350b8fc8309cb4b4bb86a5b5734fe66dec9e15f0add56b810fd3252d294ed299
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vsphere-automation-runtime (0.4.4)
4
+ vsphere-automation-runtime (0.4.5.pre)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The Ruby gem for the vSphere Runtime API
4
4
 
5
5
  - API version: 2.0.0
6
- - Package version: 0.4.4
6
+ - Package version: 0.4.5.pre
7
7
 
8
8
  ## Installation
9
9
 
@@ -117,7 +117,7 @@ module VSphereAutomation
117
117
  case settings[:in]
118
118
  when 'header'
119
119
  header_params[settings[:key]] = settings[:value]
120
- api_key_from_cookie(header_params, settings) unless settings[:value]
120
+ api_key_from_cookie(settings) unless settings[:value]
121
121
  when 'query'
122
122
  query_params[settings[:key]] = settings[:value]
123
123
  end
@@ -240,12 +240,13 @@ module VSphereAutomation
240
240
  @config.api_key[key] = response[key] if response[key]
241
241
  end
242
242
 
243
- def api_key_from_cookie(headers, auth)
243
+ def api_key_from_cookie(auth)
244
244
  return if @cookie.nil?
245
245
 
246
246
  regex = /(?<key>#{auth[:key]})=(?<value>\w+)/
247
247
  matches = Hash(@cookie)['Cookie'].match(regex)
248
- headers[matches[:key]] = matches[:value] if matches
248
+ key = @config.auth_settings['api_key'][:key]
249
+ @config.api_key[key] = matches[:value] if matches
249
250
  end
250
251
 
251
252
  # An instance of the object in it's default state
@@ -8,6 +8,6 @@
8
8
 
9
9
  module VSphereAutomation
10
10
  module Runtime
11
- VERSION = '0.4.4'
11
+ VERSION = '0.4.5.pre'
12
12
  end
13
13
  end
@@ -102,16 +102,15 @@ describe VSphereAutomation::ApiClient do
102
102
  value = 'foo'
103
103
  cookie = "#{key}=#{value};Path=/rest;Secure;HttpOnly"
104
104
  set_cookie_header = { 'set-cookie' => cookie }
105
- auth_header = { key => value }
106
105
  stub_request(:get, url + '1').to_return(headers: set_cookie_header)
107
- stub_request(:get, url + '2').with(headers: auth_header)
106
+ stub_request(:get, url + '2')
108
107
 
109
108
  subject.call_api(:GET, '/test1')
110
109
  subject.call_api(:GET, '/test2', auth_names: ['api_key'])
111
110
 
112
111
  expect(a_request(:get, url + '1')).to have_been_made
113
- expect(a_request(:get, url + '2')
114
- .with(headers: auth_header)).to have_been_made
112
+ expect(a_request(:get, url + '2')).to have_been_made
113
+ expect(subject.config.api_key[key]).to eq(value)
115
114
  end
116
115
 
117
116
  it 'updates api_key from responses with api_key header' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vsphere-automation-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-04 00:00:00.000000000 Z
11
+ date: 2019-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -153,9 +153,6 @@ files:
153
153
  - lib/vsphere-automation-runtime/api_error.rb
154
154
  - lib/vsphere-automation-runtime/configuration.rb
155
155
  - lib/vsphere-automation-runtime/version.rb
156
- - pkg/vsphere-automation-runtime-0.4.1.gem
157
- - pkg/vsphere-automation-runtime-0.4.2.gem
158
- - pkg/vsphere-automation-runtime-0.4.3.gem
159
156
  - spec/api_client_spec.rb
160
157
  - spec/configuration_spec.rb
161
158
  - spec/spec_helper.rb
@@ -175,9 +172,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
175
172
  version: '2.3'
176
173
  required_rubygems_version: !ruby/object:Gem::Requirement
177
174
  requirements:
178
- - - ">="
175
+ - - ">"
179
176
  - !ruby/object:Gem::Version
180
- version: '0'
177
+ version: 1.3.1
181
178
  requirements: []
182
179
  rubygems_version: 3.0.3
183
180
  signing_key: