elastic-transport 8.3.0 → 8.3.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: e52d8e6c8f71d5d4c41362c059e32edb1604d8f63ed7cb13688ea75eaf4d5509
4
- data.tar.gz: 4107c6f56a20d397102eb724734ee661d820af2c8b96dae63e72154b40e661f3
3
+ metadata.gz: 0ece16e8da350495285378d8f76df8e40a3c366c75e90c37c6e7d5558780b175
4
+ data.tar.gz: 10655669e9c1b4254e607424ee4acd5d2cdaa3c56a3a8988f6a29e6b507fa982
5
5
  SHA512:
6
- metadata.gz: 7c69236ddfa00fb917b7c0440539f0cfec3f16d8464fd0cee0293eb8b88a11240bfff4c45b2da83aecb1e3427859473cfe4862189160b15aa376690a3a0b0e16
7
- data.tar.gz: 286a89fb6a350273c60d6c85c8082eec0cf51860624244755e81bc375d385863fe21f7c4e50dffd7c0935c875fd72645fa053f3edec7a8fb65a9cad06bdea726
6
+ metadata.gz: 4e541aaddfc31d02364d648e96dac3c7e42abda88650fc1c8e48dbdb3c84f26bc83fb9355c52e3972cd3c6d5ebf1b6e670c7beb0449988d8db69641013bae19f
7
+ data.tar.gz: 4cbde4527ca45280bf0cdd719ace9823e4c5462c03b0404263f5c4ac6dd0328249ca04cbb1d6a01bfad8ab489355ac8acb7513255069586a99e6575a1915bdce
@@ -16,8 +16,8 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: ['3.2', 'jruby-9.4']
20
- es_version: ['8.9-SNAPSHOT']
19
+ ruby: ['3.3', 'jruby-9.4']
20
+ es_version: ['8.12-SNAPSHOT']
21
21
  runs-on: ubuntu-latest
22
22
  steps:
23
23
  - uses: actions/checkout@v2
@@ -15,8 +15,8 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby: [ '3.0', '3.1', '3.2', 'jruby-9.3', 'jruby-9.4' ]
19
- es_version: ['8.9-SNAPSHOT', '8.10-SNAPSHOT', '8.11.0-SNAPSHOT']
18
+ ruby: [ '3.0', '3.1', '3.2', '3.3', 'jruby-9.3', 'jruby-9.4' ]
19
+ es_version: ['8.10-SNAPSHOT', '8.11-SNAPSHOT', '8.12-SNAPSHOT']
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
22
  - uses: actions/checkout@v3
@@ -53,8 +53,8 @@ jobs:
53
53
  strategy:
54
54
  fail-fast: false
55
55
  matrix:
56
- ruby: [ '3.0', '3.1', '3.2', 'jruby-9.3' ]
57
- es_version: ['8.9-SNAPSHOT']
56
+ ruby: [ '3.0', '3.1', '3.2', '3.3', 'jruby-9.3' ]
57
+ es_version: ['8.12-SNAPSHOT']
58
58
  runs-on: ubuntu-latest
59
59
  steps:
60
60
  - uses: actions/checkout@v3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 8.3.2
2
+
3
+ - OpenTelemetry: In v8.3.0 and v8.3.1, the environment variable `OTEL_INSTRUMENTATION_ELASTICSEARCH_CAPTURE_SEARCH_QUERY` was available but is now deprecated in favor of `OTEL_RUBY_INSTRUMENTATION_ELASTICSEARCH_CAPTURE_SEARCH_QUERY`.
4
+
5
+ ## 8.3.1
6
+
7
+ Tested versions of Ruby: (MRI) 3.0, 3.1, 3.2, 3.3, JRuby 9.3 and JRuby 9.4
8
+
9
+ - Removes unneccessary `require 'base64'` found thanks to warning in Ruby 3.3. So this removes the warning too if you were using Ruby 3.3.
10
+
1
11
  ## 8.3.0
2
12
 
3
13
  Tested versions of Ruby: (MRI) 3.0, 3.1, 3.2, JRuby 9.3 and JRuby 9.4
