New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aws-sigv4

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-sigv4 - npm Package Compare versions

Comparing version 2.0.0-0 to 2.0.0

.eslintignore

40

lib/node/index.js

@@ -36,12 +36,14 @@ (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap

/******/
/******/ // identity function for calling harmory imports with the correct context
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmory exports
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };

@@ -70,29 +72,29 @@ /******/

/* 0 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hash=void 0;exports.formatDateTime=formatDateTime;exports.buildCanonicalRequest=buildCanonicalRequest;exports.buildStringToSign=buildStringToSign;exports.preCalculateSigningKey=preCalculateSigningKey;exports.preCalculatedSign=preCalculatedSign;exports.sign=sign;exports.buildAuthorization=buildAuthorization;var _deps=__webpack_require__(1);exports.hash=_deps.hash;const algorithm='AWS4-HMAC-SHA256',emptyHash='e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';function formatDateTime(a){return a.toISOString().replace(/-|:|(\.\d+)/g,'')}function buildCanonicalRequest(a,b,c,d,e){let f=5<arguments.length&&void 0!==arguments[5]?arguments[5]:'';return(f?(0,_deps.hash)(f):Promise.resolve(emptyHash)).then(g=>[a,b,c,d,'',e,g].join('\n'))}function buildStringToSign(a,b,c){return[algorithm,a,b,c].join('\n')}function preCalculateSigningKey(a,b,c,d){const e=[b,c,d,'aws4_request'];let f=Promise.resolve(`AWS4${a}`);for(const g of e)f=f.then(h=>(0,_deps.hmac)(h,g));return f}function preCalculatedSign(a,b){return(0,_deps.hmac)(a,b,'hex')}function sign(a,b,c,d,e){return preCalculateSigningKey(a,b,c,d).then(f=>preCalculatedSign(f,e))}function buildAuthorization(a,b,c,d){return algorithm+' '+[['Credential',`${a}/${b}`],['SignedHeaders',c],['Signature',d]].map(e=>e.join('=')).join(', ')}
Object.defineProperty(exports,'__esModule',{value:!0}),exports.hash=void 0,exports.formatDateTime=formatDateTime,exports.buildCanonicalRequest=buildCanonicalRequest,exports.buildStringToSign=buildStringToSign,exports.preCalculateSigningKey=preCalculateSigningKey,exports.preCalculatedSign=preCalculatedSign,exports.sign=sign,exports.buildAuthorization=buildAuthorization;var _deps=__webpack_require__(1);exports.hash=_deps.hash;var algorithm='AWS4-HMAC-SHA256',emptyHash='e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';function formatDateTime(a){return a.toISOString().replace(/-|:|(\.\d+)/g,'')}function buildCanonicalRequest(a,b,c,d,e){var f=5<arguments.length&&arguments[5]!==void 0?arguments[5]:'';return(f?(0,_deps.hash)(f):Promise.resolve(emptyHash)).then(function(g){return[a,b,c,d,'',e,g].join('\n')})}function buildStringToSign(a,b,c){return[algorithm,a,b,c].join('\n')}function preCalculateSigningKey(a,b,c,d){var e=[b,c,d,'aws4_request'],f=Promise.resolve(`AWS4${a}`),g=function _loop(m){f=f.then(function(n){return(0,_deps.hmac)(n,m)})},h=!0,i=!1,j=void 0;try{for(var l,m,k=e[Symbol.iterator]();!(h=(l=k.next()).done);h=!0)m=l.value,g(m)}catch(m){i=!0,j=m}finally{try{!h&&k.return&&k.return()}finally{if(i)throw j}}return f}function preCalculatedSign(a,b){return(0,_deps.hmac)(a,b,'hex')}function sign(a,b,c,d,e){return preCalculateSigningKey(a,b,c,d).then(function(f){return preCalculatedSign(f,e)})}function buildAuthorization(a,b,c,d){return algorithm+' '+[['Credential',`${a}/${b}`],['SignedHeaders',c],['Signature',d]].map(function(e){return e.join('=')}).join(', ')}
/***/ },
/***/ }),
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.normalize=void 0;var _path=__webpack_require__(3);Object.defineProperty(exports,'normalize',{enumerable:!0,get:function get(){return _path.normalize}});exports.hmac=hmac;exports.hash=hash;var _crypto=__webpack_require__(2);const algorithm='sha256';function hmac(a,b){let c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:'binary';return Promise.resolve((0,_crypto.createHmac)(algorithm,a).update(b).digest(c))}function hash(a){return Promise.resolve((0,_crypto.createHash)(algorithm).update(a).digest('hex'))}
Object.defineProperty(exports,'__esModule',{value:!0}),exports.normalize=void 0;var _path=__webpack_require__(3);Object.defineProperty(exports,'normalize',{enumerable:!0,get:function get(){return _path.normalize}}),exports.hmac=hmac,exports.hash=hash;var _crypto=__webpack_require__(2),algorithm='sha256';function hmac(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:'binary';return Promise.resolve((0,_crypto.createHmac)(algorithm,a).update(b).digest(c))}function hash(a){return Promise.resolve((0,_crypto.createHash)(algorithm).update(a).digest('hex'))}
/***/ },
/***/ }),
/* 2 */
/***/ function(module, exports) {
/***/ (function(module, exports) {
module.exports = require("crypto");
/***/ },
/***/ }),
/* 3 */
/***/ function(module, exports) {
/***/ (function(module, exports) {
module.exports = require("path");
/***/ },
/***/ }),
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {

@@ -102,4 +104,4 @@ module.exports = __webpack_require__(0);

/***/ }
/***/ })
/******/ ])));
//# sourceMappingURL=index.js.map

