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.3.1.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for python_dycasbin-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c24eb5609579b0b6331c829035b071663be521cccb1f1d8dd5ccd7d0adc6b99 |
|
MD5 | 524726ca97070b0bf0b3352dd55ebf2e |
|
BLAKE2b-256 | fc771d1460c0f01826bb6399969efc4df436b6f4df3f43ff6a32f936c8548e5c |