misty 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/misty/auth/token.rb +3 -2
- data/lib/misty/auth/token/v2.rb +4 -4
- data/lib/misty/auth/token/v3.rb +3 -3
- data/lib/misty/version.rb +1 -1
- data/test/unit/auth/token_test.rb +38 -39
- data/test/unit/cloud_test.rb +1 -1
- 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: ebb0138e4483e4547e364d1480868752341806a7
|
4
|
+
data.tar.gz: 19add58cab7f876d51311685c5e65a6f77a1df9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b67157bcb2a71b6c068e3b27c010e7d524f80d81bd3f394355e21210cd5f9b260e90aa0273a4fc84d96e1a238144db73d3165e8a73991e6ffcd0cbd25da12954
|
7
|
+
data.tar.gz: 7d49599fd1913126a95239e55058511fa70e33a261bbe6c9ace0ef4d1a2e873a9edce7c3bc1065211f334fe23883117b179f0a5cbc792c1f553b40c4cca910d8
|
data/README.md
CHANGED
@@ -212,11 +212,10 @@ defaults are applied if not specified.
|
|
212
212
|
* `:auth` - Authentication credentials hash containing 'auth_url' and user context. See `Misty::Auth`.
|
213
213
|
* `:content_type` - HTTP responses body format. :json or :hash structures. Default is `Misty::Config::CONTENT_TYPE` (`:hash`).
|
214
214
|
* `:headers` - Hash of extra HTTP headers to be applied to all services
|
215
|
-
* `:interface` - Endpoint interface, allowed values are: "public", "internal", "admin".
|
215
|
+
* `:interface` - Endpoint interface, allowed values are: "public", "internal", "admin". Default is `Misty::Config::INTERFACE` (`'public'`).
|
216
216
|
* `:log_file` - Log destination, Value is either file path (./misty.log) or IO object (SDOUT). Default is '/dev/null'
|
217
217
|
* `:log_level` - Value is Fixnum - Default is 1 (Logger::INFO) - See Logger from Ruby standard Library
|
218
218
|
* `:region` - Alternative Region name. Default is `Misty::Config::REGION` (`'regionOne'`)
|
219
|
-
Default is `Misty::Config::INTERFACE` (`'public'`)
|
220
219
|
* `:ssl_verify_mode` - Boolean flag for SSL client verification. Applies when URI scheme is SSL ("https://").
|
221
220
|
Default is `Misty::Config::SSL_VERIFY_MODE` (`true`)
|
222
221
|
See `Misty::Config` for more details
|
data/lib/misty/auth/token.rb
CHANGED
@@ -3,7 +3,7 @@ module Misty
|
|
3
3
|
module Auth
|
4
4
|
module Token
|
5
5
|
include Misty::HTTP::NetHTTP
|
6
|
-
attr_reader :catalog, :expires, :token, :user
|
6
|
+
attr_reader :catalog, :expires, :token, :user, :data
|
7
7
|
|
8
8
|
def self.build(auth)
|
9
9
|
if auth[:tenant_id] || auth[:tenant]
|
@@ -43,7 +43,8 @@ module Misty
|
|
43
43
|
Misty::HTTP::NetHTTP.http_request(
|
44
44
|
creds[:uri], ssl_verify_mode: creds[:ssl_verify_mode], log: @log
|
45
45
|
) do |connection|
|
46
|
-
|
46
|
+
connect_path = creds[:uri].path + path
|
47
|
+
response = connection.post(connect_path, creds[:data].to_json,
|
47
48
|
{ 'Content-Type' => 'application/json', 'Accept' => 'application/json' })
|
48
49
|
unless response.code =~ /200|201/
|
49
50
|
raise AuthenticationError, "Response code=#{response.code}, Msg=#{response.msg}"
|
data/lib/misty/auth/token/v2.rb
CHANGED
@@ -40,10 +40,10 @@ module Misty
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def set(response)
|
43
|
-
|
44
|
-
@token =
|
45
|
-
@expires =
|
46
|
-
catalog =
|
43
|
+
@data = JSON.load(response.body)
|
44
|
+
@token = @data['access']['token']['id']
|
45
|
+
@expires = @data['access']['token']['expires']
|
46
|
+
catalog = @data['access']['serviceCatalog']
|
47
47
|
@catalog = Misty::Auth::Catalog::V2.new(catalog)
|
48
48
|
end
|
49
49
|
|
data/lib/misty/auth/token/v3.rb
CHANGED
@@ -42,10 +42,10 @@ module Misty
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def set(response)
|
45
|
-
|
45
|
+
@data = JSON.load(response.body)
|
46
46
|
@token = response['x-subject-token']
|
47
|
-
@expires =
|
48
|
-
catalog =
|
47
|
+
@expires = @data['token']['expires_at']
|
48
|
+
catalog = @data['token']['catalog']
|
49
49
|
@catalog = Misty::Auth::Catalog::V3.new(catalog)
|
50
50
|
end
|
51
51
|
|
data/lib/misty/version.rb
CHANGED
@@ -5,7 +5,7 @@ describe Misty::Auth::Token do
|
|
5
5
|
describe 'V3' do
|
6
6
|
describe '#new' do
|
7
7
|
it 'fails when missing credentials' do
|
8
|
-
stub_request(:post, 'http://localhost
|
8
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
9
9
|
to_return(:status => 200, :body => "{\"token\":{\"catalog\":[]}}", :headers => {'x-subject-token'=>'token_data'})
|
10
10
|
proc do
|
11
11
|
token = Misty::Auth::Token.build({})
|
@@ -16,31 +16,30 @@ describe Misty::Auth::Token do
|
|
16
16
|
describe 'with a project scope' do
|
17
17
|
it 'authenticates using a project id' do
|
18
18
|
auth = {
|
19
|
-
:url => 'http://localhost
|
19
|
+
:url => 'http://localhost/identity',
|
20
20
|
:user_id => 'user_id',
|
21
21
|
:password => 'secret',
|
22
22
|
:project_id => 'project_id',
|
23
23
|
:ssl_verify_mode => false
|
24
24
|
}
|
25
25
|
|
26
|
-
stub_request(:post, 'http://localhost
|
26
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
27
27
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"id\":\"user_id\",\"password\":\"secret\"}}},\"scope\":{\"project\":{\"id\":\"project_id\"}}}}").
|
28
28
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data_v3'})
|
29
|
-
|
30
29
|
token = Misty::Auth::Token.build(auth)
|
31
30
|
token.get.must_equal 'token_data_v3'
|
32
31
|
end
|
33
32
|
|
34
33
|
it 'authenticates using a project name and a project domain id' do
|
35
34
|
auth = {
|
36
|
-
:url => 'http://localhost
|
35
|
+
:url => 'http://localhost/identity',
|
37
36
|
:user_id => 'user_id',
|
38
37
|
:password => 'secret',
|
39
38
|
:project => 'project',
|
40
39
|
:project_domain_id => 'project_domain_id'
|
41
40
|
}
|
42
41
|
|
43
|
-
stub_request(:post, 'http://localhost
|
42
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
44
43
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"id\":\"user_id\",\"password\":\"secret\"}}},\"scope\":{\"project\":{\"name\":\"project\",\"domain\":{\"id\":\"project_domain_id\"}}}}}").
|
45
44
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
46
45
|
token = Misty::Auth::Token.build(auth)
|
@@ -49,7 +48,7 @@ describe Misty::Auth::Token do
|
|
49
48
|
|
50
49
|
it 'authenticates using a project name and a project domain name' do
|
51
50
|
auth = {
|
52
|
-
:url => 'http://localhost
|
51
|
+
:url => 'http://localhost/identity',
|
53
52
|
:user => 'user',
|
54
53
|
:user_domain => 'user_domain',
|
55
54
|
:password => 'secret',
|
@@ -57,7 +56,7 @@ describe Misty::Auth::Token do
|
|
57
56
|
:project_domain => 'project_domain'
|
58
57
|
}
|
59
58
|
|
60
|
-
stub_request(:post, "http://localhost
|
59
|
+
stub_request(:post, "http://localhost/identity/v3/auth/tokens").
|
61
60
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"name\":\"user\",\"domain\":{\"name\":\"user_domain\"},\"password\":\"secret\"}}},\"scope\":{\"project\":{\"name\":\"project\",\"domain\":{\"name\":\"project_domain\"}}}}}").
|
62
61
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
63
62
|
|
@@ -69,13 +68,13 @@ describe Misty::Auth::Token do
|
|
69
68
|
describe 'with a domain scope' do
|
70
69
|
it 'authenticates using a domain id' do
|
71
70
|
auth = {
|
72
|
-
:url => 'http://localhost
|
71
|
+
:url => 'http://localhost/identity',
|
73
72
|
:user_id => 'user_id',
|
74
73
|
:password => 'secret',
|
75
74
|
:domain_id => 'domain_id'
|
76
75
|
}
|
77
76
|
|
78
|
-
stub_request(:post, 'http://localhost
|
77
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
79
78
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"id\":\"user_id\",\"password\":\"secret\"}}},\"scope\":{\"domain\":{\"id\":\"domain_id\"}}}}").
|
80
79
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
81
80
|
|
@@ -85,13 +84,13 @@ describe Misty::Auth::Token do
|
|
85
84
|
|
86
85
|
it 'authenticates using a domain name' do
|
87
86
|
auth = {
|
88
|
-
:url => 'http://localhost
|
87
|
+
:url => 'http://localhost/identity',
|
89
88
|
:user_id => 'user_id',
|
90
89
|
:password => 'secret',
|
91
90
|
:domain => 'domain'
|
92
91
|
}
|
93
92
|
|
94
|
-
stub_request(:post, 'http://localhost
|
93
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
95
94
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"id\":\"user_id\",\"password\":\"secret\"}}},\"scope\":{\"domain\":{\"name\":\"domain\"}}}}").
|
96
95
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
97
96
|
|
@@ -105,12 +104,12 @@ describe Misty::Auth::Token do
|
|
105
104
|
describe 'with a project scope' do
|
106
105
|
it 'authenticates using a project id' do
|
107
106
|
auth = {
|
108
|
-
:url => 'http://localhost
|
107
|
+
:url => 'http://localhost/identity',
|
109
108
|
:token => 'token',
|
110
109
|
:project_id => 'project_id'
|
111
110
|
}
|
112
111
|
|
113
|
-
stub_request(:post, 'http://localhost
|
112
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
114
113
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"token\"],\"token\":{\"id\":\"token\"}},\"scope\":{\"project\":{\"id\":\"project_id\"}}}}").
|
115
114
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
116
115
|
|
@@ -120,13 +119,13 @@ describe Misty::Auth::Token do
|
|
120
119
|
|
121
120
|
it 'authenticates using a project name and a project domain id' do
|
122
121
|
auth = {
|
123
|
-
:url => 'http://localhost
|
122
|
+
:url => 'http://localhost/identity',
|
124
123
|
:token => 'token',
|
125
124
|
:project => 'project',
|
126
125
|
:project_domain_id => 'domain_id'
|
127
126
|
}
|
128
127
|
|
129
|
-
stub_request(:post, 'http://localhost
|
128
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
130
129
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"token\"],\"token\":{\"id\":\"token\"}},\"scope\":{\"project\":{\"name\":\"project\",\"domain\":{\"id\":\"domain_id\"}}}}}").
|
131
130
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
132
131
|
|
@@ -138,12 +137,12 @@ describe Misty::Auth::Token do
|
|
138
137
|
describe 'with a domain scope' do
|
139
138
|
it 'authenticates using a domain id' do
|
140
139
|
auth = {
|
141
|
-
:url => 'http://localhost
|
140
|
+
:url => 'http://localhost/identity',
|
142
141
|
:token => 'token',
|
143
142
|
:domain_id => 'domain_id'
|
144
143
|
}
|
145
144
|
|
146
|
-
stub_request(:post, 'http://localhost
|
145
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
147
146
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"token\"],\"token\":{\"id\":\"token\"}},\"scope\":{\"domain\":{\"id\":\"domain_id\"}}}}").
|
148
147
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
149
148
|
|
@@ -153,12 +152,12 @@ describe Misty::Auth::Token do
|
|
153
152
|
|
154
153
|
it 'authenticates using a domain name' do
|
155
154
|
auth = {
|
156
|
-
:url => 'http://localhost
|
155
|
+
:url => 'http://localhost/identity',
|
157
156
|
:token => 'token',
|
158
157
|
:domain => 'domain'
|
159
158
|
}
|
160
159
|
|
161
|
-
stub_request(:post, 'http://localhost
|
160
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
162
161
|
with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"token\"],\"token\":{\"id\":\"token\"}},\"scope\":{\"domain\":{\"name\":\"domain\"}}}}").
|
163
162
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
164
163
|
|
@@ -172,7 +171,7 @@ describe Misty::Auth::Token do
|
|
172
171
|
describe 'when authenticated' do
|
173
172
|
let(:authv3_creds) do
|
174
173
|
{
|
175
|
-
:url => 'http://localhost
|
174
|
+
:url => 'http://localhost/identity',
|
176
175
|
:user => 'admin',
|
177
176
|
:password => 'secret',
|
178
177
|
:project => 'admin',
|
@@ -182,7 +181,7 @@ describe Misty::Auth::Token do
|
|
182
181
|
|
183
182
|
describe '#get' do
|
184
183
|
it 'when token has not expired' do
|
185
|
-
stub_request(:post, 'http://localhost
|
184
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
186
185
|
to_return(:status => 200, :body => "{\"token\":{\"catalog\":[\"catalog_data\"]}}", :headers => {'x-subject-token'=>'token_data'})
|
187
186
|
|
188
187
|
token = Misty::Auth::Token.build(authv3_creds)
|
@@ -192,7 +191,7 @@ describe Misty::Auth::Token do
|
|
192
191
|
end
|
193
192
|
|
194
193
|
it 'when token has expired' do
|
195
|
-
stub_request(:post, 'http://localhost
|
194
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
196
195
|
to_return(:status => 200, :body => "{\"token\":{\"catalog\":[\"catalog_data\"]}}", :headers => {'x-subject-token'=>'token_data'})
|
197
196
|
|
198
197
|
token = Misty::Auth::Token.build(authv3_creds)
|
@@ -203,7 +202,7 @@ describe Misty::Auth::Token do
|
|
203
202
|
end
|
204
203
|
|
205
204
|
it '#catalog' do
|
206
|
-
stub_request(:post, 'http://localhost
|
205
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
207
206
|
to_return(:status => 200, :body => "{\"token\":{\"catalog\":[\"catalog_data\"]}}", :headers => {'x-subject-token'=>'token_data'})
|
208
207
|
|
209
208
|
token = Misty::Auth::Token.build(authv3_creds)
|
@@ -211,7 +210,7 @@ describe Misty::Auth::Token do
|
|
211
210
|
end
|
212
211
|
|
213
212
|
it '#get_endpoint_url' do
|
214
|
-
stub_request(:post, 'http://localhost
|
213
|
+
stub_request(:post, 'http://localhost/identity/v3/auth/tokens').
|
215
214
|
to_return(:status => 200, :body => JSON.dump(auth_response_v3("identity", "keystone")), :headers => {'x-subject-token'=>'token_data'})
|
216
215
|
|
217
216
|
token = Misty::Auth::Token.build(authv3_creds)
|
@@ -223,7 +222,7 @@ describe Misty::Auth::Token do
|
|
223
222
|
describe 'V2' do
|
224
223
|
describe '#new' do
|
225
224
|
it 'fails when missing credentials' do
|
226
|
-
stub_request(:post, 'http://localhost
|
225
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
227
226
|
to_return(:status => 200, :body => "{\"access\":{\"token\":{\"id\":\"token_data\"}}}", :headers => {})
|
228
227
|
|
229
228
|
proc do
|
@@ -234,13 +233,13 @@ describe Misty::Auth::Token do
|
|
234
233
|
describe 'using the password method' do
|
235
234
|
it 'authenticates using the tenant name' do
|
236
235
|
auth = {
|
237
|
-
:url => 'http://localhost
|
236
|
+
:url => 'http://localhost/identity',
|
238
237
|
:user => 'user',
|
239
238
|
:password => 'secret',
|
240
239
|
:tenant => 'tenant',
|
241
240
|
}
|
242
241
|
|
243
|
-
stub_request(:post, 'http://localhost
|
242
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
244
243
|
with(:body => "{\"auth\":{\"passwordCredentials\":{\"username\":\"user\",\"password\":\"secret\"},\"tenantName\":\"tenant\"}}").
|
245
244
|
to_return(:status => 200, :body => JSON.dump(auth_response_v2('identity', 'keystone')), :headers => {})
|
246
245
|
|
@@ -250,13 +249,13 @@ describe Misty::Auth::Token do
|
|
250
249
|
|
251
250
|
it 'authenticates using the tenant id' do
|
252
251
|
auth = {
|
253
|
-
:url => 'http://localhost
|
252
|
+
:url => 'http://localhost/identity',
|
254
253
|
:user => 'user',
|
255
254
|
:password => 'secret',
|
256
255
|
:tenant_id => 'tenant_id',
|
257
256
|
}
|
258
257
|
|
259
|
-
stub_request(:post, 'http://localhost
|
258
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
260
259
|
with(:body => "{\"auth\":{\"passwordCredentials\":{\"username\":\"user\",\"password\":\"secret\"},\"tenantId\":\"tenant_id\"}}").
|
261
260
|
to_return(:status => 200, :body => JSON.dump(auth_response_v2('identity', 'keystone')), :headers => {})
|
262
261
|
|
@@ -268,12 +267,12 @@ describe Misty::Auth::Token do
|
|
268
267
|
describe 'using the token method' do
|
269
268
|
it 'authenticates using the tenant name' do
|
270
269
|
auth = {
|
271
|
-
:url => 'http://localhost
|
270
|
+
:url => 'http://localhost/identity',
|
272
271
|
:token => 'token_id',
|
273
272
|
:tenant => 'tenant',
|
274
273
|
}
|
275
274
|
|
276
|
-
stub_request(:post, 'http://localhost
|
275
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
277
276
|
with(:body => "{\"auth\":{\"token\":{\"id\":\"token_id\"},\"tenantName\":\"tenant\"}}").
|
278
277
|
to_return(:status => 200, :body => JSON.dump(auth_response_v2('identity', 'keystone')), :headers => {})
|
279
278
|
|
@@ -283,12 +282,12 @@ describe Misty::Auth::Token do
|
|
283
282
|
|
284
283
|
it 'authenticates using the tenant id' do
|
285
284
|
auth = {
|
286
|
-
:url => 'http://localhost
|
285
|
+
:url => 'http://localhost/identity',
|
287
286
|
:token => 'token_id',
|
288
287
|
:tenant_id => 'tenant_id',
|
289
288
|
}
|
290
289
|
|
291
|
-
stub_request(:post, 'http://localhost
|
290
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
292
291
|
with(:body => "{\"auth\":{\"token\":{\"id\":\"token_id\"},\"tenantId\":\"tenant_id\"}}").
|
293
292
|
to_return(:status => 200, :body => JSON.dump(auth_response_v2('identity', 'keystone')), :headers => {})
|
294
293
|
|
@@ -300,7 +299,7 @@ describe Misty::Auth::Token do
|
|
300
299
|
describe 'when authenticated' do
|
301
300
|
let(:authv2_creds) do
|
302
301
|
{
|
303
|
-
:url => 'http://localhost
|
302
|
+
:url => 'http://localhost/identity',
|
304
303
|
:user => 'admin',
|
305
304
|
:password => 'secret',
|
306
305
|
:tenant => 'admin'
|
@@ -309,7 +308,7 @@ describe Misty::Auth::Token do
|
|
309
308
|
|
310
309
|
describe '#get' do
|
311
310
|
it 'when token has not expired' do
|
312
|
-
stub_request(:post, 'http://localhost
|
311
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
313
312
|
to_return(:status => 200, :body => "{\"access\":{\"token\":{\"id\":\"token_not_expired\"},\"serviceCatalog\":[\"catalog_data\"]}}", :headers => {})
|
314
313
|
|
315
314
|
token = Misty::Auth::Token.build(authv2_creds)
|
@@ -319,7 +318,7 @@ describe Misty::Auth::Token do
|
|
319
318
|
end
|
320
319
|
|
321
320
|
it 'when token has expired' do
|
322
|
-
stub_request(:post, 'http://localhost
|
321
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
323
322
|
to_return(:status => 200, :body => "{\"access\":{\"token\":{\"id\":\"token_expired\"},\"serviceCatalog\":[\"catalog_data\"]}}", :headers => {})
|
324
323
|
|
325
324
|
token = Misty::Auth::Token.build(authv2_creds)
|
@@ -330,7 +329,7 @@ describe Misty::Auth::Token do
|
|
330
329
|
end
|
331
330
|
|
332
331
|
it '#catalog' do
|
333
|
-
stub_request(:post, 'http://localhost
|
332
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
334
333
|
to_return(:status => 200, :body => "{\"access\":{\"token\":{\"id\":\"token_data\"},\"serviceCatalog\":[\"catalog_data\"]}}", :headers => {})
|
335
334
|
|
336
335
|
token = Misty::Auth::Token.build(authv2_creds)
|
@@ -338,7 +337,7 @@ describe Misty::Auth::Token do
|
|
338
337
|
end
|
339
338
|
|
340
339
|
it '#get_endpoint_url' do
|
341
|
-
stub_request(:post, 'http://localhost
|
340
|
+
stub_request(:post, 'http://localhost/identity/v2.0/tokens').
|
342
341
|
to_return(:status => 200, :body => JSON.dump(auth_response_v2('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
|
343
342
|
|
344
343
|
token = Misty::Auth::Token.build(authv2_creds)
|
data/test/unit/cloud_test.rb
CHANGED
@@ -119,7 +119,7 @@ describe Misty::Cloud do
|
|
119
119
|
it 'uses Misty::Auth::Token::V3' do
|
120
120
|
authv2 = Minitest::Mock.new
|
121
121
|
|
122
|
-
|
122
|
+
Misty::Auth::Token::V2.stub :new, authv2 do
|
123
123
|
cloud = Misty::Cloud.new(:auth => authv2_data)
|
124
124
|
assert_mock authv2
|
125
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: misty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilles Dubreuil
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|