Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "redis.auth", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A non prescriptive Redis Authentication module for Express", | ||
@@ -33,3 +33,6 @@ "main": "index.js", | ||
"supertest": "^1.2.0" | ||
}, | ||
"dependencies": { | ||
"redis.token": "^0.1.5" | ||
} | ||
} |
@@ -0,2 +1,54 @@ | ||
[![Build Status](https://travis-ci.org/ChrisCates/redis.auth.svg?branch=master)](https://travis-ci.org/ChrisCates/redis.auth) | ||
[![Coverage Status](https://coveralls.io/repos/github/ChrisCates/redis.auth/badge.svg?branch=master)](https://coveralls.io/github/ChrisCates/redis.auth?branch=master) | ||
[![NPM](https://nodei.co/npm/redis.auth.png)](https://nodei.co/npm/redis.auth/) | ||
# redis.auth | ||
A non prescriptive Redis Authentication module for Express | ||
## A non prescriptive Redis Authentication module for Express | ||
### By Chris Cates :star: | ||
### Installation | ||
``` | ||
npm install redis.auth --save | ||
``` | ||
### Configuration | ||
Note that it requires redis.token npm module to work properly | ||
``` | ||
var redis = require("redis.token")() | ||
var auth = require("redis.auth")(redis, { | ||
//Check for which Express header use when authenticating the client | ||
"header": "authorization", | ||
//The key in the redis session storage you want to check for | ||
"key": "grantType", | ||
//If return error is true it sends a 403 or 500 status based on the error | ||
//Turn this off if you want to do your own error checking | ||
"returnError": true | ||
}) | ||
``` | ||
### Example status returns: | ||
#### With returnError = true | ||
``` | ||
return res.status(403).send({ | ||
"error": true, | ||
"status": 403, | ||
"message": "No "+config.header+" header supplied..." | ||
}) | ||
``` | ||
#### With returnError = false | ||
``` | ||
//Sets these variables in req so you can check for them on your own | ||
req.error = true | ||
req.errorType = "No "+config.header+" header supplied..." | ||
req.errorCode = 403 | ||
return next() | ||
``` | ||
#### Questions, email hello@chriscates.ca |
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
7848
55
1
+ Addedredis.token@^0.1.5
+ Addedcrypto-js@3.3.0(transitive)
+ Addeddouble-ended-queue@2.1.0-0(transitive)
+ Addedredis@2.8.0(transitive)
+ Addedredis-commands@1.7.0(transitive)
+ Addedredis-parser@2.6.0(transitive)
+ Addedredis.token@0.1.7(transitive)