Skip to content

Allow, Deny style access control for IP access validation

License

Notifications You must be signed in to change notification settings

mdbarr/ip-access-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ip-access-control

Allow, Deny style access control for IP access validation.

Installation

# NPM
npm install --save @hyperingenuity/ip-access-control

# Yarn
yarn add @hyperingenuity/ip-access-control

Usage

To create an access control validator for a given scheme:

const IPAccessControl = require('@hyperingenuity/ip-access-control');

const accessValidator = new IPAccessControl({
  order: 'deny, allow',
  allow: [ '0.0.0.0/0' ],
  deny: []
});

To validate a request IP against the validator:

const allowed = accessValidator.check('127.0.0.1'); // Boolean return value

About

Allow, Deny style access control for IP access validation

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published