@@ -46,12 +46,14 @@ (function webpackUniversalModuleDefinition(root, factory) {

/******/
/******/ // identity function for calling harmory imports with the correct context
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmory exports
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };

@@ -80,17 +82,17 @@ /******/

/* 0 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hash=void 0;exports.formatDateTime=formatDateTime;exports.buildCanonicalRequest=buildCanonicalRequest;exports.buildStringToSign=buildStringToSign;exports.preCalculateSigningKey=preCalculateSigningKey;exports.preCalculatedSign=preCalculatedSign;exports.sign=sign;exports.buildAuthorization=buildAuthorization;var _deps=__webpack_require__(1);exports.hash=_deps.hash;const algorithm='AWS4-HMAC-SHA256',emptyHash='e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';function formatDateTime(a){return a.toISOString().replace(/-|:|(\.\d+)/g,'')}function buildCanonicalRequest(a,b,c,d,e){let f=5<arguments.length&&void 0!==arguments[5]?arguments[5]:'';return(f?(0,_deps.hash)(f):Promise.resolve(emptyHash)).then(g=>[a,b,c,d,'',e,g].join('\n'))}function buildStringToSign(a,b,c){return[algorithm,a,b,c].join('\n')}function preCalculateSigningKey(a,b,c,d){const e=[b,c,d,'aws4_request'];let f=Promise.resolve(`AWS4${a}`);for(const g of e)f=f.then(h=>(0,_deps.hmac)(h,g));return f}function preCalculatedSign(a,b){return(0,_deps.hmac)(a,b,'hex')}function sign(a,b,c,d,e){return preCalculateSigningKey(a,b,c,d).then(f=>preCalculatedSign(f,e))}function buildAuthorization(a,b,c,d){return algorithm+' '+[['Credential',`${a}/${b}`],['SignedHeaders',c],['Signature',d]].map(e=>e.join('=')).join(', ')}
Object.defineProperty(exports,'__esModule',{value:!0}),exports.hash=void 0,exports.formatDateTime=formatDateTime,exports.buildCanonicalRequest=buildCanonicalRequest,exports.buildStringToSign=buildStringToSign,exports.preCalculateSigningKey=preCalculateSigningKey,exports.preCalculatedSign=preCalculatedSign,exports.sign=sign,exports.buildAuthorization=buildAuthorization;var _deps=__webpack_require__(1);exports.hash=_deps.hash;var algorithm='AWS4-HMAC-SHA256',emptyHash='e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';function formatDateTime(a){return a.toISOString().replace(/-|:|(\.\d+)/g,'')}function buildCanonicalRequest(a,b,c,d,e){var f=5<arguments.length&&arguments[5]!==void 0?arguments[5]:'';return(f?(0,_deps.hash)(f):Promise.resolve(emptyHash)).then(function(g){return[a,b,c,d,'',e,g].join('\n')})}function buildStringToSign(a,b,c){return[algorithm,a,b,c].join('\n')}function preCalculateSigningKey(a,b,c,d){var e=[b,c,d,'aws4_request'],f=Promise.resolve(`AWS4${a}`),g=function _loop(m){f=f.then(function(n){return(0,_deps.hmac)(n,m)})},h=!0,i=!1,j=void 0;try{for(var l,m,k=e[Symbol.iterator]();!(h=(l=k.next()).done);h=!0)m=l.value,g(m)}catch(m){i=!0,j=m}finally{try{!h&&k.return&&k.return()}finally{if(i)throw j}}return f}function preCalculatedSign(a,b){return(0,_deps.hmac)(a,b,'hex')}function sign(a,b,c,d,e){return preCalculateSigningKey(a,b,c,d).then(function(f){return preCalculatedSign(f,e)})}function buildAuthorization(a,b,c,d){return algorithm+' '+[['Credential',`${a}/${b}`],['SignedHeaders',c],['Signature',d]].map(function(e){return e.join('=')}).join(', ')}
/***/ },
/***/ }),
/* 1 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});exports.hmac=hmac;exports.hash=hash;const crypto=window.crypto||window.msCrypto,subtle=crypto.subtle||crypto.webkitSubtle,algorithm='sha-256';const normalize=exports.normalize=encodeURI;function toHex(a){const b=new Uint8Array(a);let c='';for(let d=0;d<b.length;++d){const e=b[d].toString(16);c+=`${2>e.length?'0':''}${e}`}return c}const toBinary='TextEncoder'in window?a=>new TextEncoder().encode(a):a=>{const b=a.length,c=new ArrayBuffer(2*b),d=new Uint16Array(c);for(let e=0;e<b;e++)d[e]=a.charCodeAt(e);return c},hashOptions={name:algorithm},algorithmSign={name:'HMAC',hash:hashOptions};function hmac(a,b){let c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:'binary';return subtle.importKey('raw','string'==typeof a?toBinary(a):a,algorithmSign,!1,['sign']).then(d=>subtle.sign(algorithmSign,d,toBinary(b))).then(d=>'binary'===c?d:toHex(d))}function hash(a){return subtle.digest(hashOptions,toBinary(a)).then(toHex)}
Object.defineProperty(exports,'__esModule',{value:!0}),exports.hmac=hmac,exports.hash=hash;var crypto=window.crypto||window.msCrypto,subtle=crypto.subtle||crypto.webkitSubtle,algorithm='sha-256',normalize=exports.normalize=encodeURI;function toHex(a){for(var e,b=new Uint8Array(a),c='',d=0;d<b.length;++d)e=b[d].toString(16),c+=`${2>e.length?'0':''}${e}`;return c}var toBinary='TextEncoder'in window?function(a){return new TextEncoder().encode(a)}:function(a){for(var b=a.length,c=new ArrayBuffer(2*b),d=new Uint16Array(c),e=0;e<b;e++)d[e]=a.charCodeAt(e);return c},hashOptions={name:algorithm},algorithmSign={name:'HMAC',hash:hashOptions};function hmac(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:'binary';return subtle.importKey('raw','string'==typeof a?toBinary(a):a,algorithmSign,!1,['sign']).then(function(d){return subtle.sign(algorithmSign,d,toBinary(b))}).then(function(d){return'binary'===c?d:toHex(d)})}function hash(a){return subtle.digest(hashOptions,toBinary(a)).then(toHex)}
/***/ },
/***/ }),
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {

@@ -100,5 +102,5 @@ module.exports = __webpack_require__(0);

/***/ }
/***/ })
/******/ ]);
});
//# sourceMappingURL=index.js.map
{
"name": "aws-sigv4",
"version": "2.0.0-0",
"version": "2.0.0",
"description": "AWS Signature Version 4",

@@ -14,3 +14,3 @@ "main": "lib/node/index.js",

"pretest": "scripts/get-fixtures.js",
"test": "mocha test/index.js --compilers js:babel-core/register,js:babel-polyfill",
"test": "nyc mocha test/index.js --compilers js:babel-core/register,js:babel-polyfill",
"coverage": "nyc report --reporter=text-lcov | coveralls",

@@ -27,27 +27,35 @@ "build": "webpack"

"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.5.2",
"babel-loader": "^6.2.8",
"babel-polyfill": "^6.5.0",
"babel-preset-babili": "0.0.9",
"babel-preset-es2015-node4": "^2.1.0",
"babel-cli": "^6.24.0",
"babel-core": "^6.24.0",
"babel-loader": "^6.4.1",
"babel-polyfill": "^6.23.0",
"babel-preset-babili": "0.0.12",
"babel-preset-env": "^1.3.2",
"chai": "^3.5.0",
"coveralls": "^2.11.4",
"eslint": "^3.5.0",
"eslint": "^3.19.0",
"mocha": "^3.0.2",
"mocha-eslint": "^3.0.1",
"mocha-loader": "^1.0.0",
"nyc": "^10.0.0",
"unzip": "^0.1.11",
"webpack": "^2.1.0-beta.27"
"mocha-loader": "1.1.1",
"nyc": "10.2.0",
"unzip": "0.1.11",
"webpack": "2.3.2"
},
"babel": {
"presets": [
"es2015-node4"
[
"env",
{
"targets": {
"node": "current"
}
}
]
]
},
"nyc": {
"exclude": [
"lib"
"include": [
"src/node/*"
],
"sourceMap": true,
"cache": true,

@@ -54,0 +62,0 @@ "report-dir": "./coverage"

@@ -16,2 +16,3 @@ # aws-sigv4

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/75a427334dad4aac843674b99bc40e8b)](https://www.codacy.com/app/barrett-harber/aws-sigv4?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=binoculars/aws-sigv4&amp;utm_campaign=Badge_Grade)
[![Known Vulnerabilities](https://snyk.io/test/github/binoculars/aws-sigv4/badge.svg)](https://snyk.io/test/github/binoculars/aws-sigv4)

@@ -62,2 +63,2 @@ ## Example

See [Authenticating Requests in Browser-Based Uploads Using POST (AWS Signature Version 4)](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-UsingHTTPPOST.html) as the primary use case.
See [Authenticating Requests in Browser-Based Uploads Using POST (AWS Signature Version 4)](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-UsingHTTPPOST.html) as the primary use case.

@@ -72,3 +72,3 @@ #!/usr/bin/env node

const fixtureName = 'aws4_testsuite';
const fixtureURL = 'https://docs.aws.amazon.com/general/latest/gr/samples/aws4_testsuite.zip';
const fixtureURL = 'https://s3.amazonaws.com/awsdocs/aws-sig-v4-test-suite.zip';

@@ -75,0 +75,0 @@ const fixtureDir = path.join(fixturesDir, fixtureName);

@@ -14,3 +14,3 @@ const webpack = require('webpack');

library: target === 'node' ? undefined : 'sigv4',
libraryTarget: target === 'node' ? 'commonjs' : 'umd',
libraryTarget: target === 'node' ? 'commonjs' : 'umd'
},

@@ -29,3 +29,10 @@

presets: [
'es2015-node4',
[
"env",
{
"targets": {
"node": "current"
}
}
],
'babili'

@@ -36,3 +43,3 @@ ],

minified: true
},
}
// options for the loader

@@ -47,4 +54,4 @@ }

alias: {
'deps$': path.resolve(__dirname, `src/${target}-deps.js`),
},
'deps$': path.resolve(__dirname, `src/${target}-deps.js`)
}
},

@@ -65,2 +72,7 @@

plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
]

@@ -67,0 +79,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc