Skip to main content

Casbin role watcher to be used for monitoring updates to policies for PyCasbin

Project description

rabbitmq-watcher

Build Status Coverage Status Version PyPI - Wheel Pyversions Download Discord

Rabbitmq Watcher is the rabbitmq watcher for pycasbin. With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.

Installation

pip install casbin-rabbitmq-watcher

Simple Example

import os

import casbin
from casbin_rabbitmq_watcher import new_watcher


def get_examples(path):
    examples_path = os.path.split(os.path.realpath(__file__))[0] + "/../examples/"
    return os.path.abspath(examples_path + path)


def update_callback_func(msg):
    ...


watcher = new_watcher()
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

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casbin-rabbitmq-watcher-1.3.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

casbin_rabbitmq_watcher-1.3.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file casbin-rabbitmq-watcher-1.3.0.tar.gz.

File metadata

File hashes

Hashes for casbin-rabbitmq-watcher-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1d9139a6763c19bc7e5d15316d940ce10991d75d3e17f93c8c33064da529a77c
MD5 96b51d37042f3d48bcf3f5871610eb8f
BLAKE2b-256 f306cb84722429d53c981f4ea7e426755a66bd9d3eb95f7a893e3bcb13d28f44

See more details on using hashes here.

File details

Details for the file casbin_rabbitmq_watcher-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for casbin_rabbitmq_watcher-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 768a4dbe42aef0526f4b4346207c6afa9ed74afa964f21607f801e1e2154f9f6
MD5 12bc9a3e455714e31ce6f06d393ad923
BLAKE2b-256 f509b8c2c5e06116f1ab1533a338cd3276ec74dec2f069e4379b136d61e31a14

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page