@simplus/hornbill
v1.0.6
Published
A configurable firewall for node applications
Downloads
6
Readme
Hornbill
A configurable firewall for node applications
Install
npm install --save @simplus/hornbill
Usage
import * as express from "express"
import {Hornbill} from "@simplus/hornbill"
const app = expess()
const hb = new Hornbill({
getPermissions : (s, cb)=>{
cb(["/some/permission"]);
}
})
hb.useRule("/collection/users/","/collection/users/own/get")
hb.useRule("/collection/users/:id","/collection/users/all/get")
hb.useRule("/collection/users/","/collection/users/yehudi/profile/get")
hb.useRule("/default/test","/default/show")
hb.useFirewall("/connected", Firewalls.requireAuthentication())
hb.useFirewall("/passes", Firewalls.$bool(true))
hb.useFirewall("/blocked", Firewalls.$bool(false))
hb.install(app)