Skip to main content

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

Project description

etcd-watcher

testsCoverage StatusVersionDownloadGitter

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casbin_etcd_watcher-1.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

casbin_etcd_watcher-1.0.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file casbin_etcd_watcher-1.0.1.tar.gz.

File metadata

  • Download URL: casbin_etcd_watcher-1.0.1.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

Hashes for casbin_etcd_watcher-1.0.1.tar.gz
Algorithm Hash digest
SHA256 28f90b9188f2e94bd5ca31b6845bbe5b78c41d922ff4319fb6189fb6921eb6e9
MD5 124d027eb289b88b8ae568c437b546f0
BLAKE2b-256 fe7914e9ef2056c04198d7c1ea78a398a20f3dbb7ae92080c68a7b9f82cc7892

See more details on using hashes here.

File details

Details for the file casbin_etcd_watcher-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for casbin_etcd_watcher-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90d42d842159ebca53e06ee5009b7da414b6fb1d78863988c97259a20948b6ee
MD5 d370cc3b3cff4af7e88b0a426a1136e7
BLAKE2b-256 c792e6180bb3485b6c1a4eac70a553da5f4c9370b9843a324f042fd3a08d80d9

See more details on using hashes here.

Supported by

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