casbin-rabbitmq-watcher


Namecasbin-rabbitmq-watcher JSON
Version 1.7.0 PyPI version JSON
download
home_pagehttps://github.com/officialpycasbin/rabbitmq-watcher
SummaryCasbin role watcher to be used for monitoring updates to policies for PyCasbin
upload_time2025-08-21 01:24:36
maintainerNone
docs_urlNone
authorCasbin
requires_python>=3.5
licenseApache 2.0
keywords pycasbin casbin rabbitmq casbin-watcher rbac access control abac acl permission
VCS
bugtrack_url
requirements pycasbin pika
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rabbitmq-watcher

[![Build Status](https://github.com/officialpycasbin/rabbitmq-watcher/actions/workflows/build.yml/badge.svg)](https://github.com/officialpycasbin/rabbitmq-watcher/actions/workflows/build.yml)
[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/rabbitmq-watcher/badge.svg)](https://coveralls.io/github/officialpycasbin/rabbitmq-watcher)
[![Version](https://img.shields.io/pypi/v/casbin-rabbitmq-watcher.svg)](https://pypi.org/project/casbin-rabbitmq-watcher/)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin-rabbitmq-watcher.svg)](https://pypi.org/project/casbin-rabbitmq-watcher/)
[![Pyversions](https://img.shields.io/pypi/pyversions/casbin-rabbitmq-watcher.svg)](https://pypi.org/project/casbin-rabbitmq-watcher/)
[![Download](https://static.pepy.tech/badge/casbin-rabbitmq-watcher)](https://pypi.org/project/casbin-rabbitmq-watcher/)
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN)

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

## Installation

```bash
pip install casbin-rabbitmq-watcher
```

## Simple Example

```python
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

- [Casbin](https://github.com/casbin/pycasbin)

## License

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/officialpycasbin/rabbitmq-watcher",
    "name": "casbin-rabbitmq-watcher",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": null,
    "keywords": "pycasbin, casbin, Rabbitmq, casbin-watcher, rbac, access control, abac, acl, permission",
    "author": "Casbin",
    "author_email": "admin@casbin.org",
    "download_url": "https://files.pythonhosted.org/packages/09/a6/40c91b427ed2a1dda610484cbf441b37ea0654b7cfca92515eba18465446/casbin_rabbitmq_watcher-1.7.0.tar.gz",
    "platform": null,
    "description": "# rabbitmq-watcher\n\n[![Build Status](https://github.com/officialpycasbin/rabbitmq-watcher/actions/workflows/build.yml/badge.svg)](https://github.com/officialpycasbin/rabbitmq-watcher/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/rabbitmq-watcher/badge.svg)](https://coveralls.io/github/officialpycasbin/rabbitmq-watcher)\n[![Version](https://img.shields.io/pypi/v/casbin-rabbitmq-watcher.svg)](https://pypi.org/project/casbin-rabbitmq-watcher/)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin-rabbitmq-watcher.svg)](https://pypi.org/project/casbin-rabbitmq-watcher/)\n[![Pyversions](https://img.shields.io/pypi/pyversions/casbin-rabbitmq-watcher.svg)](https://pypi.org/project/casbin-rabbitmq-watcher/)\n[![Download](https://static.pepy.tech/badge/casbin-rabbitmq-watcher)](https://pypi.org/project/casbin-rabbitmq-watcher/)\n[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN)\n\nRabbitmq Watcher is the rabbitmq watcher for pycasbin. With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.\n\n## Installation\n\n```bash\npip install casbin-rabbitmq-watcher\n```\n\n## Simple Example\n\n```python\nimport os\n\nimport casbin\nfrom casbin_rabbitmq_watcher import new_watcher\n\n\ndef get_examples(path):\n    examples_path = os.path.split(os.path.realpath(__file__))[0] + \"/../examples/\"\n    return os.path.abspath(examples_path + path)\n\n\ndef update_callback_func(msg):\n    ...\n\n\nwatcher = new_watcher()\nwatcher.set_update_callback(update_callback_func)\n\ne = casbin.Enforcer(\n    get_examples(\"rbac_model.conf\"), get_examples(\"rbac_policy.csv\")\n)\n\ne.set_watcher(watcher)\n# update_callback_func will be called\ne.save_policy()\n```\n\n## Getting Help\n\n- [Casbin](https://github.com/casbin/pycasbin)\n\n## License\n\nThis project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Casbin role watcher to be used for monitoring updates to policies for PyCasbin",
    "version": "1.7.0",
    "project_urls": {
        "Homepage": "https://github.com/officialpycasbin/rabbitmq-watcher"
    },
    "split_keywords": [
        "pycasbin",
        " casbin",
        " rabbitmq",
        " casbin-watcher",
        " rbac",
        " access control",
        " abac",
        " acl",
        " permission"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b521d0558a96e7fe34c15b2a6c65f33da9cf8c2942002705d9241de51d2f1a35",
                "md5": "72914af653020e89ff54a9d3d6a0f49f",
                "sha256": "f4abac7d288b23ff15dce0f6eb8ac189b11d6447262178f1c9d10fcb0e5e6fcf"
            },
            "downloads": -1,
            "filename": "casbin_rabbitmq_watcher-1.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "72914af653020e89ff54a9d3d6a0f49f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 9761,
            "upload_time": "2025-08-21T01:24:35",
            "upload_time_iso_8601": "2025-08-21T01:24:35.637272Z",
            "url": "https://files.pythonhosted.org/packages/b5/21/d0558a96e7fe34c15b2a6c65f33da9cf8c2942002705d9241de51d2f1a35/casbin_rabbitmq_watcher-1.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "09a640c91b427ed2a1dda610484cbf441b37ea0654b7cfca92515eba18465446",
                "md5": "82ebc69f5479f465456d40558ba0f615",
                "sha256": "c810c2607109700b8147d1042c5ce763b04f1cda59710e83d7717d4169f2588d"
            },
            "downloads": -1,
            "filename": "casbin_rabbitmq_watcher-1.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "82ebc69f5479f465456d40558ba0f615",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 8885,
            "upload_time": "2025-08-21T01:24:36",
            "upload_time_iso_8601": "2025-08-21T01:24:36.686949Z",
            "url": "https://files.pythonhosted.org/packages/09/a6/40c91b427ed2a1dda610484cbf441b37ea0654b7cfca92515eba18465446/casbin_rabbitmq_watcher-1.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 01:24:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "officialpycasbin",
    "github_project": "rabbitmq-watcher",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pycasbin",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pika",
            "specs": [
                [
                    ">=",
                    "1.3.0"
                ]
            ]
        }
    ],
    "lcname": "casbin-rabbitmq-watcher"
}
        
Elapsed time: 1.69665s