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.7.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

casbin_rabbitmq_watcher-1.7.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file casbin_rabbitmq_watcher-1.7.0.tar.gz.

File metadata

  • Download URL: casbin_rabbitmq_watcher-1.7.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for casbin_rabbitmq_watcher-1.7.0.tar.gz
Algorithm Hash digest
SHA256 c810c2607109700b8147d1042c5ce763b04f1cda59710e83d7717d4169f2588d
MD5 82ebc69f5479f465456d40558ba0f615
BLAKE2b-256 09a640c91b427ed2a1dda610484cbf441b37ea0654b7cfca92515eba18465446

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for casbin_rabbitmq_watcher-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4abac7d288b23ff15dce0f6eb8ac189b11d6447262178f1c9d10fcb0e5e6fcf
MD5 72914af653020e89ff54a9d3d6a0f49f
BLAKE2b-256 b521d0558a96e7fe34c15b2a6c65f33da9cf8c2942002705d9241de51d2f1a35

See more details on using hashes here.

Supported by

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