Skip to main content

Casbin role watcher to be used for monitoring updates to policies for PyCasbin

Project description

etcd-watcher

tests Coverage Status Version PyPI - Wheel Pyversions Download Discord

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


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.4.0.tar.gz (366.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etcd_watcher-1.4.0-py3-none-any.whl (401.4 kB view details)

Uploaded Python 3

File details

Details for the file etcd_watcher-1.4.0.tar.gz.

File metadata

  • Download URL: etcd_watcher-1.4.0.tar.gz
  • Upload date:
  • Size: 366.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for etcd_watcher-1.4.0.tar.gz
Algorithm Hash digest
SHA256 78d62eda1ab5964bb3c77a2c7fbfb8ab4109007683f4a83fb1dbcacff4e643b5
MD5 e5d5b26540021f803e23de86c1b752a7
BLAKE2b-256 7b63f38c02706b1425e2403863b41490e4548ccb996053c9709eb238b6d4c036

See more details on using hashes here.

File details

Details for the file etcd_watcher-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: etcd_watcher-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 401.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for etcd_watcher-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 952c1ab928d46f00819da25441f16eaf2300d88d2c9ffc86ac03df7aa0896a73
MD5 88fc8fbbcc4c6bb1fc746f91a61f479c
BLAKE2b-256 532f3d1bb3afb8b6eefc96559a66c59bb39fc5ad7d8efd237e41dd7bc10e2a74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page