Casbin role watcher to be used for monitoring updates to policies for PyCasbin
Project description
etcd-watcher
Etcd Watcher is the Etcd watcher for pycasbin. With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.
Installation
pip install casbin-etcd-watcher
Simple Example
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()
Getting Help
License
This project is under Apache 2.0 License. See the LICENSE file for the full license text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for casbin_etcd_watcher-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f90b9188f2e94bd5ca31b6845bbe5b78c41d922ff4319fb6189fb6921eb6e9 |
|
MD5 | 124d027eb289b88b8ae568c437b546f0 |
|
BLAKE2b-256 | fe7914e9ef2056c04198d7c1ea78a398a20f3dbb7ae92080c68a7b9f82cc7892 |
Close
Hashes for casbin_etcd_watcher-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90d42d842159ebca53e06ee5009b7da414b6fb1d78863988c97259a20948b6ee |
|
MD5 | d370cc3b3cff4af7e88b0a426a1136e7 |
|
BLAKE2b-256 | c792e6180bb3485b6c1a4eac70a553da5f4c9370b9843a324f042fd3a08d80d9 |