express-ipfilter
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "express-ipfilter", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A light-weight IP address based filtering system", | ||
@@ -13,5 +13,5 @@ "keywords": [ | ||
], | ||
"repository": "https://github.com/casz/express-ipfilter", | ||
"repository": "https://github.com/jetersen/express-ipfilter", | ||
"license": "MIT", | ||
"author": "casz", | ||
"author": "jetersen", | ||
"main": "index.js", | ||
@@ -35,8 +35,6 @@ "types": "index.d.ts", | ||
"*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
"eslint --fix" | ||
], | ||
"*.{json,css,md}": [ | ||
"prettier --write", | ||
"git add" | ||
"prettier --write" | ||
] | ||
@@ -96,6 +94,6 @@ }, | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"husky": "^3.0.0", | ||
"jest": "^24.7.1", | ||
"lint-staged": "^9.0.0", | ||
"prettier": "^1.16.4" | ||
"husky": "^4.0.0", | ||
"jest": "^25.1.0", | ||
"lint-staged": "^10.0.0", | ||
"prettier": "^2.0.1" | ||
}, | ||
@@ -102,0 +100,0 @@ "engines": { |
@@ -80,2 +80,21 @@ # express-ipfilter: A light-weight IP address based filtering system | ||
Using wildcard ip ranges and nginx forwarding: | ||
```javascript | ||
let whitelist_ips = ['10.1.*.*', '123.??.34.8*'] // matches '10.1.76.32' and '123.77.34.89' | ||
let clientIp = function(req, res) { | ||
return req.headers['x-forwarded-for'] ? (req.headers['x-forwarded-for']).split(',')[0] : "" | ||
} | ||
app.use( | ||
ipFilter({ | ||
id: clientIp, | ||
forbidden: 'You are not authorized to access this page.', | ||
strict: false, | ||
filter: whitelist_ips, | ||
}) | ||
) | ||
``` | ||
## Error Handling | ||
@@ -82,0 +101,0 @@ |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
14795
165