chore(release): 1.2.0 [skip ci] # [1.2.0](https://github.com/officialpycasbin/etcd-watcher/compare/v1.1.0...v1.2.0) (2024-11-12) ### Features * fix CI's etcd container error ([b8bcf79](https://github.com/officialpycasbin/etcd-watcher/commit/b8bcf7932d2d446a66bea389dd694119124df3ad)) * update path ([6368448](https://github.com/officialpycasbin/etcd-watcher/commit/63684489cf71477ff0ead3de4cbac66a2fd94a75))
Etcd Watcher is the Etcd watcher for pycasbin. With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.
pip install etcd-watcher
import casbin from etcd_watcher import new_watcher def update_callback_func(event): ... watcher = new_watcher(endpoints=["localhost", 2379], keyname="/casbin") watcher.set_update_callback(update_callback_func) e = casbin.Enforcer( get_examples("rbac_model.conf"), get_examples("rbac_policy.csv") ) e.set_watcher(watcher) # update_callback_func will be called e.save_policy()
This project is under Apache 2.0 License. See the LICENSE file for the full license text.