forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#38004 from ozangunalp/fix_kafka_sasl_ely…
…tron Avoid integration-tests/kafka-sasl-elytron to modify test resources
- Loading branch information
Showing
3 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ quarkus.log.category.\"org.apache.zookeeper\".level=WARN | |
|
||
mp.messaging.connector.smallrye-kafka.security.protocol=SASL_PLAINTEXT | ||
mp.messaging.connector.smallrye-kafka.sasl.mechanism=GSSAPI | ||
mp.messaging.connector.smallrye-kafka.sasl.jaas.config=com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true debug=true serviceName="kafka" keyTab="src/test/resources/client.keytab" principal="client/[email protected]"; | ||
mp.messaging.connector.smallrye-kafka.sasl.jaas.config=com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true debug=true serviceName="kafka" keyTab="target/client.keytab" principal="client/[email protected]"; | ||
mp.messaging.connector.smallrye-kafka.sasl.kerberos.service.name=kafka | ||
mp.messaging.connector.smallrye-kafka.ssl.endpoint.identification.algorithm=https | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
import java.time.Duration; | ||
import java.util.stream.Collectors; | ||
|
||
import org.testcontainers.containers.BindMode; | ||
import org.testcontainers.containers.GenericContainer; | ||
import org.testcontainers.containers.Network; | ||
import org.testcontainers.containers.wait.strategy.Wait; | ||
|
@@ -21,21 +20,23 @@ public KerberosContainer(String dockerImageName) { | |
withEnv("KRB5_KDC", "localhost"); | ||
withEnv("KRB5_PASS", "mypass"); | ||
withExposedPorts(749, 464, 88); | ||
withFileSystemBind("src/test/resources/kafkabroker.keytab", "/tmp/keytab/kafkabroker.keytab", BindMode.READ_WRITE); | ||
withFileSystemBind("src/test/resources/client.keytab", "/tmp/keytab/client.keytab", BindMode.READ_WRITE); | ||
waitingFor(Wait.forLogMessage("Principal \"admin/[email protected]\" created.*", 1)); | ||
waitingFor(Wait.forListeningPorts(88)); | ||
withNetwork(Network.SHARED); | ||
withNetworkAliases("kerberos"); | ||
} | ||
|
||
public void createTestPrincipals() { | ||
try { | ||
ExecResult lsResult = execInContainer("kadmin.local", "-q", "addprinc -randkey kafka/[email protected]"); | ||
ExecResult lsResult = execInContainer("kadmin.local", "-q", | ||
"addprinc -randkey kafka/[email protected]"); | ||
lsResult = execInContainer("kadmin.local", "-q", | ||
"ktadd -norandkey -k /tmp/keytab/kafkabroker.keytab kafka/[email protected]"); | ||
lsResult = execInContainer("kadmin.local", "-q", "addprinc -randkey client/[email protected]"); | ||
"ktadd -norandkey -k /kafkabroker.keytab kafka/[email protected]"); | ||
lsResult = execInContainer("kadmin.local", "-q", | ||
"ktadd -norandkey -k /tmp/keytab/client.keytab client/[email protected]"); | ||
"addprinc -randkey client/[email protected]"); | ||
lsResult = execInContainer("kadmin.local", "-q", | ||
"ktadd -norandkey -k /client.keytab client/[email protected]"); | ||
copyFileFromContainer("/kafkabroker.keytab", "target/kafkabroker.keytab"); | ||
copyFileFromContainer("/client.keytab", "target/client.keytab"); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|