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: 47a8f6e85b60bdec378a1c8011aa76c24ab1a08f618a2f2fb38850f3b6114190
4
- data.tar.gz: 25e88a3e742a0e4341ba685296425d13ddb8ed7059ef97a39174e394bec40535
3
+ metadata.gz: be545facbcd8066275038d52de9360f5f8151d67f682b6482b31789cb08bbf7d
4
+ data.tar.gz: 04aa294d2c80a8336c0dcae3492124095cecc804488fae9d15889e619d021102
5
5
  SHA512:
6
- metadata.gz: 90a600694fa1172722d988da7cf09daca12160054b13c1b6a8093303529f62fcd76eb8c4367c0f936fb9d96fdc0533e849ed7c426b04f40069cf009895c06da4
7
- data.tar.gz: 6f18333cf05353ed2292c7edf21cc320aa8482f72e07bfab104e7ca8b5d0d9d697f26b2562da8455852dd67afe3e1a197edf70133527287574441e85da08b566
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
- cloud_url, elasticsearch_instance = Base64.decode64(arguments[:cloud_id].gsub('name:', '')).split('$')
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],
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elasticsearch
19
19
  module Transport
20
- VERSION = "7.2.0"
20
+ VERSION = "7.2.1"
21
21
  end
22
22
  end
@@ -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.0
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-06-26 00:00:00.000000000 Z
11
+ date: 2019-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json