zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ludwig Pummer <ludwigp-zookee...@chip-web.com>
Subject Re: digest ACL znodes always return ZNOAUTH (zkCLi and perl)
Date Tue, 24 Jan 2012 04:18:50 GMT
I used the doc's 2 lines of code to generate the digest.

$ perl -MMIME::Base64 -MDigest -e 'print 
MIME::Base64::encode(Digest->new("SHA-1")->add("user:pass")->digest());'
smGaoVKd/cQkjm7b88GyorAUz20=

That matches the output below, but it makes sense since I *set* that? 
What other digest value is there to compare it to?

I have no way to see what is the digest generated by ZooKeeper on 
addauth, do I?

What's the digest acl syntax in zkCLI?

On 1/23/2012 12:49 PM, Patrick Hunt wrote:
> I'm not super familiar with the perl bindings - did you try what's
> documented/detailed in the perl docs?
> http://search.cpan.org/~cdarroch/Net-ZooKeeper-0.35/ZooKeeper.pm#Access_Control
>
> Did you compare the two base 64 encoded digests?
>
> Patrick
>
> On Mon, Jan 23, 2012 at 1:00 AM, Ludwig Pummer
> <ludwigp-zookeeper@chip-web.com>  wrote:
>> Hello,
>>
>> I'm just getting started with ZooKeeper and am having very little luck with
>> digest ACLs.
>>
>> I couldn't figure out the syntax for creating digest acls from zkCli (create
>> nor setAcl), but I did manage to set ACLs on nodes using the perl bindings.
>>
>> However, I cannot read the node back.
>>
>> "addauth digest user:pass" in zkCLI is accepted, but the subsequent get
>> results in a KeeperException$NoAuthException.
>>
>>  From the perl binding (Net::ZooKeeper 0.35), get always returns -102
>> (ZNOAUTH).
>>
>> I'm running zookeeper 3.3.4.
>>
>> -----
>>
>> $ ./acltest1.pl
>> add_auth ok
>> created path /acl0000000028 with acl
>> node /acl0000000028 get error: -102
>> node /acl0000000028 has stat info:
>>   czxid: 230
>>   mzxid: 230
>>   ctime: 1327308018904
>>   mtime: 1327308018904
>>   version: 0
>>   children_version: 0
>>   acl_version: 0
>>   ephemeral_owner: 0
>>   data_len: 5
>>   num_children: 0
>>   children_zxid: 230
>> node /acl0000000028 has ACL entry:
>>   perms:  31
>>   scheme: digest
>>   id:     user:smGaoVKd/cQkjm7b88GyorAUz20=
>>


Mime
View raw message