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.2.0.tar.gz
(366.0 kB
view details)
Built Distribution
etcd_watcher-1.2.0-py3-none-any.whl
(401.0 kB
view details)
File details
Details for the file etcd_watcher-1.2.0.tar.gz
.
File metadata
- Download URL: etcd_watcher-1.2.0.tar.gz
- Upload date:
- Size: 366.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab55994038085ca5f5e06ec5fde482e0621025094fd762a486b68c9b85584f37 |
|
MD5 | 062713ce2909fde44358ab61522f55a3 |
|
BLAKE2b-256 | ad3b74876b3ccec42810a1a1d36d55cf08eb727a5d94f1b0d8dff7e8c023737a |
File details
Details for the file etcd_watcher-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: etcd_watcher-1.2.0-py3-none-any.whl
- Upload date:
- Size: 401.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6d53edbcc3a4f796cb53ca1dd36dab71f5ed156cd38e35e4c2cf95132c525a7 |
|
MD5 | 3b4557190a0660e31c3c9dc96cacc6fc |
|
BLAKE2b-256 | 6823cb3f5d2eac29290c88ea2d828aa421e1e00c70151d18a1171f7d6fb455ca |