npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dalane/access-control

v0.5.0

Published

An attribute based access control system for javascript applications

Downloads

3

Readme

Attribute Based Access Control libary for your Node.js apps

This package allows you to start with a basic implementation of Attribute Based Access Control (ABAC) in a node application. It is written using TypeScript so comes with TypeScript definitions for Typescript development.

Installation

The package is available for installation from npmjs.com.

npm install --save @dalane/access-control

Getting Started with ABAC

Access control using an Attribute Based Access Control system is about authorising (allowing or denying) access to a resource, system, etc by evaluating attributes of a request against policies instead of roles.

These policies combine boolean rules that allow the combination of various attributes (about the user requesting access, the resource being accessed, what action is requested, or the environment within which the request is being made).

For a summary of ABAC see the wikipedia article or for a detailed introduction see the NIST "Guide to Attribute Based Access Control (ABAC) Definition and Considerations".

The components of an ABAC system

The components of an Attribute Based Access Control System are:

| Component | Description |--- |--- | Policies | These define the attributes and rules for determining access to the application and resources. | Policy Administration Point (PAP) | The PAP is where policies are managed. | Policy Decision Point (PDP) | The PDP takes an Access Request, requests the PAP to find and return policies that match the Access Request, validates each returned policy against the Access Request, and then returns an Access Response with an access decision. | Access Request | This contains the attributes to be validated against policies by the PDP. These attributes could include details on the user making the request, the resource being accessed and details on the action to be applied to the resource. | Access Response | The Access Response is returned by the Policy Decision Point and contains the decision made by the PDP. It will include an Access Decision indicating that the request is allowed or denied. It may also return a not applicable decision indicating that no matching policies were found. | Policy Execution Point (PEP) | The PEP is responsible for creating the Access Request, passing it to the PDP and handling the Access Response. | Policy Information Point (PIP) | PIPs are used by the PDP to populate any attributes required by the policy rules that are missing from an Access Request.

How this libary implements ABAC

This library simplifies a lot of an Attribute Based Access Control system however there are still a lot of components, types and interfaces to make it all work together. For example, the Policy Administration Point only retrieves policies for the Policy Decision Point, there is no management.

The style of policy documents is similar to the AWS policy files instead of the XAMCL format (using XML) referenced in the Wikipedia article. They are easier to read and understand, and don't have all the extra overhead of an XML document.

Policies and the Policy Decision Point do not support the use of Obligations. These would be sent to the Policy Execution Point as part of the Access Response which the PEP would be obligated to undertake.

There is no implementation for Policy Information Points at this time. Each Access Request needs to contain all of the information that would be needed to validate the request against the relevant policies.

Examples

A small demonstration HTTP web server is available in the examples folder. It can be run in the terminal using npm run example and accessed at http://localhost:8080.

Documentation

Detailed documentation can be found in the readme folder.

Improvements

This library is under active development and will continue to evolve until version 1.0.0 is published. Any types, interface and functions may change without any deprecation warnings.

A goal is to implement Obligations and Policy Information Points.

Suggestions, bug reports and pull requests to fix bugs or implement improvements are welcome.