chore(release): 1.0.1 [skip ci]

## [1.0.1](https://github.com/pycasbin/etcd-watcher/compare/v1.0.0...v1.0.1) (2022-07-19)

### Bug Fixes

* add needed files for release info ([#12](https://github.com/pycasbin/etcd-watcher/issues/12)) ([4f51150](https://github.com/pycasbin/etcd-watcher/commit/4f51150e95aa5aae5180d93e4124f6e3e14e5f34))
* update setup name to casbin_etcd_watcher ([#15](https://github.com/pycasbin/etcd-watcher/issues/15)) ([0b38a58](https://github.com/pycasbin/etcd-watcher/commit/0b38a582f88148c98139c6c0b5b2f7699961b069))
2 files changed
tree: 86ea594859b77425a38b055a711fffc0f9f0f36e
  1. .github/
  2. etcd_watcher/
  3. examples/
  4. tests/
  5. .gitignore
  6. .releaserc.json
  7. CHANGELOG.md
  8. LICENSE
  9. pyproject.toml
  10. README.md
  11. requirements.txt
  12. setup.cfg
  13. setup.py
README.md

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.