@safeguard-apis/sg-validator
v3.4.0
Published
SafeGuard Validator Library
Downloads
58
Readme
SafeGuard Device Auth Signature Validator
SafeGuard Validator Library
Installation
Using npm:
$ npm install --save @safeguard-apis/sg-validator
or using yarn:
$ yarn add @safeguard-apis/sg-validator
Usage
import { SafeGuardValidator } from "@safeguard-apis/sg-validator";
const sgValidator = new SafeGuardValidator(BACKEND_API_KEY);
const signedRequestParams = {
httpVerb: "HTTP_VERB",
domain: "DOMAIN"
};
const response = this.sgValidator.signature.validate(signedRequestParams, SG_SIGNATURE)
See API Documentation for more details.
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 npm install
Now your local machine is ready for development and testing.
Running the tests
$ docker-compose run --rm --no-deps app npm 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.