dynamodb-adapter
AWS DynamoDB Adapter is the DynamoDB adapter for Casbin-rs. With this library, Casbin can load policy from DynamoDB database or save policy to it.
Based on Diesel adapter.
Install
Add it to Cargo.toml
aws-config = "0.48.0"
aws-sdk-dynamodb = "0.18.0"
dynamodb-adapter = "0.1.0"
tokio = { version = "1.21.1", features = ["macros", "rt-multi-thread"] }
Example
use *;
use DynamoDBAdapter;
async
Test with DynamoBD Local
docker pull amazon/dynamodb-local
docker run --rm -p 8000:8000 amazon/dynamodb-local
aws dynamodb create-table \
--endpoint-url http://localhost:8000 \
--table-name Casbin_Policies \
--attribute-definitions \
AttributeName=id,AttributeType=S \
--key-schema \
AttributeName=id,KeyType=HASH \
--billing-mode PAY_PER_REQUEST
aws dynamodb scan \
--endpoint-url http://localhost:8000 \
--table-name Casbin_Policies