opensearch-ruby 1.0.0 → 1.0.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.
Potentially problematic release.
This version of opensearch-ruby might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Rakefile +12 -6
- data/lib/opensearch/version.rb +1 -1
- data/opensearch.gemspec +1 -1
- data/spec/integration/{client_integration_spec.rb → security_disabled/client_integration_spec.rb} +1 -1
- data/spec/integration/{validation_integration_spec.rb → security_disabled/validation_integration_spec.rb} +0 -0
- data/spec/integration/security_enabled/client_integration_spec.rb +43 -0
- data/spec/integration/security_enabled/validation_integration_spec.rb +40 -0
- data.tar.gz.sig +0 -0
- metadata +12 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c4614b085c6667bb7092e2dce58858363ab95040ebbcde44543413bfe26d159
|
4
|
+
data.tar.gz: b2d2c5f96bd86308eba66f2bd2412102c1113fcdf2a995fb1a13ed6111b858df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a348afb4ab8892fe62bfabd856bea87649c2e783258f810fdef2a838daee2885d79a3d56f7e17ec7684736d79e32eb52c0731defeea3676fd618dbb25af72a9
|
7
|
+
data.tar.gz: 47abd0b18a8016f2d0ea1db1889efc051dc6c1f922ab05c578a255e2d1380183d713f08b7f579472e5b312a2d69ff944f6849f5a76e1e667990b299a0bd9508c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -35,13 +35,8 @@ task test: 'test:spec'
|
|
35
35
|
require 'rspec/core/rake_task'
|
36
36
|
|
37
37
|
namespace :test do
|
38
|
-
desc 'Wait for OpenSearch to be in a green state'
|
39
|
-
task :wait_for_green do
|
40
|
-
sh '../scripts/wait-cluster.sh'
|
41
|
-
end
|
42
|
-
|
43
38
|
RSpec::Core::RakeTask.new(:integration) do |t|
|
44
|
-
t.pattern = 'spec/integration/**{,/*/**}/*_spec.rb'
|
39
|
+
t.pattern = 'spec/integration/security_disabled/**{,/*/**}/*_spec.rb'
|
45
40
|
end
|
46
41
|
|
47
42
|
RSpec::Core::RakeTask.new(:unit) do |t|
|
@@ -55,6 +50,17 @@ namespace :test do
|
|
55
50
|
end
|
56
51
|
end
|
57
52
|
|
53
|
+
namespace :test_security do
|
54
|
+
RSpec::Core::RakeTask.new(:integration) do |t|
|
55
|
+
t.pattern = 'spec/integration/security_enabled/**{,/*/**}/*_spec.rb'
|
56
|
+
end
|
57
|
+
|
58
|
+
desc 'Run security integration tests'
|
59
|
+
task :all do
|
60
|
+
Rake::Task['test_security:integration'].invoke
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
58
64
|
# ----- Documentation tasks ---------------------------------------------------
|
59
65
|
|
60
66
|
require 'yard'
|
data/lib/opensearch/version.rb
CHANGED
data/opensearch.gemspec
CHANGED
@@ -61,7 +61,7 @@ Gem::Specification.new do |s|
|
|
61
61
|
|
62
62
|
s.required_ruby_version = '>= 2.4'
|
63
63
|
|
64
|
-
s.add_dependency 'opensearch-transport', '1.0.0'
|
64
|
+
s.add_dependency 'opensearch-transport', '~> 1.0.0'
|
65
65
|
s.add_dependency 'opensearch-api', '1.0.0'
|
66
66
|
|
67
67
|
s.add_development_dependency 'bundler'
|
File without changes
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
require 'spec_helper'
|
10
|
+
require 'logger'
|
11
|
+
|
12
|
+
context 'OpenSearch client with security plugin enabled' do
|
13
|
+
let(:logger) { Logger.new($stderr) }
|
14
|
+
|
15
|
+
let(:client) do
|
16
|
+
OpenSearch::Client.new(
|
17
|
+
host: OPENSEARCH_URL,
|
18
|
+
logger: logger,
|
19
|
+
transport_options: { ssl: { verify: false } }
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'Integrates with opensearch API' do
|
24
|
+
it 'should perform the API methods' do
|
25
|
+
expect do
|
26
|
+
# Index a document
|
27
|
+
client.index(index: 'test-index', id: '1', body: { title: 'Test' })
|
28
|
+
|
29
|
+
# Refresh the index
|
30
|
+
client.indices.refresh(index: 'test-index')
|
31
|
+
|
32
|
+
# Search
|
33
|
+
response = client.search(index: 'test-index', body: { query: { match: { title: 'test' } } })
|
34
|
+
|
35
|
+
expect(response['hits']['total']['value']).to eq 1
|
36
|
+
expect(response['hits']['hits'][0]['_source']['title']).to eq 'Test'
|
37
|
+
|
38
|
+
# Delete the index
|
39
|
+
client.indices.delete(index: 'test-index')
|
40
|
+
end.not_to raise_error
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
require 'spec_helper'
|
27
|
+
require 'logger'
|
28
|
+
|
29
|
+
describe 'OpenSearch validation integration with security plugin enabled' do
|
30
|
+
it 'Validates for OpenSearch' do
|
31
|
+
client = OpenSearch::Client.new(
|
32
|
+
host: OPENSEARCH_URL,
|
33
|
+
logger: Logger.new($stderr),
|
34
|
+
transport_options: { ssl: { verify: false } }
|
35
|
+
)
|
36
|
+
expect(client.instance_variable_get('@verified')).to be false
|
37
|
+
client.count
|
38
|
+
expect(client.instance_variable_get('@verified')).to be true
|
39
|
+
end
|
40
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opensearch-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jayesh Hathila
|
@@ -33,20 +33,20 @@ cert_chain:
|
|
33
33
|
yXikuH6LEVykA8pgOcB9gKsB2/zMd2ZlSj2monM8Qw9EfB14ZSDTYS8VYuwWCeF0
|
34
34
|
eFmXXk0ufQFKl1Yll7quHkmQ0PzKkvXTpONBT6qPkXE=
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
36
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: opensearch-transport
|
40
40
|
requirement: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 1.0.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- -
|
49
|
+
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: 1.0.0
|
52
52
|
- !ruby/object:Gem::Dependency
|
@@ -228,8 +228,10 @@ files:
|
|
228
228
|
- lib/opensearch.rb
|
229
229
|
- lib/opensearch/version.rb
|
230
230
|
- opensearch.gemspec
|
231
|
-
- spec/integration/client_integration_spec.rb
|
232
|
-
- spec/integration/validation_integration_spec.rb
|
231
|
+
- spec/integration/security_disabled/client_integration_spec.rb
|
232
|
+
- spec/integration/security_disabled/validation_integration_spec.rb
|
233
|
+
- spec/integration/security_enabled/client_integration_spec.rb
|
234
|
+
- spec/integration/security_enabled/validation_integration_spec.rb
|
233
235
|
- spec/spec_helper.rb
|
234
236
|
- spec/unit/opensearch_product_validation_spec.rb
|
235
237
|
- spec/unit/wrapper_gem_spec.rb
|
@@ -261,8 +263,10 @@ signing_key:
|
|
261
263
|
specification_version: 4
|
262
264
|
summary: Ruby integrations for OpenSearch
|
263
265
|
test_files:
|
264
|
-
- spec/integration/client_integration_spec.rb
|
265
|
-
- spec/integration/validation_integration_spec.rb
|
266
|
+
- spec/integration/security_disabled/client_integration_spec.rb
|
267
|
+
- spec/integration/security_disabled/validation_integration_spec.rb
|
268
|
+
- spec/integration/security_enabled/client_integration_spec.rb
|
269
|
+
- spec/integration/security_enabled/validation_integration_spec.rb
|
266
270
|
- spec/spec_helper.rb
|
267
271
|
- spec/unit/opensearch_product_validation_spec.rb
|
268
272
|
- spec/unit/wrapper_gem_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|