@@ -15,7 +15,6 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- require 'base64'
19
18
  require 'elastic/transport/meta_header'
20
19
 
21
20
  module Elastic
@@ -15,8 +15,6 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- require 'base64'
19
-
20
18
  module Elastic
21
19
  module Transport
22
20
  # Methods for the Elastic meta header used by Cloud.
@@ -27,7 +27,8 @@ module Elastic
27
27
  # Describes how to handle search queries in the request body when assigned to
28
28
  # a span attribute.
29
29
  # Valid values are 'raw', 'omit', 'sanitize'. Default is 'omit'.
30
- ENV_VARIABLE_BODY_STRATEGY = 'OTEL_INSTRUMENTATION_ELASTICSEARCH_CAPTURE_SEARCH_QUERY'
30
+ ENV_VARIABLE_BODY_STRATEGY = 'OTEL_RUBY_INSTRUMENTATION_ELASTICSEARCH_CAPTURE_SEARCH_QUERY'
31
+ ENV_VARIABLE_DEPRECATED_BODY_STRATEGY = 'OTEL_INSTRUMENTATION_ELASTICSEARCH_CAPTURE_SEARCH_QUERY'
31
32
  DEFAULT_BODY_STRATEGY = 'omit'
32
33
  # A string list of keys whose values are redacted. This is only relevant if the body strategy is
33
34
  # 'sanitize'. For example, a config 'sensitive-key,other-key' will redact the values at
@@ -53,7 +54,8 @@ module Elastic
53
54
  @tracer = (opts[:opentelemetry_tracer_provider] || ::OpenTelemetry.tracer_provider).tracer(
54
55
  OTEL_TRACER_NAME, Elastic::Transport::VERSION
55
56
  )
56
- @body_strategy = ENV[ENV_VARIABLE_BODY_STRATEGY] || DEFAULT_BODY_STRATEGY
57
+ @body_strategy = ENV[ENV_VARIABLE_DEPRECATED_BODY_STRATEGY] || ENV[ENV_VARIABLE_BODY_STRATEGY] ||
58
+ DEFAULT_BODY_STRATEGY
57
59
  @sanitize_keys = ENV[ENV_VARIABLE_BODY_SANITIZE_KEYS]&.split(',')&.collect! do |pattern|
58
60
  Regexp.new(pattern.gsub('*', '.*'))
59
61
  end
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elastic
19
19
  module Transport
20
- VERSION = '8.3.0'.freeze
20
+ VERSION = '8.3.2'.freeze
21
21
  end
22
22
  end
@@ -131,6 +131,25 @@ if defined?(::OpenTelemetry)
131
131
  end
132
132
  end
133
133
 
134
+ context 'with deprecated ENV variable' do
135
+ let(:sanitized_body) do
136
+ { query: { match: { password: 'REDACTED' } } }
137
+ end
138
+
139
+ around(:example) do |ex|
140
+ body_strategy = ENV[described_class::ENV_VARIABLE_DEPRECATED_BODY_STRATEGY]
141
+ ENV[described_class::ENV_VARIABLE_DEPRECATED_BODY_STRATEGY] = 'sanitize'
142
+ ex.run
143
+ ENV[described_class::ENV_VARIABLE_DEPRECATED_BODY_STRATEGY] = body_strategy
144
+ end
145
+
146
+ it 'sanitizes the body' do
147
+ client.perform_request('GET', '/_search', nil, body, nil, endpoint: 'search')
148
+
149
+ expect(span.attributes['db.statement']).to eq(sanitized_body.to_json)
150
+ end
151
+ end
152
+
134
153
  context 'with custom keys' do
135
154
  let(:body) do
136
155
  { query: { match: { sensitive: { query: 'secret'} } } }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.0
4
+ version: 8.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic Client Library Maintainers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-28 00:00:00.000000000 Z
11
+ date: 2024-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -340,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
340
  - !ruby/object:Gem::Version
341
341
  version: '0'
342
342
  requirements: []
343
- rubygems_version: 3.4.19
343
+ rubygems_version: 3.5.3
344
344
  signing_key:
345
345
  specification_version: 4
346
346
  summary: Low level Ruby client for Elastic services.