Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-signature-v4

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-signature-v4 - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

18

index.js

@@ -17,7 +17,15 @@ /* eslint-env node */

headers,
payload
payload,
doubleEscape
) {
return [
method.toUpperCase(),
createCanonicalURI(pathname),
createCanonicalURI(
doubleEscape
? pathname
.split(/\//g)
.map(v => encodeURIComponent(v))
.join("/")
: pathname
),
exports.createCanonicalQueryString(query),

@@ -141,2 +149,3 @@ exports.createCanonicalHeaders(headers),

options.signSessionToken = true;
options.doubleEscape = false;
return exports.createPresignedURL(

@@ -170,2 +179,4 @@ options.method,

options.signSessionToken = options.signSessionToken || false;
options.doubleEscape =
options.doubleEscape !== undefined ? options.doubleEscape : true;

@@ -196,3 +207,4 @@ // host is required

options.headers,
payload
payload,
options.doubleEscape
);

@@ -199,0 +211,0 @@ var stringToSign = exports.createStringToSign(

2

package.json
{
"name": "aws-signature-v4",
"version": "1.3.0",
"version": "1.4.0",
"description": "Generate AWS V4 Signatures and Signed URLs",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -64,2 +64,33 @@ /* eslint-env node, mocha */

it("should generate a canonical request for websocket connection api", function() {
var webCanonicalRequest = aws.createCanonicalRequest(
"GET",
"/@connections",
{
"X-Amz-Algorithm": "AWS4-HMAC-SHA256",
"X-Amz-Credential":
"AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request",
"X-Amz-Date": "20130524T000000Z",
"X-Amz-SignedHeaders": "host"
},
{
Host: "examplebucket.s3.amazonaws.com"
},
"UNSIGNED-PAYLOAD",
true
);
assert.equal(
webCanonicalRequest,
[
"GET",
"/%40connections",
"X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20130524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20130524T000000Z&X-Amz-SignedHeaders=host",
"host:examplebucket.s3.amazonaws.com",
"",
"host",
"UNSIGNED-PAYLOAD"
].join("\n")
);
});
it("should generate a string to sign", function() {

@@ -66,0 +97,0 @@ // time, region, service, request

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