casbin-etcd-watcher-1.0.2
توضیحات
Casbin role watcher to be used for monitoring updates to policies for PyCasbin
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | casbin-etcd-watcher-1.0.2 |
| نام | casbin-etcd-watcher |
| نسخه کتابخانه | 1.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | nekotoxin |
| ایمیل نویسنده | nekotoxin@gmail.com |
| آدرس صفحه اصلی | https://github.com/pycasbin/etcd-watcher |
| آدرس اینترنتی | https://pypi.org/project/casbin-etcd-watcher/ |
| مجوز | - |
# etcd-watcher
[](https://github.com/pycasbin/etcd-watcher/actions/workflows/release.yml) [](https://coveralls.io/github/pycasbin/etcd-watcher) [](https://pypi.org/project/casbin-etcd-watcher/) [](https://pypi.org/project/casbin-etcd-watcher/) [](https://gitter.im/casbin/lobby)
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_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
- [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.
نیازمندی
| مقدار | نام |
|---|---|
| ==1.16.8 | casbin |
| ==0.12.0 | etcd3 |
| ==3.19.0 | protobuf |
نحوه نصب
نصب پکیج whl casbin-etcd-watcher-1.0.2:
pip install casbin-etcd-watcher-1.0.2.whl
نصب پکیج tar.gz casbin-etcd-watcher-1.0.2:
pip install casbin-etcd-watcher-1.0.2.tar.gz