[
https://issues.apache.org/jira/browse/BEAM-14000?focusedWorklogId=761032&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-761032
]
ASF GitHub Bot logged work on BEAM-14000:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Apr/22 19:06
Start Date: 22/Apr/22 19:06
Worklog Time Spent: 10m
Work Description: egalpin commented on code in PR #17297:
URL: https://github.com/apache/beam/pull/17297#discussion_r856498752
##########
sdks/java/io/elasticsearch-tests/elasticsearch-tests-common/src/test/java/org/apache/beam/sdk/io/elasticsearch/ElasticsearchIOTestCommon.java:
##########
@@ -1229,4 +1230,16 @@ void testWriteWithIsDeletedFnWithoutPartialUpdate()
throws Exception {
assertEquals(numDocs / 2, currentNumDocs);
assertEquals(0, countByScientistName(connectionConfiguration, restClient,
"Darwin", null));
}
+
+ void testValidSSLAndUsernameConfiguration(String filePath) throws Exception {
+ ConnectionConfiguration configWithSsl =
+ connectionConfiguration
+ .withUsername("username")
+ .withPassword("password")
+ .withKeystorePassword("qwerty")
+ .withKeystorePath(filePath);
+
+ RestClient restClient = configWithSsl.createClient();
+ Assert.assertNotNull("rest client should not be null", restClient);
Review Comment:
can you add assertions to verify that the `setHttpClientConfigCallback` is
as expected? I think that assertion is one that would have failed prior to your
changes, and will pass now i.e. validates that your change fixes a preexisting
issue. After that this looks good to merge!
Issue Time Tracking
-------------------
Worklog Id: (was: 761032)
Time Spent: 2h 10m (was: 2h)
> Elastic search IO doesnot work when both username/password and keystore are
> used
> --------------------------------------------------------------------------------
>
> Key: BEAM-14000
> URL: https://issues.apache.org/jira/browse/BEAM-14000
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: nishant jain
> Priority: P2
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> When using both username/password and ssl keystore, ElasticSearchIO doesnot
> Create correct restclient.
>
> Firstly, it sets HttpClientConfigCallback using httpAsyncClientBuilder if
> username and passowrd is used. Afterwards, it will replace
> HttpClientConfigCallback to httpClientBuilder is ssl store is used, hence
> losing the credentials provider
--
This message was sent by Atlassian Jira
(v8.20.7#820007)