3.0.7 • Published 12 months ago
secure-store-redis v3.0.7
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-redisInitialization
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: nullAttempt 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: nullDisconnect from Redis
await otherStore.disconnect();
await store.disconnect();3.0.7
12 months ago
3.0.4
2 years ago
3.0.3
2 years ago
3.0.6
2 years ago
3.0.5
2 years ago
3.0.2
2 years ago
3.0.1
3 years ago
3.0.0-rc.2
3 years ago
3.0.0-rc.1
3 years ago
3.0.0
3 years ago
3.0.0-rc.5
3 years ago
3.0.0-rc.4
3 years ago
3.0.0-rc.3
3 years ago
2.0.5
3 years ago
2.0.4
3 years ago
2.0.3
3 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.4.6
5 years ago
1.4.7
5 years ago
1.4.4
5 years ago
1.4.3
7 years ago
1.4.2
7 years ago
1.4.1
7 years ago
1.4.0
7 years ago
1.3.1
8 years ago
1.3.0
9 years ago
1.2.0
9 years ago
1.1.0
9 years ago
1.0.0
9 years ago
0.1.2
11 years ago
0.1.1
11 years ago
0.1.0
11 years ago
0.0.1
11 years ago