You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I think I found an issue with configuring a KtorRestClient using the elasticApiKey parameter. I think this parameter is ignored because my resulting queries don't have any security header like "Authorization"-> "ApiKey xxxx"
When running a query to my Elasticsearch instance, I run into this error:
When debugging into the kt-search code, I see that no header are present:
If at that point, I manually add the "Authorization"-> "ApiKey xxxx" header in the debugger, then the query works fine.
To Reproduce
Here how to reproduce the problem locally:
Run a local instance of Elasticsearch configured with an API key using docker. You can do that easily by running this command: curl -fsSL https://elastic.co/start-local | sh (more info here)
Run this kotlin snippet using the API key that appeared in your env file after executing the previous script:
Hey, thanks for reporting. I recently got a report from somebody else related to this. I'll see if I can address this soon. For now, either use basic authentication or indeed do what you are currently doing as a workaround.
Describe the bug
Hello. I think I found an issue with configuring a KtorRestClient using the
elasticApiKey
parameter. I think this parameter is ignored because my resulting queries don't have any security header like"Authorization"-> "ApiKey xxxx"
When running a query to my Elasticsearch instance, I run into this error:
When debugging into the
kt-search
code, I see that no header are present:If at that point, I manually add the
"Authorization"-> "ApiKey xxxx"
header in the debugger, then the query works fine.To Reproduce
Here how to reproduce the problem locally:
curl -fsSL https://elastic.co/start-local | sh
(more info here)Expected behavior
No error about security should be raised from the previous snippet
Your context
I am adding my snippet project with IntelliJ if you want to bootstrap faster:
KtSearchTest.zip
libs:
Will you be able to help with a pull request?
Optional of course, but do let me know if you plan to do work.
The text was updated successfully, but these errors were encountered: