Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API - missing Elasticsearch plain text authentication #1668

Closed
cozydvlpr opened this issue Dec 6, 2023 · 3 comments
Closed

API - missing Elasticsearch plain text authentication #1668

cozydvlpr opened this issue Dec 6, 2023 · 3 comments

Comments

@cozydvlpr
Copy link

cozydvlpr commented Dec 6, 2023

Hi,

I want to install the Pelias project on my infrastructure. However, a full fledged Elasticsearch cluster is already available so I don't need to start a container for it. Looking at the documentation first and to the code afterwards, I did not see any option to specify the authentication. The cluster I use allows only authenticated requests.
Is it possible to add authentication to the configuration of the ES client?

Ideally after the change, it should be possible to specify the configuration like this

"esclient": {
  "hosts":[{
       "host":"my cluster.mycompany.com",
       "user": "randomUser",
       "password": "password"
      }]
}

Another option would be to store the credentials in env variables and have the possibility of using a place holder in the config file.

Thanks!

@missinglink
Copy link
Member

It should be possible using the syntax described here:
https://www.elastic.co/guide/en/elasticsearch/client/elasticsearch-js/16.x/_basic_auth.html

@missinglink
Copy link
Member

missinglink commented Dec 6, 2023

Note that the value of the esclient property in the Pelias config is passed to the constructor of the elasticsearch client verbatim.

@cozydvlpr
Copy link
Author

It worked as you described, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants