franciscogouveia/hapi-rbac


RBAC (Rule Based Access Control) for hapijs

License: ISC

Language: JavaScript

Keywords: hapi, nodejs, rbac, xacml


hapi-rbac

npm version Build Status Coverage Status Dependency Status

A Rule Based Access Control module for hapi.

This is inspired by the XACML policies.

Versions

  • 3.0.0 - Add Hapi17 support
  • 2.3.0 - Ability to use RegExp to match target values. Ability to match field to field. (updated rbac-core to 3.0.0)
  • 2.2.0 - Customized error responses
  • 2.1.0 - Usage of user defined data retrievals for target matching. Nested properties on target keys.
  • 2.0.0 - Simplified target (updated rbac-core to 2.0.0)
  • 1.3.0 - Use more data for target matching
  • 1.2.0 - Global default configuration is now possible
  • 1.1.0 - Added ability to dynamically retrieve policies for the route
  • 1.0.0 - Since this version, only node ^4.0 and hapi ^12.0.0 is supported. All the functionality and syntax remains the same.

How to use it

First, install

npm install --save hapi-rbac

Then, import the module in your hapi server instance.

async () => {
    try {
      await server.register({
        plugin: require('hapi-rbac'),
        options: {
          // rbac-option See API reference
        }
      });
    } catch(er) {
      // ...
    }
}

Then, configure your policies. Check the API Reference.

Learn more about Rule Based Access Control

To have a better idea of how this works, you can check my Bachelor's project presentation about XACML here (english), or here (portuguese).

Even though this plugin doesn't implement the XACML specification, it was based on its policies.

Project Statistics

Sourcerank 9
Repository Size 91.8 KB
Stars 90
Forks 19
Watchers 6
Open issues 3
Dependencies 228
Contributors 4
Tags 10
Created
Last updated
Last pushed

Top Contributors See all

Francisco Gouveia Adrien Becchis Jeff Mackay Hazkiel Gabriel

Packages Referencing this Repo

hapi-rbac
Rule Based Access Control for Hapijs
Latest release 3.0.0 - Updated - 90 stars

Recent Tags See all

v3.0.0 February 24, 2019
v2.3.0 March 04, 2017
v2.2.2 September 23, 2016
v2.2.1 September 23, 2016
v2.2.0 May 25, 2016
v2.1.0 May 22, 2016
v2.0.1 March 01, 2016
v2.0.0 February 17, 2016
v1.3.1 February 13, 2016
v1.3.0 January 30, 2016

Something wrong with this page? Make a suggestion

Last synced: 2019-02-24 16:08:51 UTC

Login to resync this repository