elasticsearch-transport 7.2.0 → 7.2.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be545facbcd8066275038d52de9360f5f8151d67f682b6482b31789cb08bbf7d
|
4
|
+
data.tar.gz: 04aa294d2c80a8336c0dcae3492124095cecc804488fae9d15889e619d021102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08f16ae0533f7ce03cf2d87cff3765db8a31ce277ea0ffc89a6380e3cd6be075acb3d6ee99eab1091a960d838988403d3d93ba8bacc49a41b41207ff7ba3abb
|
7
|
+
data.tar.gz: de38a4e292eb7976fdfdca5a02b6624d8725a5f75e1500ffa6ee34034be9c0f2c487691c4fec738730c99155e3bc17fc145d77c3835902a9c16c4c612c895574
|
@@ -169,7 +169,8 @@ module Elasticsearch
|
|
169
169
|
|
170
170
|
def extract_cloud_creds(arguments)
|
171
171
|
return unless arguments[:cloud_id]
|
172
|
-
|
172
|
+
name = arguments[:cloud_id].split(':')[0]
|
173
|
+
cloud_url, elasticsearch_instance = Base64.decode64(arguments[:cloud_id].gsub("#{name}:", '')).split('$')
|
173
174
|
[ { scheme: 'https',
|
174
175
|
user: arguments[:user],
|
175
176
|
password: arguments[:password],
|
@@ -310,6 +310,30 @@ describe Elasticsearch::Transport::Client do
|
|
310
310
|
expect(client.transport.__full_url(client.transport.hosts[0])).to eq('https://elastic:changeme@abcd.localhost:9200')
|
311
311
|
end
|
312
312
|
end
|
313
|
+
|
314
|
+
context 'when the cluster has alternate names' do
|
315
|
+
|
316
|
+
let(:client) do
|
317
|
+
described_class.new(cloud_id: 'myCluster:bG9jYWxob3N0JGFiY2QkZWZnaA==', user: 'elasticfantastic', password: 'tobechanged')
|
318
|
+
end
|
319
|
+
|
320
|
+
let(:hosts) do
|
321
|
+
client.transport.hosts
|
322
|
+
end
|
323
|
+
|
324
|
+
it 'extracts the cloud credentials' do
|
325
|
+
expect(hosts[0][:host]).to eq('abcd.localhost')
|
326
|
+
expect(hosts[0][:protocol]).to eq('https')
|
327
|
+
expect(hosts[0][:user]).to eq('elasticfantastic')
|
328
|
+
expect(hosts[0][:password]).to eq('tobechanged')
|
329
|
+
expect(hosts[0][:port]).to eq(9243)
|
330
|
+
end
|
331
|
+
|
332
|
+
it 'creates the correct full url' do
|
333
|
+
expect(client.transport.__full_url(client.transport.hosts[0])).to eq('https://elasticfantastic:tobechanged@abcd.localhost:9243')
|
334
|
+
end
|
335
|
+
|
336
|
+
end
|
313
337
|
end
|
314
338
|
|
315
339
|
shared_examples_for 'a client that extracts hosts' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.2.
|
4
|
+
version: 7.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|