vsphere-automation-runtime 0.4.4 → 0.4.5.pre
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/vsphere-automation-runtime/api_client.rb +4 -3
- data/lib/vsphere-automation-runtime/version.rb +1 -1
- data/spec/api_client_spec.rb +3 -4
- metadata +4 -7
- data/pkg/vsphere-automation-runtime-0.4.1.gem +0 -0
- data/pkg/vsphere-automation-runtime-0.4.2.gem +0 -0
- data/pkg/vsphere-automation-runtime-0.4.3.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a11e85b56ea9367f1fa7a60144037605ab7cb9894573593bbcd2fa71dc8745f7
|
4
|
+
data.tar.gz: ce6701b15e3ebf88db6d09ce07a0ff0ad55f3c7e1fe9a1a23f8000340981e42a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6275b427a717b8d773e90b1bbc0c1bd69a5dc8e3b8e2e2162359d19c0ee9c71908ecc595ec5245c9bfbd1a8c13b082ba53c745d3bcd0bdac463d1b0a8b7c4909
|
7
|
+
data.tar.gz: 98406220e9154dd4b9f4da28d35499736e845ec219235af74cd114cded237cd9350b8fc8309cb4b4bb86a5b5734fe66dec9e15f0add56b810fd3252d294ed299
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -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(
|
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(
|
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
|
-
|
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
|
data/spec/api_client_spec.rb
CHANGED
@@ -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')
|
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
|
-
|
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
|
+
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-
|
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:
|
177
|
+
version: 1.3.1
|
181
178
|
requirements: []
|
182
179
|
rubygems_version: 3.0.3
|
183
180
|
signing_key:
|
Binary file
|
Binary file
|
Binary file
|