@financial-times/ip-whitelist
v0.0.1
Published
Checks if a user belongs to the given whitelist
Downloads
6
Maintainers
Keywords
Readme
ip-whitelist
This module is an express middleware that can verify if a user belongs to a whitelist.
Setup
npm install -S @financial-times/ip-whitelist
Usage
Set the whitelist data to the app.locals object in your application. Then call this middleware after the s3o-middleware
var authS3O = require('@financial-times/s3o-middleware');
var whitelist = require('@financial-times/ip-whitelist');
const whitelistData = require('route to your whitelist data');
...
const app = express();
app.locals.whitelistData = whitelistData;
app.use(authS3O);
app.use(whitelist);
...
Licence
MIT