Skip to content

Commit 72f0a95

Browse files
authored
fix verify with auth params (#10)
1 parent 894f4e2 commit 72f0a95

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ElasticsearchClient"
22
uuid = "e586a49d-aa29-4ce5-8f91-fa4f824367bd"
33
authors = ["Egor Shmorgun <egor.shmorgun@opensesame.com>"]
4-
version = "0.2.7"
4+
version = "0.2.8"
55

66
[deps]
77
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"

src/elastic_transport/client.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ function Client(;http_client::Module=HTTP, kwargs...)
8282
)
8383
end
8484

85-
function verify_elasticsearch(client::Client)
85+
function verify_elasticsearch(client::Client; auth_params=nothing)
8686
response = nothing
8787
try
88-
response = elastisearch_validation_request(client)
88+
response = elastisearch_validation_request(client, auth_params=auth_params)
8989
catch exc
9090
if typeof(exc) in [Forbidden, Unauthorized, RequestEntityTooLarge]
9191
client.verified = true
@@ -109,8 +109,8 @@ function verify_with_version_and_headers(client::Client, _headers, _version)
109109
client.verified = true
110110
end
111111

112-
function elastisearch_validation_request(client::Client)
113-
@mock perform_request(client.transport, "GET", "/")
112+
function elastisearch_validation_request(client::Client; auth_params=nothing)
113+
@mock perform_request(client.transport, "GET", "/", auth_params=auth_params)
114114
end
115115

116116
"""
@@ -141,7 +141,7 @@ function perform_request(
141141
end
142142

143143
if !client.verified
144-
verify_elasticsearch(client)
144+
verify_elasticsearch(client, auth_params=auth_params)
145145
end
146146

147147
@mock perform_request(

0 commit comments

Comments
 (0)