JSPM

  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q77425F
  • License MIT

A simple wrapper to encrypt and decrypt data stored in redis

Package Exports

  • secure-store-redis

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (secure-store-redis ) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

secure-store-redis

A simple wrapper to encrypt and decrypt data stored in redis. The main point is to ensure that any data you store in redis cannot be accessed by anyone else outside of the process, without the key.

var SecureStore = require('secure-store-redis');

var store = new SecureStore({
    namespace: 'myApp:store',
    secret: 'quacks like a duck',
    redis: { // standard redis config object
        host: "127.0.0.1",
        port: 6379
    }
});

store.save('quote', 'i see dead people', function (err, reply) {
    //...
    store.get('quote', function (err, reply) {
        // err: null
        // reply: 'i see dead people'
    });
    store.get('quote', function (err, reply) {
        // err: record not found
        // reply: undefined
    });
});



var otherStore = new SecureStore({
    prefix: 'myApp:store',
    secret: 'this is the wrong secret',
    redis: { // standard redis config object
        host: "127.0.0.1",
        port: 6379
    }
});

otherStore.get('quote', function (err, reply) {
        // err: record not found
        // reply: undefined
    });