lib/firewall.js
function Firewall(name, path, authenticationHandler, successHandler, failureHandler) {
    this.name      = name;
    this.path      = utils.ensureRegexp(path);
    this.rules     = [];

    // configure handlers
    this.authenticationHandler = authenticationHandler || function (req, res, next) {
        res.status(401);
        return res.redirect('/login');
    };
    this.successHandler = successHandler;
    this.failureHandler = failureHandler || function (req, res, next) {
        return res.send(403, 'forbidden');
    };

    this.logger = debug;

    this.strategies = {
        role: strategy.role
    };
}
function Firewall(name, path, authenticationHandler, successHandler, failureHandler) {
    this.name      = name;
    this.path      = utils.ensureRegexp(path);
    this.rules     = [];

    // configure handlers
    this.authenticationHandler = authenticationHandler || function (req, res, next) {
        res.status(401);
        return res.redirect('/login');
    };
    this.successHandler = successHandler;
    this.failureHandler = failureHandler || function (req, res, next) {
        return res.send(403, 'forbidden');
    };

    this.logger = debug;

    this.strategies = {
        role: strategy.role
    };
}
function Firewall ( name , path , authenticationHandler , successHandler , failureHandler ) { this . name = name ; this . path = utils . ensureRegexp ( path ) ; this . rules = [ ] ; // configure handlers this . authenticationHandler = authenticationHandler || function ( req , res , next ) { res . status ( 401 ) ; return res . redirect ( '/login' ) ; } ; this . successHandler = successHandler ; this . failureHandler = failureHandler || function ( req , res , next ) { return res . send ( 403 , 'forbidden' ) ; } ; this . logger = debug ; this . strategies = { role : strategy . role } ; }
The firewall is a simple container for multiple url based authorization rules.

@param {string}        name                  The firewall name
@param {string|RegExp} path                  The firewall will only apply on request url matching this value
@param {function|null} authenticationHandler Function to call when login is required
@param {function|null} successHandler        Function to call when access is granted
@param {function|null} failureHandler        Function to call when access is denied
@constructor
The firewall is a simple container for multiple url based authorization rules .