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)
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
File details
Details for the file casbin-postgresql-watcher-0.0.1.tar.gz
.
File metadata
- Download URL: casbin-postgresql-watcher-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4531d405f698de8269cd3f1226da1de23682269ec090cbb465fe95fb3bcdd3ac |
|
MD5 | 99e297a67a1bad23deecbeca129ae0ff |
|
BLAKE2b-256 | a59b2839c5673d5cdddc372021aa4ade8806bbcfdeea88de4e1c5bc2e7e6c2a8 |