use of org.apache.nifi.controller.cluster.ZooKeeperClientConfig in project nifi by apache.
the class TestCuratorACLProviderFactory method testSaslAuthSchemeWithHostNoRealm.
@Test
public void testSaslAuthSchemeWithHostNoRealm() {
final NiFiProperties nifiProperties;
final CuratorACLProviderFactory factory;
otherProps.put("nifi.zookeeper.kerberos.removeHostFromPrincipal", "false");
otherProps.put("nifi.zookeeper.kerberos.removeRealmFromPrincipal", "true");
nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, otherProps);
factory = new CuratorACLProviderFactory();
ZooKeeperClientConfig config = ZooKeeperClientConfig.createConfig(nifiProperties);
ACLProvider provider = factory.create(config);
assertFalse(provider instanceof DefaultACLProvider);
List<ACL> acls = provider.getDefaultAcl();
assertNotNull(acls);
assertEquals(acls.get(0).getId().toString().trim(), "'sasl,'nifi/host");
}
use of org.apache.nifi.controller.cluster.ZooKeeperClientConfig in project nifi by apache.
the class TestCuratorACLProviderFactory method testSaslAuthSchemeNoHostNoRealm.
@Test
public void testSaslAuthSchemeNoHostNoRealm() {
final NiFiProperties nifiProperties;
final CuratorACLProviderFactory factory;
otherProps.put("nifi.zookeeper.kerberos.removeHostFromPrincipal", "true");
otherProps.put("nifi.zookeeper.kerberos.removeRealmFromPrincipal", "true");
nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, otherProps);
factory = new CuratorACLProviderFactory();
ZooKeeperClientConfig config = ZooKeeperClientConfig.createConfig(nifiProperties);
ACLProvider provider = factory.create(config);
assertFalse(provider instanceof DefaultACLProvider);
List<ACL> acls = provider.getDefaultAcl();
assertNotNull(acls);
assertEquals(acls.get(0).getId().toString().trim(), "'sasl,'nifi");
}
use of org.apache.nifi.controller.cluster.ZooKeeperClientConfig in project nifi by apache.
the class TestCuratorACLProviderFactory method testSaslAuthSchemeHeadless.
@Test
public void testSaslAuthSchemeHeadless() {
final NiFiProperties nifiProperties;
final CuratorACLProviderFactory factory;
otherProps.put("nifi.zookeeper.kerberos.removeHostFromPrincipal", "true");
otherProps.put("nifi.zookeeper.kerberos.removeRealmFromPrincipal", "true");
otherProps.put("nifi.kerberos.service.principal", "nifi@REALM.COM");
nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, otherProps);
factory = new CuratorACLProviderFactory();
ZooKeeperClientConfig config = ZooKeeperClientConfig.createConfig(nifiProperties);
ACLProvider provider = factory.create(config);
assertFalse(provider instanceof DefaultACLProvider);
List<ACL> acls = provider.getDefaultAcl();
assertNotNull(acls);
assertEquals(acls.get(0).getId().toString().trim(), "'sasl,'nifi");
}
use of org.apache.nifi.controller.cluster.ZooKeeperClientConfig in project nifi by apache.
the class TestCuratorACLProviderFactory method testSaslAuthSchemeNoHostWithRealm.
@Test
public void testSaslAuthSchemeNoHostWithRealm() {
final NiFiProperties nifiProperties;
final CuratorACLProviderFactory factory;
otherProps.put("nifi.zookeeper.kerberos.removeHostFromPrincipal", "true");
otherProps.put("nifi.zookeeper.kerberos.removeRealmFromPrincipal", "false");
nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, otherProps);
factory = new CuratorACLProviderFactory();
ZooKeeperClientConfig config = ZooKeeperClientConfig.createConfig(nifiProperties);
ACLProvider provider = factory.create(config);
assertFalse(provider instanceof DefaultACLProvider);
List<ACL> acls = provider.getDefaultAcl();
assertNotNull(acls);
assertEquals(acls.get(0).getId().toString().trim(), "'sasl,'nifi@REALM.COM");
}
Aggregations