Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

secure-store-redis

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secure-store-redis

A simple wrapper to encrypt and decrypt data stored in Redis

  • 3.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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, without the key.

Installation

npm install secure-store-redis

Initialization

import SecureStore from "secure-store-redis";

const store = new SecureStore({
  uid: "myApp:store",
  secret: "823HD8DG26JA0LK1239Hgb651TWfs0j1",
  redis: {
    url: 'redis://localhost:6379',
  }
));
await store.init();

Save

await store.save("quote", "hello world");

Get

let res = await store.get("quote");
// res: 'hello world'

Delete

const num = await store.delete("quote");
// num: 1
let res = await store.get("quote");
// res: null

Attempt to fetch encrypted data from another store

await store.save("quote", "hello world again");

const otherStore = new SecureStore({
    uid: "myApp:store",
    secret: "this is the wrong secret 32 char",
    redis: {
        url: "redis://localhost:6379",
    },
});
await otherStore.init();

let res = await otherStore.get("quote");
// res: null

Disconnect from Redis

await otherStore.disconnect();
await store.disconnect();

Keywords

FAQs

Package last updated on 07 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc