From 5259ea754b077d792f794036023be53d6c2a0573 Mon Sep 17 00:00:00 2001 From: Egor Shmorgun Date: Mon, 31 Jul 2023 17:48:59 +0300 Subject: [PATCH] fix verify with auth params --- Project.toml | 2 +- src/elastic_transport/client.jl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 215225f..c4c9556 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ElasticsearchClient" uuid = "e586a49d-aa29-4ce5-8f91-fa4f824367bd" authors = ["Egor Shmorgun "] -version = "0.2.7" +version = "0.2.8" [deps] CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" diff --git a/src/elastic_transport/client.jl b/src/elastic_transport/client.jl index ea26ede..c28ab84 100644 --- a/src/elastic_transport/client.jl +++ b/src/elastic_transport/client.jl @@ -82,10 +82,10 @@ function Client(;http_client::Module=HTTP, kwargs...) ) end -function verify_elasticsearch(client::Client) +function verify_elasticsearch(client::Client; auth_params=nothing) response = nothing try - response = elastisearch_validation_request(client) + response = elastisearch_validation_request(client, auth_params=auth_params) catch exc if typeof(exc) in [Forbidden, Unauthorized, RequestEntityTooLarge] client.verified = true @@ -109,8 +109,8 @@ function verify_with_version_and_headers(client::Client, _headers, _version) client.verified = true end -function elastisearch_validation_request(client::Client) - @mock perform_request(client.transport, "GET", "/") +function elastisearch_validation_request(client::Client; auth_params=nothing) + @mock perform_request(client.transport, "GET", "/", auth_params=auth_params) end """ @@ -141,7 +141,7 @@ function perform_request( end if !client.verified - verify_elasticsearch(client) + verify_elasticsearch(client, auth_params=auth_params) end @mock perform_request(