zabetak commented on code in PR #4430:
URL: https://github.com/apache/hive/pull/4430#discussion_r1238646465
##########
kafka-handler/src/test/org/apache/hadoop/hive/kafka/KafkaDagCredentialSupplierTest.java:
##########
@@ -75,13 +93,39 @@ public static void stopCluster() {
}
@Test
- public void testObtainTokenNotNull() {
+ public void testObtainTokenFromSamlPlainTextListenerNotNull() {
+ Properties props = new Properties();
+ props.setProperty("kafka.bootstrap.servers",
KafkaBrokerResource.BROKER_SASL_PORT);
+ checkObtainToken(props);
+ }
+
+ @Test
+ public void testObtainTokenFromSamlSslListenerNotNull()
+ throws IOException, URISyntaxException, KeyStoreException,
CertificateException, NoSuchAlgorithmException {
+ Properties props = new Properties();
+
props.setProperty(KafkaTableProperties.HIVE_KAFKA_BOOTSTRAP_SERVERS.getName(),
+ KafkaBrokerResource.BROKER_SASL_SSL_PORT);
+ // Should the SSL properties be divided between producer/consumer?
Probably not!
+ props.setProperty(SECURITY_PROTOCOL_CONFIG,
SecurityProtocol.SASL_SSL.name);
+ props.setProperty(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG,
"");
+ String pwdAlias = "HereIsAnAliasForTheKeyWhichHoldsTheTrustorePassword";
+ URI storeURI = createCredentialStore(ImmutableMap.of(pwdAlias,
KAFKA_BROKER_RESOURCE.getTruststorePwd()));
+
props.setProperty(KafkaTableProperties.HIVE_KAFKA_SSL_CREDENTIAL_KEYSTORE.getName(),
storeURI.toString());
+
props.setProperty(KafkaTableProperties.HIVE_KAFKA_SSL_TRUSTSTORE_PASSWORD.getName(),
pwdAlias);
+
props.setProperty(KafkaTableProperties.HIVE_KAFKA_SSL_KEYSTORE_PASSWORD.getName(),
"");
+
props.setProperty(KafkaTableProperties.HIVE_KAFKA_SSL_KEY_PASSWORD.getName(),
"");
+ String location =
KAFKA_BROKER_RESOURCE.getTruststorePath().toUri().toString();
Review Comment:
Fixed in
https://github.com/apache/hive/pull/4430/commits/6c2e197abbd34f508774836dc52731b196b95cc3
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]