elasticsearch-api 8.5.1 → 8.5.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83bd8be41d9f67d39e9cdb030e2ea2286c08bc4fbcdcf23db15a85a533e4f954
|
4
|
+
data.tar.gz: d4185c7fca5cb11fce5da43e36ebc44ab27086eb4c62a26541baa5414478fed0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dda71b331ae5d4b5aa01a4871cb0495961117332a7f72c8dc96143922402fbaef942c921f950ff373ca5e2a82e2a8ad2a86dc6a27db49ee10be73982ce1cc0a
|
7
|
+
data.tar.gz: 3c72b61e3baaacee6abffc54b50da5c0bcda47e3ffd1669f9c0623343294b1025f63de6f13b815a73ccf30a842098b80f9756b2efd0c96ba5fc090f920cd800d
|
@@ -47,7 +47,7 @@ module Elasticsearch
|
|
47
47
|
|
48
48
|
_name = arguments.delete(:name)
|
49
49
|
|
50
|
-
method = Elasticsearch::API::HTTP_PUT
|
50
|
+
method = _name ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST
|
51
51
|
path = if _namespace && _service && _name
|
52
52
|
"_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}"
|
53
53
|
else
|
@@ -18,16 +18,31 @@
|
|
18
18
|
require 'spec_helper'
|
19
19
|
|
20
20
|
describe 'client#security#create_service_token' do
|
21
|
+
let(:expected_path) { '_security/service/foo/bar/credential/token' }
|
22
|
+
let(:expected_request_method) { 'POST' }
|
21
23
|
let(:expected_args) do
|
22
24
|
[
|
23
|
-
|
24
|
-
|
25
|
+
expected_request_method,
|
26
|
+
expected_path,
|
25
27
|
{},
|
26
28
|
nil,
|
27
29
|
{}
|
28
30
|
]
|
29
31
|
end
|
30
32
|
|
33
|
+
context 'with token name' do
|
34
|
+
let(:expected_request_method) { 'PUT' }
|
35
|
+
let(:token_name) { 'test-token' }
|
36
|
+
let(:expected_path) { "#{super()}/#{token_name}" }
|
37
|
+
it 'performs the request' do
|
38
|
+
expect(
|
39
|
+
client_double.security.create_service_token(
|
40
|
+
namespace: 'foo', service: 'bar', name: token_name
|
41
|
+
)
|
42
|
+
).to be_a Elasticsearch::API::Response
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
31
46
|
it 'performs the request' do
|
32
47
|
expect(
|
33
48
|
client_double.security.create_service_token(
|
@@ -171,6 +171,7 @@ module Elasticsearch
|
|
171
171
|
|
172
172
|
def __http_method
|
173
173
|
return '_id ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @endpoint_name == 'index'
|
174
|
+
return '_name ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @method_name == 'create_service_token'
|
174
175
|
return post_and_get if @endpoint_name == 'count'
|
175
176
|
|
176
177
|
default_method = @spec['url']['paths'].map { |a| a['methods'] }.flatten.first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.5.
|
4
|
+
version: 8.5.2
|
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-11-
|
11
|
+
date: 2022-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|