python-zk/kazoo

Add option to recursively set ACLs

marcoppenheimer opened this issue · 0 comments

What would you like to be added

As of ZOOKEEPER-1908 the CLI supports running setAcl recursively

I would like the Kazoo client to be able to do the same, to avoid having to issue multiple calls for every child zNode.

Something like: Kazoo.client.set_acls(path=path, acls=acls, recursive=True)

Why is this needed

It's not uncommon to have a unique SASL (or other scheme) credential + ACLs assigned to their own parent zNode. For example, the chroot for Kafka.

Right now, if I'm not mistaken, if we want to change ACLs for that parent zNode, we have to:

  1. Recursively get all child zNodes from the parent
  2. Call Kazoo.client.set_acl for each one

This is cumbersome, and would be great if we could do it recursively from the get-go.