secure-store-redis
Advanced tools
Comparing version 1.4.7 to 2.0.0
{ | ||
"name": "secure-store-redis", | ||
"version": "1.4.7", | ||
"description": "A simple wrapper to encrypt and decrypt data stored in redis", | ||
"version": "2.0.0", | ||
"description": "A simple wrapper to encrypt and decrypt data stored in Redis", | ||
"license": "MIT", | ||
@@ -20,11 +20,22 @@ "private": false, | ||
}, | ||
"main": "./index.js", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/", | ||
"src/" | ||
], | ||
"scripts": { | ||
"test": "node_modules/.bin/jaribu" | ||
"test": "npm run build && jaribu", | ||
"build": "tsc" | ||
}, | ||
"dependencies": { | ||
"redis-connection-pool": "^1.7.4" | ||
"redis-connection-pool": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"jaribu": "2.2.3" | ||
"@types/eslint": "^8.4.1", | ||
"@types/node": "^17.0.23", | ||
"@typescript-eslint/parser": "^5.16.0", | ||
"eslint": "^8.11.0", | ||
"jaribu": "2.2.3", | ||
"typescript": "^4.6.2" | ||
}, | ||
@@ -31,0 +42,0 @@ "repository": { |
# 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. | ||
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. | ||
**NOTE** version `2.x` is a rewrite in TypeScript, using async functions, and is | ||
backwards incompatible with `1.x` | ||
```javascript | ||
var SecureStore = require('secure-store-redis'); | ||
const SecureStore = require('secure-store-redis').default; | ||
var store = new SecureStore({ | ||
namespace: 'myApp:store', | ||
secret: '823HD8DG26JA0LK1239Hgb651TWfs0j1', // must be 32 char secret | ||
errorOnNotFound: true, //optional; will cb error if data can't be found | ||
redis: { | ||
host: 'localhost', // optional | ||
port: 6379, // optional | ||
// optionally use the 'url' property to specify entire redis connect string | ||
// url: 'redis://localhost:6379', | ||
max_clients: 30, // optional | ||
database: 0, // optional | ||
options: { | ||
auth_pass: 'password' | ||
} //options for createClient of node-redis, optional | ||
} | ||
const store = new SecureStore('myApp:store', '823HD8DG26JA0LK1239Hgb651TWfs0j1', { | ||
host: 'localhost', // optional | ||
port: 6379, // optional | ||
// optionally use the 'url' property to specify entire redis connect string | ||
// url: 'redis://localhost:6379', | ||
}); | ||
await store.init(); | ||
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 | ||
}); | ||
}); | ||
await store.save('quote', 'i see dead people'); | ||
let res = await store.get('quote'); | ||
// res: 'i see dead people' | ||
let res = await store.get('quote'); | ||
// res: null | ||
const num = await store.delete('quote'); | ||
// num: 1 | ||
store.delete('quote', function (err, reply) { | ||
// err: null | ||
// reply: 1 | ||
}); | ||
await store.save('quote', 'i see dead people again'); | ||
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 | ||
} | ||
const otherStore = new SecureStore('myApp:store', 'this is the wrong secret', { | ||
host: "127.0.0.1", | ||
port: 6379 | ||
}); | ||
await otherStore.init(); | ||
otherStore.get('quote', function (err, reply) { | ||
// err: record not found | ||
// reply: undefined | ||
}); | ||
let res = await otherStore.get('quote'); | ||
// res: undefined | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16076
6
7
235
42
1
+ Added@redis/bloom@1.2.0(transitive)
+ Added@redis/client@1.6.0(transitive)
+ Added@redis/graph@1.1.1(transitive)
+ Added@redis/json@1.0.7(transitive)
+ Added@redis/search@1.2.0(transitive)
+ Added@redis/time-series@1.1.0(transitive)
+ Addedcluster-key-slot@1.1.2(transitive)
+ Addedredis@4.7.0(transitive)
+ Addedredis-connection-pool@2.0.4(transitive)
+ Addedyallist@4.0.0(transitive)
- Removeddenque@1.5.1(transitive)
- Removedredis@3.1.2(transitive)
- Removedredis-commands@1.7.0(transitive)
- Removedredis-connection-pool@1.7.4(transitive)
- Removedredis-errors@1.2.0(transitive)
- Removedredis-parser@3.0.0(transitive)
Updatedredis-connection-pool@^2.0.1