1.0.1 • Published 5 years ago

@happyhacking/sign v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

sign

Travis npm package Coveralls

Yet another Signature for S3 and OSS

Installation

yarn add @happyhacking/sign

Usage

import HackingSign from '@happyhacking/sign'

const options = {
  accessKeyId: '6MKOqxGiGU4AUk44',
  accessKeySecret: 'ufu7nS8kS59awNihtjSonMETLI0KLy',
  directory: 'demo/',
}

const oss = new HackingSign(options)

const key = 'z54AY7Jzpp.gif'
const signed = oss.sign('z54AY7Jzpp.gif')

const data = new FormData();
data.append('OSSAccessKeyId', signed.accessKeyId);
data.append('key', signed.key);
data.append('policy', signed.policy);
data.append('signature', signed.signature);
data.append('success_action_status', '201');
data.append('file', FILE);

...PUT YOUR HTTP REQUEST LOGICAL CODE HERE
1.0.1

5 years ago

1.0.0

5 years ago