Skip to main content

async-postgres-watcher

tests PyPI - Version PyPI - Wheel PyPI - Downloads PyPI - License Discord

Async Casbin PostgreSQL watcher to be used for monitoring updates to Casbin policies.

Installation

pip install casbin-async-postgres-watcher

Basic Usage Example

With Flask-authz

from flask_authz import CasbinEnforcer
from async_postgres_watcher import AsyncPostgresWatcher
from flask import Flask
from casbin.persist.adapters import FileAdapter

casbin_enforcer = CasbinEnforcer(app, adapter)

watcher = AsyncPostgresWatcher(host=HOST, port=PORT, user=USER, password=PASSWORD, dbname=DBNAME)
watcher.set_update_callback(casbin_enforcer.e.load_policy)

casbin_enforcer.set_watcher(watcher)

Basic Usage Example With SSL Enabled

See asyncpg documentation for full details of SSL parameters.

With Flask-authz

from flask_authz import CasbinEnforcer
from async_postgres_watcher import AsyncPostgresWatcher
from flask import Flask
from casbin.persist.adapters import FileAdapter

casbin_enforcer = CasbinEnforcer(app, adapter)

# If check_hostname is True, the SSL context is created with sslmode=verify-full.
# If check_hostname is False, the SSL context is created with sslmode=verify-ca.
watcher = AsyncPostgresWatcher(host=HOST, port=PORT, user=USER, password=PASSWORD, dbname=DBNAME, sslrootcert=SSLROOTCERT, check_hostname = True, sslcert=SSLCERT, sslkey=SSLKEY)
watcher.set_update_callback(casbin_enforcer.e.load_policy)

casbin_enforcer.set_watcher(watcher)

Getting Help

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

Metadata

Release files for casbin-async-postgres-watcher 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for casbin-async-postgres-watcher 1.4.0
File Size Uploaded Provenance Actions
casbin_async_postgres_watcher-1.4.0.tar.gz 7.7 kB Without provenance Details for casbin_async_postgres_watcher-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for casbin-async-postgres-watcher 1.4.0
File Interpreter ABI Platform Actions
casbin_async_postgres_watcher-1.4.0-py3-none-any.whl Python 3 none any Details for casbin_async_postgres_watcher-1.4.0-py3-none-any.whl

Total release size: 16.2 kB

Release files / casbin_async_postgres_watcher-1.4.0.tar.gz

Download URL casbin_async_postgres_watcher-1.4.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ace1e2b60f33913b1beab9f599772133a6c927140f094fe6f143a5bbe3ad19fc
BLAKE2b-256 checksum
How to use checksums
c66b65ffefcc8332b1e43bb9d91c9cbe36a6183fd8b8a7d61a864481fba1cdee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / casbin_async_postgres_watcher-1.4.0-py3-none-any.whl

Download URL casbin_async_postgres_watcher-1.4.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f50bec64676e2a94c9809938cf2bbe178213225bc7e0c2b0a74a473c75eb751
BLAKE2b-256 checksum
How to use checksums
66b51b04c17bc3847c89c327516e3830868373861e3c47b9016b1cae71c04ab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Security for casbin-async-postgres-watcher 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page