Skip to content

Commit

Permalink
Added Athenz class and jar file
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kjerrumgaard committed Mar 8, 2019
1 parent 3df6642 commit 27a8f35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions nifi-pulsar-client-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-client-auth-athenz</artifactId>
<version>${pulsar.version}</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-pulsar-client-service-api</artifactId>
Expand All @@ -43,11 +48,6 @@
<version>1.9.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-ssl-context-service-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mock</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.pulsar.client.api.Authentication;
import org.apache.pulsar.client.api.AuthenticationFactory;
import org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException;
import org.apache.pulsar.client.impl.auth.AuthenticationAthenz;

// import org.apache.pulsar.client.impl.auth.AuthenticationAthenz;

/**
* https://pulsar.apache.org/docs/en/security-athenz/
Expand Down Expand Up @@ -96,7 +97,6 @@ protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
@Override
public Authentication getAuthentication() {
Map<String, String> authParams = new HashMap<>();
// TODO Define constants for these keys
authParams.put("tenantDomain", configContext.getProperty(TENANT_DOMAIN).getValue());
authParams.put("tenantService", configContext.getProperty(TENANT_SERVICE).getValue());
authParams.put("providerDomain", configContext.getProperty(PROVIDER_DOMAIN).getValue());
Expand All @@ -106,9 +106,12 @@ public Authentication getAuthentication() {
authParams.put("keyId", configContext.getProperty(TENANT_PRIVATE_KEY_ID).getValue());
}

// return AuthenticationFactory.create(AuthenticationAthenz.class.getName(), authParams);

return null;
try {
return AuthenticationFactory.create(AuthenticationAthenz.class.getName(), authParams);
} catch (UnsupportedAuthenticationException e) {
getLogger().error("Unable to authenticate", e);
return null;
}
}

}

0 comments on commit 27a8f35

Please sign in to comment.