0.66.11 • Published 8 years ago

@onehilltech/gatekeeper v0.66.11

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
8 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

8 years ago

0.66.9

8 years ago

0.66.8

8 years ago

0.66.7

8 years ago

0.66.6

8 years ago

0.66.5

8 years ago

0.66.4

8 years ago

0.66.3

8 years ago

0.66.2

8 years ago

0.66.1

8 years ago

0.66.0

8 years ago

0.65.0

8 years ago

0.64.8

8 years ago

0.64.7

8 years ago

0.64.6

8 years ago

0.64.5

8 years ago

0.64.4

8 years ago

0.64.3

8 years ago

0.64.2

8 years ago

0.64.1

8 years ago

0.64.0

8 years ago

0.63.0

8 years ago

0.62.0

8 years ago

0.61.1

8 years ago

0.61.0

8 years ago

0.60.0

8 years ago

0.59.5

8 years ago

0.59.4

8 years ago

0.59.3

8 years ago

0.59.2

8 years ago

0.59.1

8 years ago

0.59.0

8 years ago

0.58.2

8 years ago

0.58.1

8 years ago

0.58.0

8 years ago

0.57.5

8 years ago

0.57.4

8 years ago

0.57.3

8 years ago

0.57.2

8 years ago

0.57.1

8 years ago

0.57.0

8 years ago

0.56.3

8 years ago

0.56.2

8 years ago

0.56.1

8 years ago

0.56.0

8 years ago

0.55.1

8 years ago

0.55.0

8 years ago

0.54.4

8 years ago

0.54.3

8 years ago

0.54.2

8 years ago

0.54.1

8 years ago

0.54.0

8 years ago

0.53.0

8 years ago

0.52.0

8 years ago

0.51.3

8 years ago

0.51.2

8 years ago

0.51.1

8 years ago

0.50.9

8 years ago

0.50.8

8 years ago

0.50.7

8 years ago

0.50.5

8 years ago

0.50.4

8 years ago

0.50.3

8 years ago

0.50.2

8 years ago

0.50.1

8 years ago

0.50.0

8 years ago

0.49.1

8 years ago

0.49.0

8 years ago

0.48.2

8 years ago

0.48.1

8 years ago

0.48.0

8 years ago

0.47.0

8 years ago

0.46.1

9 years ago

0.46.0

9 years ago

0.45.2

9 years ago

0.45.1

9 years ago

0.45.0

9 years ago

0.44.0

9 years ago

0.43.0

9 years ago

0.42.0

9 years ago

0.41.0

9 years ago

0.40.2

9 years ago

0.40.1

9 years ago

0.40.0

9 years ago

0.39.1

9 years ago

0.39.0

9 years ago

0.38.1

9 years ago

0.38.0

9 years ago

0.37.0

9 years ago

0.36.1

9 years ago

0.36.0

9 years ago

0.35.0

9 years ago

0.34.1

9 years ago

0.34.0

9 years ago

0.33.0

9 years ago

0.32.0

9 years ago

0.31.1

9 years ago

0.31.0

9 years ago

0.30.3

9 years ago

0.30.2

9 years ago

0.30.1

9 years ago

0.30.0

9 years ago

0.29.2

9 years ago

0.29.1

9 years ago

0.29.0

9 years ago

0.28.10

9 years ago

0.28.9

9 years ago

0.28.8

9 years ago

0.28.7

9 years ago

0.28.6

9 years ago

0.28.5

9 years ago

0.28.4

9 years ago

0.28.3

9 years ago

0.28.2

9 years ago

0.28.1

9 years ago

0.28.0

9 years ago

0.27.4

9 years ago

0.27.3

9 years ago

0.27.2

9 years ago

0.27.1

9 years ago

0.27.0

9 years ago

0.26.2

9 years ago

0.26.1

9 years ago

0.26.0

9 years ago

0.25.1

9 years ago

0.25.0

9 years ago

0.24.6

9 years ago

0.24.4

9 years ago

0.24.3

9 years ago

0.24.2

9 years ago

0.24.1

9 years ago

0.24.0

9 years ago

0.23.2

9 years ago

0.23.1

9 years ago

0.23.0

9 years ago

0.22.3

9 years ago

0.22.2

9 years ago

0.22.1

9 years ago

0.22.0

9 years ago

0.21.7

9 years ago

0.21.6

9 years ago

0.21.5

9 years ago

0.21.4

9 years ago

0.21.3

9 years ago

0.21.2

9 years ago

0.21.1

9 years ago

0.21.0

9 years ago

0.20.3

9 years ago

0.20.2

9 years ago

0.20.1

9 years ago

0.20.0

9 years ago

0.19.0

9 years ago

0.18.0

9 years ago

0.17.1

9 years ago

0.17.0

9 years ago

0.16.2

9 years ago

0.16.1

9 years ago

0.16.0

9 years ago

0.15.0

9 years ago

0.14.0

9 years ago

0.13.0

10 years ago

0.12.5

10 years ago

0.12.4

10 years ago

0.12.3

10 years ago

0.12.2

10 years ago

0.12.1

10 years ago

0.12.0

10 years ago

0.11.3

10 years ago

0.11.1

10 years ago

0.11.0

10 years ago

0.10.3

10 years ago

0.10.2

10 years ago

0.10.1

10 years ago