acl-dynamodb
v0.1.2
Published
DynamoDB backend for acl
Downloads
5
Maintainers
Readme
NODE ACL - DynamoDB backend
This fork adds DynamoDB backend support to NODE ACL
Status
Installation
Using npm:
npm install acl-dynamodb
Usage
Download and install DynamoDB Local Start DynamoDB. See documentation for commandline arguments. Create DynamoDB database object in your node.js application. Create acl module and instantiate it with DynamoDB backend, passing the DynamoDB object into the backend instance.
var AWS = require('aws-sdk');
// Set local configuration. Note: keys and region can be arbitrary values but must be set
var db = new AWS.DynamoDB({
endpoint: new AWS.Endpoint("http://localhost:8000"),
accessKeyId: "myKeyId",
secretAccessKey: "secretKey",
region: "us-east-1",
apiVersion: "2016-01-07"
});
// require acl and create DynamoDB backend
var Acl = require('acl');
var dynamodbBackend = require('acl-dynamodb');
// Doesn't set a 'prefix' for collections and separates buckets into multiple collections.
acl = new Acl(new dynamodbBackend(db));
// Alternatively, set a prefix and combined buckets into a single collection
acl = new Acl(new dynamodbBackend(db, 'acl_', true));
Documentation
See NODE ACL documentation See AWS DynamoDB JS documentation See AWS DynamoDB documentation