DynamoDB adopter for casbin
Project description
DynamoDB adopter for casbin
Installation
Run pip install python-dycasbin
Usage
import casbin
from python_dycasbin import adapter
adapter = adapter.Adapter(table_name='casbin_rule', endpoint_url='http://localhost:8000')
e = casbin.Enforcer("model.conf", adapter, True)
sub = "eve4" # the user that wants to access a resource.
obj = "data3" # the resource that is going to be accessed.
act = "read" # the operation that the user performs on the resource.
if e.enforce(sub, obj, act):
print("Allow")
else:
print("Deny")
Running tests
- Install pytest and pytest-mock
- Run
pytest
from project root
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
python_dycasbin-0.4.1.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for python_dycasbin-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b70ab71f8a1301d7a8ebd88f03ae93c0ef0b5139e88780d4f75fbd7ba088a1 |
|
MD5 | 9ceb6fa3e0af777851123240fdb7bcab |
|
BLAKE2b-256 | 8cd155252a426c977f93f60bda609b5d28a7b6f5453eaef3a4565a2fa26e93fc |