Skip to content

Instantly share code, notes, and snippets.

View Tim-Zhang's full-sized avatar
🏠
Working from home

Tim Zhang Tim-Zhang

🏠
Working from home
  • Ant Group
  • China
View GitHub Profile
@Tim-Zhang
Tim-Zhang / exec.js
Created September 7, 2017 14:04
Issue a `hyper exec` from API in node
const aws4 = require('hyper-aws4')
const https = require('https')
const credential = require('./credential')
const createError = (status, message) => {
const error = new Error(message)
error.status = status
return error
}
import _ from 'lodash'
import crypto from 'crypto'
import urllib from 'url'
import querystring from 'querystring'
const SignedHeaders = 'content-type;host;x-hyper-content-sha256;x-hyper-date'
const HeaderContentHash = 'X-Hyper-Content-Sha256'
const Algorithm = 'HYPER-HMAC-SHA256'
const Region = 'us-west-1'
const Service = 'hyper'