0.66.11 • Published 7 years ago

@onehilltech/gatekeeper v0.66.11

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

Gatekeeper

OAuth 2.0 token server and module for Blueprint.js

npm version Build Status Dependencies Coverage Status

Installation

npm install @onehilltech/gatekeeper --save

Getting Started

Initial setup

First, run the setup script from the project directory:

./bin/gatekeeper-setup

This will register the gatekeeper-cli client, and other clients, with the server. The client registrations will be placed in ./gatekeeper under the project directory.

Defining the configuration

Define the configuration file gatekeeper.config.js to configure the module for your application:

module.exports = {
  token: {
    kind: 'jwt',
    options: {
      issuer: 'name-of-the-application',
      algorithm : 'RS256',
      secret: 'ssshhh'   // can replace with publicKey, privateKey properties
    }
  }
};

Defining Gatekeeper router endpoint

Define a route (or router) to import the Gatekeeper routes into the application:

// app/routers/EndpointRouter.js
const blueprint = require ('@onehilltech/blueprint')
  ;

module.exports = exports = {
  '/gatekeeper': blueprint ('router://@onehilltech/gatekeeper:v1')
};

Protecting routes

The router definition above will expose the Gatekeeper routers at /gatekeeper. Lastly, define the routes you want to protect using the gatekeeper.auth.bearer Blueprint policy. For example, you can protect all routes on a given path:

// EndpointRouters.js

module.exports = {
  '/v1': {
    policy: 'gatekeeper.auth.bearer'
  }
};

The router above will protect all routes under the /v1 path, which includes all routers located in app/routers/v1 directory. The client will need to define the Authorization header and include a generated token.

Next Steps

See the Wiki for more information.

0.66.11

7 years ago

0.66.9

7 years ago

0.66.8

7 years ago

0.66.7

7 years ago

0.66.6

7 years ago

0.66.5

7 years ago

0.66.4

7 years ago

0.66.3

7 years ago

0.66.2

7 years ago

0.66.1

7 years ago

0.66.0

7 years ago

0.65.0

7 years ago

0.64.8

7 years ago

0.64.7

7 years ago

0.64.6

7 years ago

0.64.5

7 years ago

0.64.4

7 years ago

0.64.3

7 years ago

0.64.2

7 years ago

0.64.1

7 years ago

0.64.0

7 years ago

0.63.0

7 years ago

0.62.0

7 years ago

0.61.1

7 years ago

0.61.0

7 years ago

0.60.0

7 years ago

0.59.5

7 years ago

0.59.4

7 years ago

0.59.3

7 years ago

0.59.2

7 years ago

0.59.1

7 years ago

0.59.0

7 years ago

0.58.2

7 years ago

0.58.1

7 years ago

0.58.0

7 years ago

0.57.5

7 years ago

0.57.4

7 years ago

0.57.3

7 years ago

0.57.2

7 years ago

0.57.1

7 years ago

0.57.0

7 years ago

0.56.3

7 years ago

0.56.2

7 years ago

0.56.1

7 years ago

0.56.0

7 years ago

0.55.1

7 years ago

0.55.0

7 years ago

0.54.4

7 years ago

0.54.3

7 years ago

0.54.2

7 years ago

0.54.1

7 years ago

0.54.0

7 years ago

0.53.0

7 years ago

0.52.0

7 years ago

0.51.3

7 years ago

0.51.2

7 years ago

0.51.1

7 years ago

0.50.9

7 years ago

0.50.8

7 years ago

0.50.7

7 years ago

0.50.5

7 years ago

0.50.4

7 years ago

0.50.3

7 years ago

0.50.2

7 years ago

0.50.1

7 years ago

0.50.0

7 years ago

0.49.1

7 years ago

0.49.0

7 years ago

0.48.2

7 years ago

0.48.1

7 years ago

0.48.0

7 years ago

0.47.0

7 years ago

0.46.1

7 years ago

0.46.0

7 years ago

0.45.2

7 years ago

0.45.1

7 years ago

0.45.0

7 years ago

0.44.0

7 years ago

0.43.0

7 years ago

0.42.0

7 years ago

0.41.0

8 years ago

0.40.2

8 years ago

0.40.1

8 years ago

0.40.0

8 years ago

0.39.1

8 years ago

0.39.0

8 years ago

0.38.1

8 years ago

0.38.0

8 years ago

0.37.0

8 years ago

0.36.1

8 years ago

0.36.0

8 years ago

0.35.0

8 years ago

0.34.1

8 years ago

0.34.0

8 years ago

0.33.0

8 years ago

0.32.0

8 years ago

0.31.1

8 years ago

0.31.0

8 years ago

0.30.3

8 years ago

0.30.2

8 years ago

0.30.1

8 years ago

0.30.0

8 years ago

0.29.2

8 years ago

0.29.1

8 years ago

0.29.0

8 years ago

0.28.10

8 years ago

0.28.9

8 years ago

0.28.8

8 years ago

0.28.7

8 years ago

0.28.6

8 years ago

0.28.5

8 years ago

0.28.4

8 years ago

0.28.3

8 years ago

0.28.2

8 years ago

0.28.1

8 years ago

0.28.0

8 years ago

0.27.4

8 years ago

0.27.3

8 years ago

0.27.2

8 years ago

0.27.1

8 years ago

0.27.0

8 years ago

0.26.2

8 years ago

0.26.1

8 years ago

0.26.0

8 years ago

0.25.1

8 years ago

0.25.0

8 years ago

0.24.6

8 years ago

0.24.4

8 years ago

0.24.3

8 years ago

0.24.2

8 years ago

0.24.1

8 years ago

0.24.0

8 years ago

0.23.2

8 years ago

0.23.1

8 years ago

0.23.0

8 years ago

0.22.3

8 years ago

0.22.2

8 years ago

0.22.1

8 years ago

0.22.0

8 years ago

0.21.7

8 years ago

0.21.6

8 years ago

0.21.5

8 years ago

0.21.4

8 years ago

0.21.3

8 years ago

0.21.2

8 years ago

0.21.1

8 years ago

0.21.0

8 years ago

0.20.3

8 years ago

0.20.2

8 years ago

0.20.1

8 years ago

0.20.0

8 years ago

0.19.0

8 years ago

0.18.0

8 years ago

0.17.1

8 years ago

0.17.0

8 years ago

0.16.2

8 years ago

0.16.1

8 years ago

0.16.0

8 years ago

0.15.0

8 years ago

0.14.0

8 years ago

0.13.0

8 years ago

0.12.5

9 years ago

0.12.4

9 years ago

0.12.3

9 years ago

0.12.2

9 years ago

0.12.1

9 years ago

0.12.0

9 years ago

0.11.3

9 years ago

0.11.1

9 years ago

0.11.0

9 years ago

0.10.3

9 years ago

0.10.2

9 years ago

0.10.1

9 years ago