fix: fix `parent_conn` not initialize (#11)

* fix: fix parent_conn not init

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* test: change var type

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* test: set environment check

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* test: fix wrong password

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* ci: fix database setup

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* ci: add support for different system

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* ci: change password on Windows

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* ci: run database natively

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* ci: fix coverall

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* ci: coverage use native database

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* style: format with black

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>
3 files changed
tree: 6e2a68e246004f841dbe7988a33d0999c7f0daa0
  1. .github/
  2. examples/
  3. postgresql_watcher/
  4. tests/
  5. .gitignore
  6. dev_requirements.txt
  7. LICENSE
  8. README.md
  9. requirements.txt
  10. setup.py
README.md

postgresql-watcher

tests Coverage Status Version PyPI - Wheel Download Gitter

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)