Skip to content

Commit

Permalink
chore(plugin): built with kafka 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
royantman authored Mar 22, 2020
2 parents 12f2032 + 92aa016 commit 3a5757d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.okro.kafka</groupId>
<artifactId>kafka-spiffe-principal</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
<build>
<plugins>
<plugin>
Expand All @@ -23,8 +23,8 @@
<dependencies>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
<version>1.1.1</version>
<artifactId>kafka_2.13</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/io.okro.kafka/SpiffePrincipalBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.apache.kafka.common.security.auth.KafkaPrincipal;
import org.apache.kafka.common.security.auth.PlaintextAuthenticationContext;
import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.auth.SslAuthenticationContext;
import org.junit.Test;

Expand Down Expand Up @@ -31,7 +32,7 @@ private SslAuthenticationContext mockedSslContext(String certPath) throws Certif
// mock ssl session
SSLSession session = mock(SSLSession.class);
when(session.getPeerCertificates()).thenReturn(new Certificate[]{cert});
return new SslAuthenticationContext(session, InetAddress.getLocalHost());
return new SslAuthenticationContext(session, InetAddress.getLocalHost(), SecurityProtocol.SSL.name());
}

/**
Expand Down Expand Up @@ -79,7 +80,7 @@ public void TestSanNoSpiffeCert() throws CertificateException, SSLPeerUnverified
*/
@Test
public void TestNoSSLContext() throws java.net.UnknownHostException {
PlaintextAuthenticationContext context = new PlaintextAuthenticationContext(InetAddress.getLocalHost());
PlaintextAuthenticationContext context = new PlaintextAuthenticationContext(InetAddress.getLocalHost(), SecurityProtocol.SSL.name());
KafkaPrincipal principal = new SpiffePrincipalBuilder().build(context);

assertEquals(KafkaPrincipal.ANONYMOUS, principal);
Expand Down

0 comments on commit 3a5757d

Please sign in to comment.