@safeguard-apis/sg-validator-express
v2.2.0
Published
SafeGuard Validator Express
Downloads
54
Readme
SafeGuard Device Auth Signature Validator Express
SafeGuard Validator Express Middleware
Installation
Using npm:
$ npm install --save @safeguard-apis/sg-validator
$ npm install --save @safeguard-apis/sg-validator-express
or using yarn:
$ yarn add @safeguard-apis/sg-validator
$ yarn add @safeguard-apis/sg-validator-express
Usage
import { SafeGuardValidator } from "@safeguard-apis/sg-validator";
const signedRequestParams = {
httpVerb: "HTTP_VERB",
domain: "DOMAIN"
};
const safeGuardValidator = new SafeGuardValidator(SAFEGUARD_API_KEY);
const response = this.safeGuardValidator.signature.validate(signedRequestParams, SG_SIGNATURE);
/* true */
Contributing
Setup development environment
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
Install npm dependencies
$ docker-compose run --rm --no-deps app yarn
Now your local machine is ready for development and testing.
Running the tests
$ docker-compose run --rm --no-deps app yarn test
Deployment
Pushes a commit to master and generate a Release 1.2.3, the npm-publish action will publish the package to the npm registry.