Skip to content

Commit

Permalink
BE: RBAC: Support LDAPS for AD
Browse files Browse the repository at this point in the history
fix sonar issues
  • Loading branch information
wernerdv committed Feb 13, 2025
1 parent 4b729e0 commit d99758b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions api/src/test/java/io/kafbat/ui/ActiveDirectoryLdapsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
public class ActiveDirectoryLdapsTest extends AbstractActiveDirectoryIntegrationTest {
private static final ActiveDirectoryContainer ACTIVE_DIRECTORY = new ActiveDirectoryContainer(true);

private static File CERT_PEM = null;
private static File PRIVATE_KEY_PEM = null;
private static File certPem = null;
private static File privateKeyPem = null;

@BeforeAll
public static void setup() throws Exception {
generateCerts();

ACTIVE_DIRECTORY.withCopyFileToContainer(forHostPath(CERT_PEM.getAbsolutePath()), CONTAINER_CERT_PATH);
ACTIVE_DIRECTORY.withCopyFileToContainer(forHostPath(PRIVATE_KEY_PEM.getAbsolutePath()), CONTAINER_KEY_PATH);
ACTIVE_DIRECTORY.withCopyFileToContainer(forHostPath(certPem.getAbsolutePath()), CONTAINER_CERT_PATH);
ACTIVE_DIRECTORY.withCopyFileToContainer(forHostPath(privateKeyPem.getAbsolutePath()), CONTAINER_KEY_PATH);

ACTIVE_DIRECTORY.start();
}
Expand All @@ -66,13 +66,13 @@ private static void generateCerts() throws Exception {

TestSslUtils.createTrustStore(truststore.getPath(), new Password(PASSWORD), Map.of("client", clientCert));

CERT_PEM = File.createTempFile("cert", ".pem");
try (FileWriter fw = new FileWriter(CERT_PEM)) {
certPem = File.createTempFile("cert", ".pem");
try (FileWriter fw = new FileWriter(certPem)) {
fw.write(certOrKeyToString(clientCert));
}

PRIVATE_KEY_PEM = File.createTempFile("key", ".pem");
try (FileWriter fw = new FileWriter(PRIVATE_KEY_PEM)) {
privateKeyPem = File.createTempFile("key", ".pem");
try (FileWriter fw = new FileWriter(privateKeyPem)) {
fw.write(certOrKeyToString(clientKeyPair.getPrivate()));
}
}
Expand Down

0 comments on commit d99758b

Please sign in to comment.