Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 2.02 KB

Readme.md

File metadata and controls

47 lines (38 loc) · 2.02 KB

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