I need to setup user:password authentication for clients accessing data inside zookeeper server. I'm experimenting with zkCli and Curator Framework to figure out how this works and for some reason the code executed from Curator Framework bypasses all the security settings and behaves as it has full access rights, when it shouldn't have them.
I've been following the answers to those questions:
How to access a protected znode from ZooKeeper using zkCli?
zkCli:
[zk: localhost:7999(CONNECTED) 29] create /testpath contents digest:user:smGaoVKd/cQkjm7b88GyorAUz20=:cdrwa
Created /testpath
[zk: localhost:7999(CONNECTED) 4] getAcl /testpath
'digest,'user:smGaoVKd/cQkjm7b88GyorAUz20=
: cdrwa
[zk: localhost:7999(CONNECTED) 30] rmr /testpath
Authentication is not valid : /testpath
[zk: localhost:7999(CONNECTED) 31]
The above result is as expected, we added ACL restrictions and now we can't access the created node. However when I'm trying to access this node with Curator Framework it deletes it, but it shouldn't.
String zkConnectString = "hostname:7999";
RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
CuratorFramework client = CuratorFrameworkFactory.builder()
.connectString(zkConnectString)
.retryPolicy(retryPolicy)
.build();
client.start();
try {
client.delete().forPath("/testpath");
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
So the java Curator Framework code deletes the node successfully instead of giving any authentication errors. What am I doing wrong?
product versions:
Curator Framework: 2.11.1
Zookeeper server: 3.4.5
Zookeeper java client: 3.4.12