0.1.2 • Published 5 years ago

acl-dynamodb v0.1.2

Weekly downloads
15
License
-
Repository
github
Last release
5 years ago

NODE ACL - DynamoDB backend

This fork adds DynamoDB backend support to NODE ACL

Status

BuildStatus Dependency Status devDependency 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