You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/09/04 17:21:06 UTC
[GitHub] himanshug commented on a change in pull request #6285: Securing
passwords used for SSL connections to Kafka
himanshug commented on a change in pull request #6285: Securing passwords used for SSL connections to Kafka
URL: https://github.com/apache/incubator-druid/pull/6285#discussion_r214998491
##########
File path: extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/KafkaIndexTask.java
##########
@@ -282,24 +289,36 @@ StreamAppenderatorDriver newDriver(
);
}
- KafkaConsumer<byte[], byte[]> newConsumer()
+ KafkaConsumer<byte[], byte[]> newConsumer() throws IOException
{
ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- final Properties props = new Properties();
-
- for (Map.Entry<String, String> entry : ioConfig.getConsumerProperties().entrySet()) {
- props.setProperty(entry.getKey(), entry.getValue());
+ final Map<String, Object> configs = new HashMap<>();
+
+ // Extract passwords before SSL connection to Kafka
+ for (Map.Entry<String, Object> entry : ioConfig.getConsumerProperties().entrySet()) {
+ String propertyKey = entry.getKey();
+ if (propertyKey.equals(KafkaSupervisorIOConfig.TRUST_STORE_PASSWORD_KEY)
+ || propertyKey.equals(KafkaSupervisorIOConfig.KEY_STORE_PASSWORD_KEY)
+ || propertyKey.equals(KafkaSupervisorIOConfig.KEY_PASSWORD_KEY)) {
+ PasswordProvider configPasswordProvider = configMapper.readValue(
+ configMapper.writeValueAsString(entry.getValue()),
Review comment:
can we not directly convert the `Object` to `PasswordProvider` ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org