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(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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for python_dycasbin-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b09ad5a9a78d3bab759f39581a7ebfeb044001387b0db36df8f727fbf701e6 |
|
MD5 | 3fb0ef060e1bba26c0f44a5cd7bcbf2b |
|
BLAKE2b-256 | 76743a92b48927d9684e3eb13aaca7d172a504c2bbd721b360668511be2c76dc |