express-ipfilter
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -19,2 +19,3 @@ import express = require('express'); | ||
logLevel?: 'all' | 'deny' | 'allow'; | ||
logF?: (message: string) => void; | ||
mode?: 'deny' | 'allow'; | ||
@@ -21,0 +22,0 @@ // `@types/proxy-addr` does not export the `trust` parameter type |
{ | ||
"name": "express-ipfilter", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "A light-weight IP address based filtering system", | ||
@@ -88,8 +88,8 @@ "keywords": [ | ||
"devDependencies": { | ||
"eslint": "^6.0.0", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-plugin-jest": "^23.0.2", | ||
"eslint": "^7.1.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"husky": "^4.0.0", | ||
"jest": "^25.1.0", | ||
"jest": "^26.0.1", | ||
"lint-staged": "^10.0.0", | ||
@@ -96,0 +96,0 @@ "prettier": "^2.0.1" |
# express-ipfilter: A light-weight IP address based filtering system | ||
This package provides easy IP based access control. This can be achieved either by blacklisting certain IPs and whitelisting all others, or whitelisting certain IPs and blacklisting all others. | ||
This package provides easy IP based access control. This can be achieved either by denying certain IPs and allowing all others, or allowing certain IPs and denying all others. | ||
@@ -13,3 +13,3 @@ ## Installation | ||
Blacklisting certain IP addresses, while allowing all other IPs: | ||
Denying certain IP addresses, while allowing all other IPs: | ||
@@ -21,3 +21,3 @@ ```javascript | ||
// Blacklist the following IPs | ||
// Allow the following IPs | ||
const ips = ['127.0.0.1'] | ||
@@ -30,3 +30,3 @@ | ||
Whitelisting certain IP addresses, while denying all other IPs: | ||
Allowing certain IP addresses, while denying all other IPs: | ||
@@ -39,3 +39,3 @@ ```javascript | ||
// Whitelist the following IPs | ||
// Allow the following IPs | ||
const ips = ['127.0.0.1'] | ||
@@ -87,3 +87,3 @@ | ||
```javascript | ||
let whitelist_ips = ['10.1.*.*', '123.??.34.8*'] // matches '10.1.76.32' and '123.77.34.89' | ||
let allowlist_ips = ['10.1.*.*', '123.??.34.8*'] // matches '10.1.76.32' and '123.77.34.89' | ||
@@ -96,6 +96,5 @@ let clientIp = function(req, res) { | ||
ipFilter({ | ||
id: clientIp, | ||
detectIp: clientIp, | ||
forbidden: 'You are not authorized to access this page.', | ||
strict: false, | ||
filter: whitelist_ips, | ||
filter: allowlist_ips, | ||
}) | ||
@@ -153,3 +152,3 @@ ) | ||
ipfilter(ids, { detectIp: customDetection }) | ||
ipfilter(ips, { detectIp: customDetection }) | ||
``` | ||
@@ -156,0 +155,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
219
14781
164
1