elastic-transport 8.2.1 → 8.2.2

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: 97ae80fff7c8f2354bcb14259c86df214ffe8e95cd3027c7716a3e04b51e0e84
4
- data.tar.gz: c8f303cbe8d6f12136ff6f19ac5975cc0ea9bbe9dc18c3602f72121b8b0bb99f
3
+ metadata.gz: 2ed8622f822c6b3d845e86e457a6391c1fac329c61e4d2e72fa6fd4a96eed269
4
+ data.tar.gz: 94866083c749a687fa5f5f8f25c076cc4823abc2e0afa318fd05cec6afb6de0b
5
5
  SHA512:
6
- metadata.gz: 62af9d690c084cd40dae188cb5f959a7acd0d67fbf62a7b27abe0e57d3cb0b78644ea36dc04c5f2597f980de113850a0757860d81519759f2a8b965894c0e90c
7
- data.tar.gz: 59c4cafc61dfb858639934876eb004037c2e31e86a61d3863ed65083fa1d5f0bc2bb15833123c2a5d7d6c7434e9ca74b8fd6721800822141d7ec3af98169a7c6
6
+ metadata.gz: cd88c9f775083a059f924ab8f4668d4f01fdff475dfa904743533aec4f48d7fbb4b2bbdad596fd295c43e7cbb5195ba4bec3e4daa9bcb6a1b33fd4d60bbfd324
7
+ data.tar.gz: 3c01c3ad96f481054441fe406c1680cd4c147ccb2bdedc1d46c5ad7adbdfa08fa37dda52647b4b025dc48cde54d21312eb026dfe656fdea893008f8eb85b146e
@@ -15,8 +15,8 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby: [ '2.7', '3.0', '3.1', '3.2', 'jruby-9.3', 'jruby-9.4' ]
19
- es_version: ['8.4-SNAPSHOT', '8.5-SNAPSHOT', '8.6-SNAPSHOT']
18
+ ruby: [ '3.0', '3.1', '3.2', 'jruby-9.3', 'jruby-9.4' ]
19
+ es_version: ['8.7-SNAPSHOT', '8.8-SNAPSHOT', '8.9-SNAPSHOT']
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
22
  - uses: actions/checkout@v2
@@ -53,8 +53,8 @@ jobs:
53
53
  strategy:
54
54
  fail-fast: false
55
55
  matrix:
56
- ruby: [ '2.7', '3.0', '3.1', '3.2', 'jruby-9.3' ]
57
- es_version: ['8.6-SNAPSHOT']
56
+ ruby: [ '3.0', '3.1', '3.2', 'jruby-9.3' ]
57
+ es_version: ['8.9-SNAPSHOT']
58
58
  runs-on: ubuntu-latest
59
59
  steps:
60
60
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 8.2.2
2
+
3
+ Tested versions of Ruby: (MRI) 3.0, 3.1, 3.2, JRuby 9.3 and JRuby 9.4
4
+
5
+ - Refactors `apply_headers` in base and manticore implementation: When passing in an object to the initializer, `apply_headers` would mutate this object and in certain conditions, this would raise `RuntimeError` in JRuby 9.3 and `ConcurrencyError` in JRuby 9.4. This update clones the options object instead.
6
+
1
7
  ## 8.2.1
2
8
 
3
9
  Tested versions of Ruby: (MRI) 2.7, 3.0, 3.1, 3.2, JRuby 9.3 and JRuby 9.4. Ruby 2.7's end of life is coming in a few days, so this'll probably be the last release to test for Ruby 2.7.
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.name = "elastic-transport"
25
25
  s.version = Elastic::Transport::VERSION
26
26
  s.authors = ['Karel Minarik', 'Emily Stolfo', 'Fernando Briano']
27
- s.email = ['support@elastic.co']
27
+ s.email = ['clients-team@elastic.co']
28
28
  s.summary = 'Low level Ruby client for Elastic services.'
29
29
  s.homepage = 'https://github.com/elastic/elastic-transport-ruby'
30
30
  s.license = 'Apache-2.0'
@@ -122,8 +122,7 @@ module Elastic
122
122
  # @yield [faraday] Access and configure the `Faraday::Connection` instance directly with a block
123
123
  #
