elasticsearch 8.4.0 → 8.5.1

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: bf0248457756f0d1f0f54d9519082a68ef61167ef36bca2d97cf6023881c2247
4
- data.tar.gz: fe6b2bae3ace5e5909eb7d3beccd5ce9dd5bb448dcdff2ca425bce906966a0ab
3
+ metadata.gz: d59206ff2dab0663aec31ad0c64ef8dd7c2044d885299d201b41e187ecfa4245
4
+ data.tar.gz: 5d34b264085c2d0ba2dd57d85b60e1685fc2985bdf4fccb55ebd9dfece865067
5
5
  SHA512:
6
- metadata.gz: f50c8a33678f42d9a050462b37143c3dc7cc518a2d74bb6e31331ae2ef4255de4ed3dc12f5451ec411bca87f2a93503b8841f79899c15d3b6f966a2aed9bf0aa
7
- data.tar.gz: 3e7d964328006c792c9e4f71d859ee0ffd7b10f14f508c6fc693e51e9ddfaa4f166013b557d99410c160d60d3405b24732b15337e8fd464b3a0b7b8fa6051f50
6
+ metadata.gz: 40248c01429f3464b1582a27f5cfde5a701ddbc2aa15fd224610b681e5221f5e7a341129757e86470688fced7fe5e66d96406b0d30b1686b0b9396f209e3a763
7
+ data.tar.gz: e26757d22fccdbed3cf140c375760d85d585432a3f083c298d3371795c311f405fdd49aa181e4139027399b94c95e0c02faec5a2429933f53d4578b18b9fa546
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
46
46
  s.required_ruby_version = '>= 2.5'
47
47
 
48
48
  s.add_dependency 'elastic-transport', '~> 8'
49
- s.add_dependency 'elasticsearch-api', '8.4.0'
49
+ s.add_dependency 'elasticsearch-api', '8.5.1'
50
50
 
51
51
  s.add_development_dependency 'bundler'
52
52
  s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
@@ -16,5 +16,5 @@
16
16
  # under the License.
17
17
 
18
18
  module Elasticsearch
19
- VERSION = '8.4.0'.freeze
19
+ VERSION = '8.5.1'.freeze
20
20
  end
data/lib/elasticsearch.rb CHANGED
@@ -144,9 +144,8 @@ module Elasticsearch
144
144
  if (headers = arguments.dig(:transport_options, :headers))
145
145
  headers.merge!(authorization)
146
146
  else
147
- arguments[:transport_options] = {
148
- headers: authorization
149
- }
147
+ arguments[:transport_options] ||= {}
148
+ arguments[:transport_options].merge!({ headers: authorization })
150
149
  end
151
150
  end
152
151
 
@@ -57,7 +57,7 @@ describe Elasticsearch::Client do
57
57
  end
58
58
  end
59
59
 
60
- context 'when other headers where specified' do
60
+ context 'when other headers were specified' do
61
61
  let(:client) do
62
62
  described_class.new(
63
63
  api_key: 'elasticsearch_api_key',
@@ -72,6 +72,42 @@ describe Elasticsearch::Client do
72
72
  end
73
73
  end
74
74
 
75
+ context 'when sending transport_options but no headers were specified' do
76
+ let(:client) do
77
+ described_class.new(
78
+ api_key: 'elasticsearch_api_key',
79
+ transport_options: { ssl: { verify: false } }
80
+ )
81
+ end
82
+
83
+ it 'Adds the ApiKey header to the connection and keeps the options' do
84
+ header = client.transport.connections.first.connection.headers
85
+ expect(header['Authorization']).to eq('ApiKey elasticsearch_api_key')
86
+ expect(client.transport.options[:transport_options]).to include({ ssl: { verify: false } })
87
+ expect(client.transport.options[:transport_options][:headers]).to include('Authorization' => 'ApiKey elasticsearch_api_key')
88
+ end
89
+ end
90
+
91
+ context 'when other headers and options were specified' do
92
+ let(:client) do
93
+ described_class.new(
94
+ api_key: 'elasticsearch_api_key',
95
+ transport_options: {
96
+ headers: { 'x-test-header' => 'test' },
97
+ ssl: { verify: false }
98
+ }
99
+ )
100
+ end
101
+
102
+ it 'Adds the ApiKey header to the connection and keeps the header' do
103
+ header = client.transport.connections.first.connection.headers
104
+ expect(header['X-Test-Header']).to eq('test')
105
+ expect(header['Authorization']).to eq('ApiKey elasticsearch_api_key')
106
+ expect(client.transport.options[:transport_options]).to include({ ssl: { verify: false } })
107
+ expect(client.transport.options[:transport_options][:headers]).to include('Authorization' => 'ApiKey elasticsearch_api_key')
108
+ end
109
+ end
110
+
75
111
  context 'Metaheader' do
76
112
  let(:adapter_code) { "nh=#{defined?(Net::HTTP::VERSION) ? Net::HTTP::VERSION : Net::HTTP::HTTPVersion}" }
77
113
  let(:meta_header) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.4.0
4
+ version: 8.5.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: 2022-08-24 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elastic-transport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 8.4.0
33
+ version: 8.5.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 8.4.0
40
+ version: 8.5.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement