Casbin role watcher to be used for monitoring updates to policies for PyCasbin
Project description
postgresql-watcher
Casbin role watcher to be used for monitoring updates to casbin policies
Installation
pip install casbin-postgresql-watcher
Basic Usage Example
With Flask-authz
from flask_authz import CasbinEnforcer
from postgresql_watcher import PostgresqlWatcher
from flask import Flask
from casbin.persist.adapters import FileAdapter
casbin_enforcer = CasbinEnforcer(app, adapter)
watcher = PostgresqlWatcher(host=HOST, port=PORT, user=USER, password=PASSWORD, dbname=DBNAME)
watcher.set_update_callback(casbin_enforcer.e.load_policy)
casbin_enforcer.set_watcher(watcher)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for casbin-postgresql-watcher-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d2a04d10031283856986db4434a92300f9b4a8f241204c30f65b314b9e4e741 |
|
MD5 | 554e4809e8a4752cf5b77500b8579b22 |
|
BLAKE2b-256 | c8f52d15128ea77d035f448f58b42e73ea7c0473288bc17460f345fa77a05afe |
Close
Hashes for casbin_postgresql_watcher-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 159b344cc27e1310a4b0a5921e9c121e87cd5da9b32efc78b5bcecec6e88df83 |
|
MD5 | 604d2a6e0913b75f2729b3e3252327fa |
|
BLAKE2b-256 | e92edebec3ee39c5a690384b6615208a35c70c612f6d9701247311dcd637cee9 |