1.0.2 • Published 4 years ago

secure-connection-module v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

secure-connection-module

前後端加解密用模組。

Related Repo

Getting Started

Installation

# Installation
$ npm install

# testing
$ npm run test

Usage

// Init with RSA-1024 public key API
const connection = await Connection.getInstance(url);

// Base get/delete
const userData = await connection.get(url);

// post/put with partial encryption
let postBody = { Account: 'test' ,Password: 'test' };
let postOption = { encrypt: ['Password'] }; //option style same as axios
const response = await connection.post(url, postBody, postOption);

//ppost/put with fully encryption
let postBody = { Account: 'test' ,Password: 'test' };
let postOption = { encrypt: 'all' };  //option style same as axios
const response = await connection.post(url, postBody, postOption);

Building

  • using babel with babel-preset-minify
npm run dist

References

axios - 0.18.0
cryptico-js - 1.1.0

License

TODO

  • add code testing coverage report
  • add auto reporting after every test runs
  • add github stickers for coverage and contributors
  • add build tools that could transform es6 to commonjs(to dist)