elastic-transport 8.4.0 → 8.4.2
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 +4 -4
- data/CHANGELOG.md +14 -1
- data/CONTRIBUTING.md +12 -1
- data/README.md +3 -4
- data/lib/elastic/transport/transport/base.rb +8 -4
- data/lib/elastic/transport/transport/connections/connection.rb +0 -1
- data/lib/elastic/transport/transport/errors.rb +2 -0
- data/lib/elastic/transport/transport/http/curb.rb +16 -11
- data/lib/elastic/transport/transport/http/manticore.rb +7 -5
- data/lib/elastic/transport/transport/serializer/multi_json.rb +16 -2
- data/lib/elastic/transport/transport/sniffer.rb +2 -0
- data/lib/elastic/transport/version.rb +1 -1
- data/lib/elastic/transport.rb +0 -1
- metadata +9 -79
- data/.github/check_license_headers.rb +0 -33
- data/.github/license-header.txt +0 -16
- data/.github/workflows/license.yml +0 -13
- data/.github/workflows/otel.yml +0 -48
- data/.github/workflows/tests.yml +0 -85
- data/.gitignore +0 -19
- data/Gemfile +0 -39
- data/Gemfile-faraday1.gemfile +0 -40
- data/Rakefile +0 -133
- data/elastic-transport.gemspec +0 -71
- data/spec/elastic/connections/collection_spec.rb +0 -266
- data/spec/elastic/connections/selector_spec.rb +0 -166
- data/spec/elastic/transport/base_spec.rb +0 -265
- data/spec/elastic/transport/client_spec.rb +0 -1805
- data/spec/elastic/transport/http/curb_spec.rb +0 -126
- data/spec/elastic/transport/http/faraday_spec.rb +0 -141
- data/spec/elastic/transport/http/manticore_spec.rb +0 -164
- data/spec/elastic/transport/meta_header_spec.rb +0 -289
- data/spec/elastic/transport/opentelemetry_spec.rb +0 -325
- data/spec/elastic/transport/sniffer_spec.rb +0 -293
- data/spec/spec_helper.rb +0 -105
- data/test/integration/jruby_test.rb +0 -46
- data/test/integration/transport_test.rb +0 -144
- data/test/profile/client_benchmark_test.rb +0 -132
- data/test/test_helper.rb +0 -86
- data/test/unit/adapters_test.rb +0 -104
- data/test/unit/connection_test.rb +0 -133
- data/test/unit/response_test.rb +0 -30
- data/test/unit/serializer_test.rb +0 -33
- data/test/unit/transport_base_test.rb +0 -663
- data/test/unit/transport_curb_test.rb +0 -134
- data/test/unit/transport_faraday_test.rb +0 -228
- data/test/unit/transport_manticore_test.rb +0 -268
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba1966e70deb5a53e7b5cfb788dcc4cf1f9393aa9b2c0e196f60c8b745c5feeb
|
|
4
|
+
data.tar.gz: 00067b190b03f0e88e633e7da75468ab7f008942fe2a4a0b03569104ae1e7019
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 132a18af483de7ac79395120b0162b506461e981fb7cecec14f6e6c4bfebacbb1d12789a70c4663d3a3a5b18b5cbc9fec98ca598187ca4364249a22ccff5c48c
|
|
7
|
+
data.tar.gz: cacd7fda40dcb23429f4ab5c5571bf4439112f269355757855cda48c2d27f5441892e4b2dd15853873b7a851d7fb742bfab9ffa693c532b77043eb446e0343d8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 8.4.2
|
|
2
|
+
|
|
3
|
+
- Minor refactor to `curb` implementation.
|
|
4
|
+
- Updated `yard` development dependency to `> 0.9.42`.
|
|
5
|
+
- Fix `multi_json` deprecation warnings. Some deprecations [were introduced in `multi_json` 1.21.0](https://github.com/sferik/multi_json/blob/main/CHANGELOG.md#1210). Pull Request: [#112](https://github.com/elastic/elastic-transport-ruby/pull/112).
|
|
6
|
+
- Reduced gem size. Pull Request: [#114](https://github.com/elastic/elastic-transport-ruby/pull/114).
|
|
7
|
+
- Addresses duplicate `content-type` header in Manticore. Pull Request: [#115](https://github.com/elastic/elastic-transport-ruby/pull/115).
|
|
8
|
+
|
|
9
|
+
## 8.4.1
|
|
10
|
+
|
|
11
|
+
- Moves `require 'timeout'` to the classes that use it. Closed [#79](https://github.com/elastic/elastic-transport-ruby/issues/79).
|
|
12
|
+
- Sanitize url on OTEL spans, thanks @steve21168. Pull Request: [#98](https://github.com/elastic/elastic-transport-ruby/pull/98)
|
|
13
|
+
|
|
1
14
|
## 8.4.0
|
|
2
15
|
|
|
3
16
|
- Adds support for **[Excon](https://github.com/excon/excon)** Faraday adapter. You can use the Excon adapter by setting it in when initializing an Elasticsearch client:
|
|
@@ -21,7 +34,7 @@ Excon.defaults[:ssl_ca_file] = path_to_file
|
|
|
21
34
|
ENV['SSL_CERT_FILE'] = path_to_file
|
|
22
35
|
Excon.defaults[:ssl_verify_callback] = callback
|
|
23
36
|
# (see OpenSSL::SSL::SSLContext#verify_callback)
|
|
24
|
-
Excon.defaults[:ssl_verify_peer] = false
|
|
37
|
+
Excon.defaults[:ssl_verify_peer] = false # (less secure).
|
|
25
38
|
```
|
|
26
39
|
|
|
27
40
|
- Adds support for **[Async::HTTP::Faraday](https://github.com/socketry/async-http-faraday)**. You can use the adapter by setting it when initializing an Elasticsearch client:
|
data/CONTRIBUTING.md
CHANGED
|
@@ -41,7 +41,9 @@ E.g.:
|
|
|
41
41
|
$ rake docker:start[8.0.0-alpha1]
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
You can find the available version in [Docker @ Elastic](https://www.docker.elastic.co/r/elasticsearch).
|
|
44
|
+
You can find the available version in [Docker @ Elastic](https://www.docker.elastic.co/r/elasticsearch).
|
|
45
|
+
|
|
46
|
+
You can also run Elasticsearch and Kibana locally with Docker with `start-local`:
|
|
45
47
|
|
|
46
48
|
```bash
|
|
47
49
|
curl -fsSL https://elastic.co/start-local | sh
|
|
@@ -49,6 +51,15 @@ curl -fsSL https://elastic.co/start-local | sh
|
|
|
49
51
|
|
|
50
52
|
This will run Elasticsearch in http://localhost:9200 and Kibana in http://localhost:5601. More information is available [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html).
|
|
51
53
|
|
|
54
|
+
## Faraday 1 tests
|
|
55
|
+
|
|
56
|
+
You can run the tests for Faraday v1 with the following commands:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
BUNDLE_GEMFILE=Gemfile-faraday1.gemfile bundle install
|
|
60
|
+
BUNDLE_GEMFILE=Gemfile-faraday1.gemfile rake test:all
|
|
61
|
+
```
|
|
62
|
+
|
|
52
63
|
# Contributing
|
|
53
64
|
|
|
54
65
|
The process for contributing is:
|
data/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Elastic Transport
|
|
2
|
-
[](https://github.com/elastic/elastic-transport-ruby/actions/workflows/tests.yml)
|
|
3
2
|
[](https://github.com/elastic/elastic-transport-ruby/actions/workflows/tests.yml)
|
|
4
3
|
|
|
5
|
-
This gem provides a low-level Ruby client for connecting to an [Elastic](http://elastic.co) cluster. It powers
|
|
4
|
+
This gem provides a low-level Ruby client for connecting to an [Elastic](http://elastic.co) cluster. It powers the [Elasticsearch client](https://github.com/elasticsearch/elasticsearch-ruby/) and other Elastic projects.
|
|
6
5
|
|
|
7
6
|
In the simplest form, connect to Elasticsearch running on `http://localhost:9200` without any configuration:
|
|
8
7
|
|
|
@@ -14,9 +13,9 @@ response = client.perform_request('GET', '_cluster/health')
|
|
|
14
13
|
# => #<Elastic::Transport::Transport::Response:0x007fc5d506ce38 @status=200, @body={ ... } >
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
**Refer to [the official documentation on Elastic Transport](https://www.elastic.co/
|
|
16
|
+
**Refer to [the official documentation on Elastic Transport](https://www.elastic.co/docs/reference/elasticsearch/clients/ruby/transport).**
|
|
18
17
|
|
|
19
|
-
**Refer to [Advanced Configuration](https://www.elastic.co/
|
|
18
|
+
**Refer to [Advanced Configuration](https://www.elastic.co/docs/reference/elasticsearch/clients/ruby/advanced-config) to read about more configuration options.**
|
|
20
19
|
|
|
21
20
|
## Compatibility
|
|
22
21
|
|
|
@@ -195,7 +195,7 @@ module Elastic
|
|
|
195
195
|
#
|
|
196
196
|
def __log_response(method, path, params, body, url, response, json, took, duration)
|
|
197
197
|
if logger
|
|
198
|
-
sanitized_url = url.to_s
|
|
198
|
+
sanitized_url = sanitize_url(url.to_s)
|
|
199
199
|
log_info "#{method.to_s.upcase} #{sanitized_url} " +
|
|
200
200
|
"[status:#{response.status}, request:#{sprintf('%.3fs', duration)}, query:#{took}]"
|
|
201
201
|
log_debug "> #{__convert_to_json(body)}" if body
|
|
@@ -379,11 +379,11 @@ module Elastic
|
|
|
379
379
|
private
|
|
380
380
|
|
|
381
381
|
USER_AGENT_STR = 'User-Agent'.freeze
|
|
382
|
-
USER_AGENT_REGEX = /user-?_?agent
|
|
382
|
+
USER_AGENT_REGEX = /user-?_?agent/.freeze
|
|
383
383
|
ACCEPT_ENCODING = 'Accept-Encoding'.freeze
|
|
384
384
|
CONTENT_ENCODING = 'Content-Encoding'.freeze
|
|
385
385
|
CONTENT_TYPE_STR = 'Content-Type'.freeze
|
|
386
|
-
CONTENT_TYPE_REGEX = /content-?_?type/
|
|
386
|
+
CONTENT_TYPE_REGEX = /content-?_?type/i.freeze
|
|
387
387
|
DEFAULT_CONTENT_TYPE = 'application/json'.freeze
|
|
388
388
|
GZIP = 'gzip'.freeze
|
|
389
389
|
GZIP_FIRST_TWO_BYTES = '1f8b'.freeze
|
|
@@ -472,9 +472,13 @@ module Elastic
|
|
|
472
472
|
end
|
|
473
473
|
end
|
|
474
474
|
|
|
475
|
+
def sanitize_url(url)
|
|
476
|
+
url.to_s.gsub(/\/\/(.+):(.+)@/, '//' + '\1:' + SANITIZED_PASSWORD + '@')
|
|
477
|
+
end
|
|
478
|
+
|
|
475
479
|
def capture_otel_span_attributes(connection, url)
|
|
476
480
|
if defined?(::OpenTelemetry)
|
|
477
|
-
::OpenTelemetry::Trace.current_span&.set_attribute('url.full', url)
|
|
481
|
+
::OpenTelemetry::Trace.current_span&.set_attribute('url.full', sanitize_url(url))
|
|
478
482
|
::OpenTelemetry::Trace.current_span&.set_attribute('server.address', connection.host[:host])
|
|
479
483
|
::OpenTelemetry::Trace.current_span&.set_attribute('server.port', connection.host[:port].to_i)
|
|
480
484
|
end
|
|
@@ -30,7 +30,7 @@ module Elastic
|
|
|
30
30
|
# @return [Response]
|
|
31
31
|
# @see Transport::Base#perform_request
|
|
32
32
|
#
|
|
33
|
-
def perform_request(method, path, params={}, body=nil, headers=nil, opts={})
|
|
33
|
+
def perform_request(method, path, params = {}, body = nil, headers = nil, opts = {})
|
|
34
34
|
super do |connection, url|
|
|
35
35
|
capture_otel_span_attributes(connection, url)
|
|
36
36
|
connection.connection.url = connection.full_url(path, params)
|
|
@@ -44,14 +44,7 @@ module Elastic
|
|
|
44
44
|
connection.connection.set :nobody, false
|
|
45
45
|
connection.connection.put_data = body if body
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
if connection.connection.headers
|
|
49
|
-
connection.connection.headers.merge!(headers)
|
|
50
|
-
else
|
|
51
|
-
connection.connection.headers = headers
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
47
|
+
parse_headers!(headers, connection)
|
|
55
48
|
else raise ArgumentError, "Unsupported HTTP method: #{method}"
|
|
56
49
|
end
|
|
57
50
|
|
|
@@ -69,11 +62,23 @@ module Elastic
|
|
|
69
62
|
end
|
|
70
63
|
end
|
|
71
64
|
|
|
65
|
+
# Merges headers already present in the connection and the ones passed in to perform_request
|
|
66
|
+
#
|
|
67
|
+
def parse_headers!(headers, connection)
|
|
68
|
+
return unless headers
|
|
69
|
+
|
|
70
|
+
if connection.connection.headers
|
|
71
|
+
connection.connection.headers.merge!(headers)
|
|
72
|
+
else
|
|
73
|
+
connection.connection.headers = headers
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
72
77
|
# Builds and returns a connection
|
|
73
78
|
#
|
|
74
79
|
# @return [Connections::Connection]
|
|
75
80
|
#
|
|
76
|
-
def __build_connection(host, options={}, block=nil)
|
|
81
|
+
def __build_connection(host, options = {}, block = nil)
|
|
77
82
|
client = ::Curl::Easy.new
|
|
78
83
|
|
|
79
84
|
apply_headers(client, options)
|
|
@@ -87,7 +92,7 @@ module Elastic
|
|
|
87
92
|
|
|
88
93
|
client.instance_eval(&block) if block
|
|
89
94
|
|
|
90
|
-
Connections::Connection.new
|
|
95
|
+
Connections::Connection.new(host: host, connection: client)
|
|
91
96
|
end
|
|
92
97
|
|
|
93
98
|
# Returns an array of implementation specific connection errors.
|
|
@@ -64,11 +64,10 @@ module Elastic
|
|
|
64
64
|
|
|
65
65
|
def initialize(arguments = {}, &block)
|
|
66
66
|
@request_options = {
|
|
67
|
-
headers:
|
|
67
|
+
headers:
|
|
68
68
|
arguments.dig(:transport_options, :headers) ||
|
|
69
69
|
arguments.dig(:options, :transport_options, :headers) ||
|
|
70
70
|
{}
|
|
71
|
-
)
|
|
72
71
|
}
|
|
73
72
|
@manticore = build_client(arguments[:options] || {})
|
|
74
73
|
super(arguments, &block)
|
|
@@ -78,7 +77,6 @@ module Elastic
|
|
|
78
77
|
def build_client(options = {})
|
|
79
78
|
client_options = options[:transport_options] || {}
|
|
80
79
|
client_options[:ssl] = options[:ssl] || {}
|
|
81
|
-
|
|
82
80
|
@manticore = ::Manticore::Client.new(client_options)
|
|
83
81
|
end
|
|
84
82
|
|
|
@@ -120,7 +118,6 @@ module Elastic
|
|
|
120
118
|
#
|
|
121
119
|
def __build_connections
|
|
122
120
|
apply_headers(options)
|
|
123
|
-
|
|
124
121
|
Connections::Collection.new(
|
|
125
122
|
connections: hosts.map do |host|
|
|
126
123
|
host[:protocol] = host[:scheme] || DEFAULT_PROTOCOL
|
|
@@ -169,7 +166,12 @@ module Elastic
|
|
|
169
166
|
|
|
170
167
|
def apply_headers(options)
|
|
171
168
|
headers = options[:headers].clone || options.dig(:transport_options, :headers).clone || {}
|
|
172
|
-
|
|
169
|
+
if (value = find_value(headers, CONTENT_TYPE_REGEX))
|
|
170
|
+
@request_options[:headers].reject! { |k, _| k.match? CONTENT_TYPE_REGEX }
|
|
171
|
+
headers[CONTENT_TYPE_STR] = value
|
|
172
|
+
else
|
|
173
|
+
headers[CONTENT_TYPE_STR] = DEFAULT_CONTENT_TYPE
|
|
174
|
+
end
|
|
173
175
|
headers[USER_AGENT_STR] = find_value(headers, USER_AGENT_REGEX) || find_value(@request_options[:headers], USER_AGENT_REGEX) || user_agent_header
|
|
174
176
|
headers[ACCEPT_ENCODING] = GZIP if use_compression?
|
|
175
177
|
@request_options[:headers].merge!(headers)
|
|
@@ -37,13 +37,27 @@ module Elastic
|
|
|
37
37
|
# De-serialize a Hash from JSON string
|
|
38
38
|
#
|
|
39
39
|
def load(string, options = {})
|
|
40
|
-
|
|
40
|
+
if deprecated_gem_version_loaded?
|
|
41
|
+
::MultiJson.load(string, options)
|
|
42
|
+
else
|
|
43
|
+
::MultiJSON.parse(string, options)
|
|
44
|
+
end
|
|
41
45
|
end
|
|
42
46
|
|
|
43
47
|
# Serialize a Hash to JSON string
|
|
44
48
|
#
|
|
45
49
|
def dump(object, options = {})
|
|
46
|
-
|
|
50
|
+
if deprecated_gem_version_loaded?
|
|
51
|
+
::MultiJson.dump(object, options)
|
|
52
|
+
else
|
|
53
|
+
::MultiJSON.generate(object, options)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def deprecated_gem_version_loaded?
|
|
60
|
+
Gem.loaded_specs['multi_json'].version < Gem::Version.create('1.21.0')
|
|
47
61
|
end
|
|
48
62
|
end
|
|
49
63
|
end
|
data/lib/elastic/transport.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elastic-transport
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.4.
|
|
4
|
+
version: 8.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic Client Library Maintainers
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: faraday
|
|
@@ -37,20 +37,6 @@ dependencies:
|
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '0'
|
|
40
|
-
- !ruby/object:Gem::Dependency
|
|
41
|
-
name: curb
|
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
|
43
|
-
requirements:
|
|
44
|
-
- - ">="
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '0'
|
|
47
|
-
type: :development
|
|
48
|
-
prerelease: false
|
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
-
requirements:
|
|
51
|
-
- - ">="
|
|
52
|
-
- !ruby/object:Gem::Version
|
|
53
|
-
version: '0'
|
|
54
40
|
- !ruby/object:Gem::Dependency
|
|
55
41
|
name: bundler
|
|
56
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -237,16 +223,16 @@ dependencies:
|
|
|
237
223
|
name: yard
|
|
238
224
|
requirement: !ruby/object:Gem::Requirement
|
|
239
225
|
requirements:
|
|
240
|
-
- - "
|
|
226
|
+
- - ">"
|
|
241
227
|
- !ruby/object:Gem::Version
|
|
242
|
-
version:
|
|
228
|
+
version: 0.9.42
|
|
243
229
|
type: :development
|
|
244
230
|
prerelease: false
|
|
245
231
|
version_requirements: !ruby/object:Gem::Requirement
|
|
246
232
|
requirements:
|
|
247
|
-
- - "
|
|
233
|
+
- - ">"
|
|
248
234
|
- !ruby/object:Gem::Version
|
|
249
|
-
version:
|
|
235
|
+
version: 0.9.42
|
|
250
236
|
description: 'Low level Ruby client for Elastic. See the `elasticsearch` or `elastic-enterprise-search`
|
|
251
237
|
gems for full integration.
|
|
252
238
|
|
|
@@ -256,23 +242,13 @@ email:
|
|
|
256
242
|
executables: []
|
|
257
243
|
extensions: []
|
|
258
244
|
extra_rdoc_files:
|
|
259
|
-
- README.md
|
|
260
245
|
- LICENSE
|
|
246
|
+
- README.md
|
|
261
247
|
files:
|
|
262
|
-
- ".github/check_license_headers.rb"
|
|
263
|
-
- ".github/license-header.txt"
|
|
264
|
-
- ".github/workflows/license.yml"
|
|
265
|
-
- ".github/workflows/otel.yml"
|
|
266
|
-
- ".github/workflows/tests.yml"
|
|
267
|
-
- ".gitignore"
|
|
268
248
|
- CHANGELOG.md
|
|
269
249
|
- CONTRIBUTING.md
|
|
270
|
-
- Gemfile
|
|
271
|
-
- Gemfile-faraday1.gemfile
|
|
272
250
|
- LICENSE
|
|
273
251
|
- README.md
|
|
274
|
-
- Rakefile
|
|
275
|
-
- elastic-transport.gemspec
|
|
276
252
|
- lib/elastic-transport.rb
|
|
277
253
|
- lib/elastic/transport.rb
|
|
278
254
|
- lib/elastic/transport/client.rb
|
|
@@ -292,29 +268,6 @@ files:
|
|
|
292
268
|
- lib/elastic/transport/transport/serializer/multi_json.rb
|
|
293
269
|
- lib/elastic/transport/transport/sniffer.rb
|
|
294
270
|
- lib/elastic/transport/version.rb
|
|
295
|
-
- spec/elastic/connections/collection_spec.rb
|
|
296
|
-
- spec/elastic/connections/selector_spec.rb
|
|
297
|
-
- spec/elastic/transport/base_spec.rb
|
|
298
|
-
- spec/elastic/transport/client_spec.rb
|
|
299
|
-
- spec/elastic/transport/http/curb_spec.rb
|
|
300
|
-
- spec/elastic/transport/http/faraday_spec.rb
|
|
301
|
-
- spec/elastic/transport/http/manticore_spec.rb
|
|
302
|
-
- spec/elastic/transport/meta_header_spec.rb
|
|
303
|
-
- spec/elastic/transport/opentelemetry_spec.rb
|
|
304
|
-
- spec/elastic/transport/sniffer_spec.rb
|
|
305
|
-
- spec/spec_helper.rb
|
|
306
|
-
- test/integration/jruby_test.rb
|
|
307
|
-
- test/integration/transport_test.rb
|
|
308
|
-
- test/profile/client_benchmark_test.rb
|
|
309
|
-
- test/test_helper.rb
|
|
310
|
-
- test/unit/adapters_test.rb
|
|
311
|
-
- test/unit/connection_test.rb
|
|
312
|
-
- test/unit/response_test.rb
|
|
313
|
-
- test/unit/serializer_test.rb
|
|
314
|
-
- test/unit/transport_base_test.rb
|
|
315
|
-
- test/unit/transport_curb_test.rb
|
|
316
|
-
- test/unit/transport_faraday_test.rb
|
|
317
|
-
- test/unit/transport_manticore_test.rb
|
|
318
271
|
homepage: https://github.com/elastic/elastic-transport-ruby
|
|
319
272
|
licenses:
|
|
320
273
|
- Apache-2.0
|
|
@@ -338,30 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
338
291
|
- !ruby/object:Gem::Version
|
|
339
292
|
version: '0'
|
|
340
293
|
requirements: []
|
|
341
|
-
rubygems_version:
|
|
294
|
+
rubygems_version: 4.0.12
|
|
342
295
|
specification_version: 4
|
|
343
296
|
summary: Low level Ruby client for Elastic services.
|
|
344
|
-
test_files:
|
|
345
|
-
- spec/elastic/connections/collection_spec.rb
|
|
346
|
-
- spec/elastic/connections/selector_spec.rb
|
|
347
|
-
- spec/elastic/transport/base_spec.rb
|
|
348
|
-
- spec/elastic/transport/client_spec.rb
|
|
349
|
-
- spec/elastic/transport/http/curb_spec.rb
|
|
350
|
-
- spec/elastic/transport/http/faraday_spec.rb
|
|
351
|
-
- spec/elastic/transport/http/manticore_spec.rb
|
|
352
|
-
- spec/elastic/transport/meta_header_spec.rb
|
|
353
|
-
- spec/elastic/transport/opentelemetry_spec.rb
|
|
354
|
-
- spec/elastic/transport/sniffer_spec.rb
|
|
355
|
-
- spec/spec_helper.rb
|
|
356
|
-
- test/integration/jruby_test.rb
|
|
357
|
-
- test/integration/transport_test.rb
|
|
358
|
-
- test/profile/client_benchmark_test.rb
|
|
359
|
-
- test/test_helper.rb
|
|
360
|
-
- test/unit/adapters_test.rb
|
|
361
|
-
- test/unit/connection_test.rb
|
|
362
|
-
- test/unit/response_test.rb
|
|
363
|
-
- test/unit/serializer_test.rb
|
|
364
|
-
- test/unit/transport_base_test.rb
|
|
365
|
-
- test/unit/transport_curb_test.rb
|
|
366
|
-
- test/unit/transport_faraday_test.rb
|
|
367
|
-
- test/unit/transport_manticore_test.rb
|
|
297
|
+
test_files: []
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
-
# license agreements. See the NOTICE file distributed with
|
|
3
|
-
# this work for additional information regarding copyright
|
|
4
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
-
# not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
LICENSE = File.read('./.github/license-header.txt')
|
|
19
|
-
files = `git ls-files | grep -E '\.rb|Rakefile|\.rake|\.erb|Gemfile|gemspec'`.split("\n")
|
|
20
|
-
errors = []
|
|
21
|
-
|
|
22
|
-
files.each do |file|
|
|
23
|
-
unless File.read(file).include?(LICENSE)
|
|
24
|
-
errors << file
|
|
25
|
-
puts "#{file} doesn't contain the correct license header"
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
if errors.empty?
|
|
30
|
-
puts 'All checked files have the correct license header'
|
|
31
|
-
else
|
|
32
|
-
exit 1
|
|
33
|
-
end
|
data/.github/license-header.txt
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
-
# license agreements. See the NOTICE file distributed with
|
|
3
|
-
# this work for additional information regarding copyright
|
|
4
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
-
# not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
name: License headers
|
|
2
|
-
on: [pull_request]
|
|
3
|
-
jobs:
|
|
4
|
-
build:
|
|
5
|
-
runs-on: ubuntu-latest
|
|
6
|
-
steps:
|
|
7
|
-
- uses: actions/checkout@v4
|
|
8
|
-
- uses: ruby/setup-ruby@v1
|
|
9
|
-
with:
|
|
10
|
-
ruby-version: '3.4'
|
|
11
|
-
- name: Check license headers
|
|
12
|
-
run: |
|
|
13
|
-
ruby ./.github/check_license_headers.rb
|
data/.github/workflows/otel.yml
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
name: opentelemetry
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
pull_request:
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
jobs:
|
|
10
|
-
test-otel:
|
|
11
|
-
name: 'Test Open Telemetry'
|
|
12
|
-
env:
|
|
13
|
-
TEST_ES_SERVER: http://localhost:9250
|
|
14
|
-
PORT: 9250
|
|
15
|
-
TEST_WITH_OTEL: true
|
|
16
|
-
strategy:
|
|
17
|
-
fail-fast: false
|
|
18
|
-
matrix:
|
|
19
|
-
ruby: ['3.4', 'jruby-9.4']
|
|
20
|
-
es_version: ['8.17.0-SNAPSHOT']
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v4
|
|
24
|
-
- name: Increase system limits
|
|
25
|
-
run: |
|
|
26
|
-
sudo swapoff -a
|
|
27
|
-
sudo sysctl -w vm.swappiness=1
|
|
28
|
-
sudo sysctl -w fs.file-max=262144
|
|
29
|
-
sudo sysctl -w vm.max_map_count=262144
|
|
30
|
-
- uses: elastic/elastic-github-actions/elasticsearch@master
|
|
31
|
-
with:
|
|
32
|
-
stack-version: ${{ matrix.es_version }}
|
|
33
|
-
security-enabled: false
|
|
34
|
-
- uses: ruby/setup-ruby@v1
|
|
35
|
-
with:
|
|
36
|
-
ruby-version: ${{ matrix.ruby }}
|
|
37
|
-
- name: Build and test with Rake
|
|
38
|
-
run: |
|
|
39
|
-
sudo apt-get update
|
|
40
|
-
sudo apt-get install libcurl4-openssl-dev
|
|
41
|
-
ruby -v
|
|
42
|
-
bundle install
|
|
43
|
-
- name: unit tests
|
|
44
|
-
run: bundle exec rake test:unit
|
|
45
|
-
- name: specs
|
|
46
|
-
run: bundle exec rake test:spec
|
|
47
|
-
- name: integration tests
|
|
48
|
-
run: bundle exec rake test:integration
|
data/.github/workflows/tests.yml
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
name: main tests
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
pull_request:
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
name: 'Main tests'
|
|
12
|
-
env:
|
|
13
|
-
TEST_ES_SERVER: http://localhost:9250
|
|
14
|
-
PORT: 9250
|
|
15
|
-
strategy:
|
|
16
|
-
fail-fast: false
|
|
17
|
-
matrix:
|
|
18
|
-
ruby: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.3', 'jruby-9.4']
|
|
19
|
-
es_version: ['8.16.0-SNAPSHOT', '8.17.0-SNAPSHOT', '8.18.0-SNAPSHOT']
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v4
|
|
23
|
-
- name: Increase system limits
|
|
24
|
-
run: |
|
|
25
|
-
sudo swapoff -a
|
|
26
|
-
sudo sysctl -w vm.swappiness=1
|
|
27
|
-
sudo sysctl -w fs.file-max=262144
|
|
28
|
-
sudo sysctl -w vm.max_map_count=262144
|
|
29
|
-
- uses: elastic/elastic-github-actions/elasticsearch@master
|
|
30
|
-
with:
|
|
31
|
-
stack-version: ${{ matrix.es_version }}
|
|
32
|
-
security-enabled: false
|
|
33
|
-
- uses: ruby/setup-ruby@v1
|
|
34
|
-
with:
|
|
35
|
-
ruby-version: ${{ matrix.ruby }}
|
|
36
|
-
- name: Build and test with Rake
|
|
37
|
-
run: |
|
|
38
|
-
sudo apt-get update
|
|
39
|
-
sudo apt-get install libcurl4-openssl-dev
|
|
40
|
-
ruby -v
|
|
41
|
-
bundle install
|
|
42
|
-
- name: unit tests
|
|
43
|
-
run: bundle exec rake test:unit
|
|
44
|
-
- name: specs
|
|
45
|
-
run: bundle exec rake test:spec
|
|
46
|
-
- name: integration tests
|
|
47
|
-
run: bundle exec rake test:integration
|
|
48
|
-
test-faraday1:
|
|
49
|
-
name: 'Test Faraday 1'
|
|
50
|
-
env:
|
|
51
|
-
TEST_ES_SERVER: http://localhost:9250
|
|
52
|
-
PORT: 9250
|
|
53
|
-
strategy:
|
|
54
|
-
fail-fast: false
|
|
55
|
-
matrix:
|
|
56
|
-
ruby: ['3.0', '3.1', '3.2', '3.3', 'jruby-9.3']
|
|
57
|
-
es_version: ['8.16.0-SNAPSHOT']
|
|
58
|
-
runs-on: ubuntu-latest
|
|
59
|
-
steps:
|
|
60
|
-
- uses: actions/checkout@v4
|
|
61
|
-
- name: Increase system limits
|
|
62
|
-
run: |
|
|
63
|
-
sudo swapoff -a
|
|
64
|
-
sudo sysctl -w vm.swappiness=1
|
|
65
|
-
sudo sysctl -w fs.file-max=262144
|
|
66
|
-
sudo sysctl -w vm.max_map_count=262144
|
|
67
|
-
- uses: elastic/elastic-github-actions/elasticsearch@master
|
|
68
|
-
with:
|
|
69
|
-
stack-version: ${{ matrix.es_version }}
|
|
70
|
-
security-enabled: false
|
|
71
|
-
- uses: ruby/setup-ruby@v1
|
|
72
|
-
with:
|
|
73
|
-
ruby-version: ${{ matrix.ruby }}
|
|
74
|
-
- name: Build and test with Rake
|
|
75
|
-
run: |
|
|
76
|
-
sudo apt-get update
|
|
77
|
-
sudo apt-get install libcurl4-openssl-dev
|
|
78
|
-
ruby -v
|
|
79
|
-
BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle install
|
|
80
|
-
- name: faraday1 unit tests
|
|
81
|
-
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:unit
|
|
82
|
-
- name: specs
|
|
83
|
-
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:spec
|
|
84
|
-
- name: integration tests
|
|
85
|
-
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:integration
|
data/.gitignore
DELETED