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.5.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.5.0-py3-none-any.whl (401.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: etcd_watcher-1.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 a565a1cd3580a60f7e4b35b209bb8b3a65312ba94753f9cad353e7f01d973dad
MD5 377da8608cd60e44ea9df5ef84f6f45e
BLAKE2b-256 6ef182b90944952fca68b2f49fb0c78baad75a3d81a7d1ad619bebe9bc05ab6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: etcd_watcher-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 401.5 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac04f4401c3845652a768aa6afb4354143ccf5e1a84aa1d97781eeadcad4319e
MD5 e8756f3e511fce202e93d7ca7de859ff
BLAKE2b-256 84eea12540da0ba8c76b04a6860f2141e6d13c5966194b5f5543d5c571373836

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