124
124
  def initialize(arguments = {}, &block)
125
- @options = arguments.transform_keys(&:to_sym)
126
- @arguments = @options
125
+ @arguments = arguments.transform_keys(&:to_sym)
127
126
  @arguments[:logger] ||= @arguments[:log] ? DEFAULT_LOGGER.call() : nil
128
127
  @arguments[:tracer] ||= @arguments[:trace] ? DEFAULT_TRACER.call() : nil
129
128
  @arguments[:reload_connections] ||= false
@@ -134,7 +133,6 @@ module Elastic
134
133
  @arguments[:transport_options] ||= {}
135
134
  @arguments[:http] ||= {}
136
135
  @arguments[:enable_meta_header] = arguments.fetch(:enable_meta_header, true)
137
- @options[:http] ||= {}
138
136
 
139
137
  @hosts ||= __extract_hosts(@arguments[:hosts] ||
140
138
  @arguments[:host] ||
@@ -236,7 +234,7 @@ module Elastic
236
234
  end
237
235
 
238
236
  host_list = hosts.map { |host| __parse_host(host) }
239
- @options[:randomize_hosts] ? host_list.shuffle! : host_list
237
+ @arguments[:randomize_hosts] ? host_list.shuffle! : host_list
240
238
  end
241
239
 
242
240
  def __parse_host(host)
@@ -273,8 +271,8 @@ module Elastic
273
271
  raise ArgumentError, "Please pass host as a String, URI or Hash -- #{host.class} given."
274
272
  end
275
273
 
276
- @options[:http][:user] ||= host_parts[:user]
277
- @options[:http][:password] ||= host_parts[:password]
274
+ @arguments[:http][:user] ||= host_parts[:user]
275
+ @arguments[:http][:password] ||= host_parts[:password]
278
276
  host_parts[:port] = host_parts[:port].to_i if host_parts[:port]
279
277
  host_parts[:path].chomp!('/') if host_parts[:path]
280
278
  host_parts
@@ -431,7 +431,7 @@ module Elastic
431
431
  end
432
432
 
433
433
  def apply_headers(client, options)
434
- headers = options[:headers] || {}
434
+ headers = options[:headers].clone || {}
435
435
  headers[CONTENT_TYPE_STR] = find_value(headers, CONTENT_TYPE_REGEX) || DEFAULT_CONTENT_TYPE
436
436
  headers[USER_AGENT_STR] = find_value(headers, USER_AGENT_REGEX) || user_agent_header(client)
437
437
  client.headers[ACCEPT_ENCODING] = GZIP if use_compression?
@@ -162,7 +162,7 @@ module Elastic
162
162
  private
163
163
 
164
164
  def apply_headers(options)
165
- headers = options[:headers] || options.dig(:transport_options, :headers) || {}
165
+ headers = options[:headers].clone || options.dig(:transport_options, :headers).clone || {}
166
166
  headers[CONTENT_TYPE_STR] = find_value(headers, CONTENT_TYPE_REGEX) || DEFAULT_CONTENT_TYPE
167
167
  headers[USER_AGENT_STR] = find_value(headers, USER_AGENT_REGEX) || find_value(@request_options[:headers], USER_AGENT_REGEX) || user_agent_header
168
168
  headers[ACCEPT_ENCODING] = GZIP if use_compression?
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elastic
19
19
  module Transport
20
- VERSION = '8.2.1'.freeze
20
+ VERSION = '8.2.2'.freeze
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.1
4
+ version: 8.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-03-23 00:00:00.000000000 Z
13
+ date: 2023-07-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -255,7 +255,7 @@ description: 'Low level Ruby client for Elastic. See the `elasticsearch` or `ela
255
255
 
256
256
  '
257
257
  email:
258
- - support@elastic.co
258
+ - clients-team@elastic.co
259
259
  executables: []
260
260
  extensions: []
261
261
  extra_rdoc_files:
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
339
  - !ruby/object:Gem::Version
340
340
  version: '0'
341
341
  requirements: []
342
- rubygems_version: 3.4.8
342
+ rubygems_version: 3.4.13
343
343
  signing_key:
344
344
  specification_version: 4
345
345
  summary: Low level Ruby client for Elastic services.