Zookeeper ACL (use node-zookeeper-client)
In a distributed system, ACL (Access Control) is very important. Zookeeper also provides a very useful ACL interface. Next I will record how to implement Access Control for zookeeper in nodejs. The ACL of Zookeeper is usually expressed as Scheme: Id: Permission, that is, Scheme, Id, and Permission. Scheme indicates the access control method, Id indicates the user, and Permission indicates the Permission.
ZooKeeeper has the following built in schemes:
ZooKeeper has the following built-in Schemes:
World has a single id, anyone, that represents anyone.
Indicates that all users can access
Auth doesn't use any id, represents any authenticated user.
No Id is required. Users with auth can access
Digest uses a username: password string to generate MD5 hash which is then used as an acl id identity. authentication is done by sending the username: password in clear text. when used in the ACL the expression will be the username: base64 encoded SHA1 password digest.
Authentication by username and password. The Id format is username: base64 encoded SHA1 password digest
Host uses the client host name as an acl id identity. the ACL expression is a hostname suffix. for example, the ACL expression host: corp.com matches the ids host: host1.corp.com and host: host2.corp.com, but nothost: host1.store.com.
Use the client host name as the Acl Id
Ip uses the client host IP as an acl id identity. the ACL expression is of the form addr/bits where the most significant bits of addr are matched against the most significant bits of the client host IP.
Use the Client Ip address as the AclZookeeper currently supports the following permissions: