Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pycasbin/etcd-watcher
Etcd Watcher for PyCasbin
https://github.com/pycasbin/etcd-watcher
abac acl auth authz casbin etcd pycasbin python rbac watcher
Last synced: 19 days ago
JSON representation
Etcd Watcher for PyCasbin
- Host: GitHub
- URL: https://github.com/pycasbin/etcd-watcher
- Owner: pycasbin
- License: apache-2.0
- Created: 2020-08-15T05:49:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-29T12:17:50.000Z (9 months ago)
- Last Synced: 2024-12-06T04:49:43.534Z (28 days ago)
- Topics: abac, acl, auth, authz, casbin, etcd, pycasbin, python, rbac, watcher
- Language: Python
- Homepage: https://github.com/casbin/pycasbin
- Size: 24.4 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# etcd-watcher
[![tests](https://github.com/pycasbin/etcd-watcher/actions/workflows/release.yml/badge.svg)](https://github.com/pycasbin/etcd-watcher/actions/workflows/release.yml)
[![Coverage Status](https://coveralls.io/repos/github/pycasbin/etcd-watcher/badge.svg)](https://coveralls.io/github/pycasbin/etcd-watcher)
[![Version](https://img.shields.io/pypi/v/casbin-etcd-watcher.svg)](https://pypi.org/project/casbin-etcd-watcher/)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin-etcd-watcher.svg)](https://pypi.org/project/casbin-etcd-watcher/)
[![Pyversions](https://img.shields.io/pypi/pyversions/casbin-etcd-watcher.svg)](https://pypi.org/project/casbin-etcd-watcher/)
[![Download](https://img.shields.io/pypi/dm/casbin-etcd-watcher.svg)](https://pypi.org/project/casbin-etcd-watcher/)
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN)Etcd Watcher is the [Etcd](https://github.com/coreos/etcd) watcher for [pycasbin](https://github.com/casbin/pycasbin). With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.
## Installation
pip install casbin-etcd-watcher
## Simple Example
```python
import casbin
from etcd_watcher import new_watcherdef 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
- [Casbin](https://github.com/casbin/pycasbin)
## License
This project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.