secure-store-redis
Advanced tools
Comparing version 1.1.0 to 1.2.0
15
index.js
@@ -22,9 +22,16 @@ var RCP = require('redis-connection-pool'), | ||
this.pool = RCP(this.namespace, { | ||
host: cfg.redis.host || 'localhost', | ||
port: cfg.redis.port || 6379, | ||
var rcpConfig = { | ||
max_clients: cfg.redis.max_clients || 30, | ||
database: cfg.redis.database || 0, | ||
options: cfg.redis.options || null | ||
}); | ||
}; | ||
if (cfg.redis.url) { | ||
rcpConfig.url = cfg.redis.url; | ||
} else { | ||
rcpConfig.host = cfg.redis.host || 'localhost'; | ||
rcpConfig.port = cfg.redis.port || 6379; | ||
} | ||
this.pool = RCP(this.namespace, rcpConfig); | ||
} | ||
@@ -31,0 +38,0 @@ |
{ | ||
"name": "secure-store-redis ", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A simple wrapper to encrypt and decrypt data stored in redis", | ||
@@ -26,3 +26,3 @@ "license": "MIT", | ||
"dead-simple-crypt": "0.0.1", | ||
"redis-connection-pool": "^1.5.1" | ||
"redis-connection-pool": "^1.6.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
@@ -16,2 +16,4 @@ # secure-store-redis | ||
port: 6379, // optional | ||
// optionally use the 'url' property to specify entire redis connect string | ||
// url: 'redis://localhost:6379', | ||
max_clients: 30, // optional | ||
@@ -22,3 +24,3 @@ database: 0, // optional | ||
} //options for createClient of node-redis, optional | ||
} | ||
} | ||
}); | ||
@@ -25,0 +27,0 @@ |
@@ -139,4 +139,23 @@ function getTests() { | ||
tests: getTests(), | ||
}, | ||
{ | ||
desc: "basic tests again (redis url)", | ||
abortOnFail: true, | ||
setup: function (env, test) { | ||
env.Mod = require('./../index'); | ||
test.assertTypeAnd(env.Mod, 'function'); | ||
env.mod = new env.Mod({ | ||
namespace: 'secure-store-redis-tests', | ||
secret: 'sssh dont say nuthin!', | ||
redis: { | ||
url: '127.0.0.1:6379' | ||
} | ||
}); | ||
test.assertTypeAnd(env.mod, 'object'); | ||
test.assertTypeAnd(env.mod.get, 'function'); | ||
test.assertType(env.mod.save, 'function'); | ||
}, | ||
tests: getTests(), | ||
}]; | ||
}); | ||
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
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
10085
236
54
Updatedredis-connection-pool@^1.6.0