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 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
etcd_watcher-1.1.0.tar.gz
(3.9 MB
view details)
Built Distribution
File details
Details for the file etcd_watcher-1.1.0.tar.gz
.
File metadata
- Download URL: etcd_watcher-1.1.0.tar.gz
- Upload date:
- Size: 3.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685ca92a7b947a5855b1ee73535c7573f95ee56acb9817581935362974ba0f2c |
|
MD5 | ea78d386f8fad1f378480d39f2e70afb |
|
BLAKE2b-256 | fb9cbeb31fd9458274fd5f03f008e0bb46c9691159bc427232131dbcd2e98568 |
File details
Details for the file etcd_watcher-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: etcd_watcher-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d414b1dd3440d259f973de2ffb45c408c024e9fd10e92311f33a6b5cdeb4619 |
|
MD5 | 2a20b59c0def6c731a66696977ad7ef3 |
|
BLAKE2b-256 | d41bead382657f9d412c137dc8edc5edec44dedacf165dac80d1aa159c268685 |