Supporting basic authentication for Elasticsearch connector#1838
Supporting basic authentication for Elasticsearch connector#1838mobini-majid wants to merge 1 commit intotrinodb:masterfrom
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@prestosql.io. For more information, see https://github.com/prestosql/cla. |
martint
left a comment
There was a problem hiding this comment.
Thanks for implementing this! I have a few comments about naming and how to better structure the change.
Also, please make sure to submit a signed CLA so we can merge it: https://github.com/prestosql/cla
|
|
||
| private String host; | ||
| private int port = 9200; | ||
| private String username; |
There was a problem hiding this comment.
Let's put these in a separate config similar to how we handle io.prestosql.elasticsearch.AwsSecurityConfig
| .setMaxRetryTimeoutMillis((int) config.getMaxRetryTime().toMillis()); | ||
|
|
||
| builder.setHttpClientConfigCallback(clientBuilder -> { | ||
| if (config.getSecurity().isPresent()) { |
There was a problem hiding this comment.
Once you move the configs to a separate object similar to AwsSecurityConfig, we'll need an additional Optional<XPackSecurityConfig> argument to this method and this check will need to be adjusted.
| .. _full text query: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax | ||
|
|
||
|
|
||
| X-Pack Authentication |
There was a problem hiding this comment.
We should this to "Password Authentication". X-Pack is a plugin framework for Elasticsearch. From the point of view of Presto, this is about using simple user/password scheme to authenticate with ES.
|
Superseded by #4165 |
Starting from elasticsearch 7.x.x, basic authentication using username and password is supported through its x-pack.
In this pull request, if the user set
elasticsearch.securitytoX_PACK(instead ofAWS), he's able to connect to a secured elastic search by settingelasticsearch.usernameandelasticsearch.passwordvariables in catalog file.You can bring up a secured elasticsearch like this and test it if needed.