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

facet-gatekeeper

v0.1.1

Published

Node.js and MongoDB authentication and role based access control system. Key features are:

Downloads

1

Readme

gatekeeper

Node.js and MongoDB authentication and role based access control system. Key features are:

  • framework agnostic but exposes middleware functions that integrate easily with existing frameworks (such as ExpressJS, Koa and Flatiron). alpha note: only express style middleware is currently supported
  • provides API authentication via basic auth or JSON web tokens (jwt)
  • provides customer/account authentication
  • exposes robust schemas that include custom data fields
  • optionally extend users and roles with custom permission levels per action
  • decoupled, event driven communication between modules allowing custom replacements to be dropped in
  • support for multi tenant applications

When combined with other Facet modules (such as response and catalog) fully featured JSON APIs can be exposed out of the box with no customization required.

There are two main ways of using this module:

  1. In auto route binding mode, resulting in complete CRUD JSON web service out of the box.
  2. As a standalone library in custom piecemeal integrations (no auto route binding).

This module is currently in beta. See the TODO section for details on missing functionality

Examples

Auto route binding

coming soon...

Standalone usage

coming soon...

Setup

The following steps will get gatekeeper running locally:

  1. Install mongodb and start the service.
  2. run npm install facet-gatekeeper --save in your project's root directory

You'll likely want to secure some or all of your API. To setup your first API user run node install and answer the prompts.

Set GatekeeperAPI.apiAuthMiddleware() to be used by your app/router. If you're creating an express app, you can do so by adding app.use(GatekeeperAPI.apiAuthMiddleware());. Be sure to include that middleware call before declaring/binding any routes you wish to restrict access to.

If you don't want to require api authentication for usage you should instead use GatekeeperAPI.facetInit() to initialize the module with the request lifecycle objects. The facetInit() function is available to all facet modules and only needs to be used once, regardless of the number of facet modules in use.

Configuration

See docs.

API

Events emitted/subscribed to

See docs.

CRUD functions

See docs.

Overriding default functionality

coming soon

TODO

  • bug fixes
  • custom validation for multitenancy
  • set up related model routes (ie /users//groups)
  • write middleware for koa and flatiron
  • implement password retrieval
  • implement oauth
  • finish writing unit tests
  • provide sample applications