Checks if the incoming request has is allowed to access the endpoint.
It uses a configuration that must be an object with the following structure
var object = {
access: {
verifyOrigin: true,
apikeys: [{
origin: 'http://google.com',
key: '1234'
}, {
origin: 'http://bing.com',
key: '12345'
}]
}
}Setting verifyOrigin to true, makes accessVerifier to check that not only the key exists in the configuration but also the request origin header matches the origin field.
Setting verifyOrigin to false, makes the accessVerifier to only search if the given api exists in the configuration.
Download node at nodejs.org and install it, if you haven't already.
npm install apier-accessverifier --saveType: object
Init method should be used on server start, to initialize the module.
Check for example configuration above.
Used as middleware to make the actual verification.
npm install
npm test- apier-responsebuilder: Builds and sends the response of apier.
- reqlog: A simple Node.js logger. Very closely attached to a request.
- eslint: An AST-based pattern checker for JavaScript.
- eslint-config-google: ESLint shareable config for the Google style
MIT
Generated by package-json-to-readme
