2.0.0 • Published 6 years ago

@froice/border-control v2.0.0

Weekly downloads
5
License
ISC
Repository
-
Last release
6 years ago

Border Control

What is border control

Border control is Froice Limited's solution to remote user management and group entitlement, it allows developers to restrict their applications to groups adding people to groups as they need.

Unfortunately it is not feasible to allow for developers to programatically create groups so that is restricted to our GUI which can be found at fuzz.froice.co.uk at our go live

How do I use it

Setting up

const BorderControl = require('@froice/border-control');

const b = new BorderControl({
  api: 'localhost:3001',
  secure: true // This configures whether to use https or http
});

Validating user against group

b.checkGroup(
  '<SECURE_JWT>',
  '<GROUP_NAME>',
  '<REMOTE_IP>'
).then(() => {
  console.log("AUTHORISED");
}).catch(err => {
  console.error("UNAUTHORISED");
})

Login a user

N.B. This will be deprecated in the next major version change in favour of a redirect methodology.

b.loginUser('<EMAIL>', '<PASSWORD>', '<REMOTE_IP>')
.then(() => {
  console.log('Login');
}).catch(() => {
  console.log('Reject');
})
2.0.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago