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

Add missing metadata for kafka client sasl scram mechanism #511

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(kafka-clients-3.5.1): SaslScram with SHA-512 mechanism test added
Signed-off-by: Simone Pulcini <simone.pulcini@gmail.com>
  • Loading branch information
spulci committed Jul 5, 2024
commit 1e75c0c965a6ebc933295a0b5467e476c1d122c1
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,18 @@ void testSaslPlain() {
}
}

@Test
void testSaslScramSHA512() {
Map<String, Object> consumerProperties = new HashMap<>();
consumerProperties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, KAFKA_SERVER);
consumerProperties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, IntegerDeserializer.class);
consumerProperties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
consumerProperties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_SSL");
consumerProperties.put(SaslConfigs.SASL_MECHANISM, "SCRAM-SHA-512");
consumerProperties.put(SaslConfigs.SASL_JAAS_CONFIG, "org.apache.kafka.common.security.scram.ScramLoginModule required username=admin password=admin-pass;");
try (KafkaConsumer consumer = new KafkaConsumer<>(consumerProperties)) {
assertThat(consumer).isNotNull();
}
}

}