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
File details
Details for the file casbin_etcd_watcher-1.0.2.tar.gz
.
File metadata
- Download URL: casbin_etcd_watcher-1.0.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b6ac5d7b00e217ae41e55ab87df29be7f281e8ff32225eae8d770c5ce6b0586 |
|
MD5 | e4b413d64153177d6441a55d9813ddfd |
|
BLAKE2b-256 | 3dd45b58a4f950c573b9685ff4a387201cbe1964e25974ca83512be5dd257179 |
File details
Details for the file casbin_etcd_watcher-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: casbin_etcd_watcher-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d02b91b9e3bfe2fdce2803e76b4516dc7da5c85129c2374f2a03f85978765ef8 |
|
MD5 | 06cf606fa7706222041f9ce00e7f8966 |
|
BLAKE2b-256 | a873012de27147ab9da4a3af44a5d415a72176bc70a85b4a0bc12a62944320b1 |