3.5.0 • Published 10 years ago

cti-dealer-auth-middleware v3.5.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

cti-dealer-auth-middleware

Middleware to embed auth object, which implements permissions' checks, into the request

Usage

const dealerAuthMiddleware = require( 'cti-dealer-auth-middleware' );
const restify = require( 'restify' );

const server = restify.createServer();

// Note: authentication meadleware must come first
server.use( dealerAuthMiddleware );

Testing code that uses this library

I haven't found a great way to do this, so for now I've provided nocker, which is a tool that sets up nock to mock out the calls that this library will make. E.g.:

const nock = require( 'nock' );
const nocker = require( 'cti-dealer-auth-middleware/nocker' );

nocker.userDealerScopes( 'some-user', 'some-dealer', [ 'some-scope', 'other-scope'] );

// Run your test
3.5.0

10 years ago

3.4.1

10 years ago

3.4.0

10 years ago

3.3.0

10 years ago

3.2.0

10 years ago

3.1.0

10 years ago

3.0.0

10 years ago

3.0.0-cpacey-2

10 years ago

3.0.0-cpacey-1

10 years ago

3.0.0-cpacey-0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago