Socket
Socket
Sign inDemoInstall

@aws-sdk/signature-v4

Package Overview
Dependencies
Maintainers
6
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/signature-v4 - npm Package Compare versions

Comparing version 3.53.0 to 3.54.0

18

dist-cjs/SignatureV4.js

@@ -127,4 +127,18 @@ "use strict";

if (this.uriEscapePath) {
const doubleEncoded = encodeURIComponent(path.replace(/^\//, ""));
return `/${doubleEncoded.replace(/%2F/g, "/")}`;
const normalizedPathSegments = [];
for (const pathSegment of path.split("/")) {
if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0)
continue;
if (pathSegment === ".")
continue;
if (pathSegment === "..") {
normalizedPathSegments.pop();
}
else {
normalizedPathSegments.push(pathSegment);
}
}
const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`;
const doubleEncoded = encodeURIComponent(normalizedPath);
return doubleEncoded.replace(/%2F/g, "/");
}

@@ -131,0 +145,0 @@ return path;

@@ -1,2 +0,2 @@

import { __awaiter, __generator } from "tslib";
import { __awaiter, __generator, __values } from "tslib";
import { toHex } from "@aws-sdk/util-hex-encoding";

@@ -229,6 +229,31 @@ import { ALGORITHM_IDENTIFIER, ALGORITHM_QUERY_PARAM, AMZ_DATE_HEADER, AMZ_DATE_QUERY_PARAM, AUTH_HEADER, CREDENTIAL_QUERY_PARAM, EVENT_ALGORITHM_IDENTIFIER, EXPIRES_QUERY_PARAM, MAX_PRESIGNED_TTL, SHA256_HEADER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_HEADER, TOKEN_QUERY_PARAM, } from "./constants";

SignatureV4.prototype.getCanonicalPath = function (_a) {
var e_1, _b;
var path = _a.path;
if (this.uriEscapePath) {
var doubleEncoded = encodeURIComponent(path.replace(/^\//, ""));
return "/" + doubleEncoded.replace(/%2F/g, "/");
var normalizedPathSegments = [];
try {
for (var _c = __values(path.split("/")), _d = _c.next(); !_d.done; _d = _c.next()) {
var pathSegment = _d.value;
if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0)
continue;
if (pathSegment === ".")
continue;
if (pathSegment === "..") {
normalizedPathSegments.pop();
}
else {
normalizedPathSegments.push(pathSegment);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
}
finally { if (e_1) throw e_1.error; }
}
var normalizedPath = "" + ((path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : "") + normalizedPathSegments.join("/") + (normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : "");
var doubleEncoded = encodeURIComponent(normalizedPath);
return doubleEncoded.replace(/%2F/g, "/");
}

@@ -235,0 +260,0 @@ return path;

6

package.json
{
"name": "@aws-sdk/signature-v4",
"version": "3.53.0",
"version": "3.54.0",
"description": "A standalone implementation of the AWS Signature V4 request signing algorithm",

@@ -24,3 +24,3 @@ "main": "./dist-cjs/index.js",

"@aws-sdk/is-array-buffer": "3.52.0",
"@aws-sdk/types": "3.53.0",
"@aws-sdk/types": "3.54.0",
"@aws-sdk/util-hex-encoding": "3.52.0",

@@ -32,3 +32,3 @@ "@aws-sdk/util-uri-escape": "3.52.0",

"@aws-crypto/sha256-js": "2.0.0",
"@aws-sdk/protocol-http": "3.53.0",
"@aws-sdk/protocol-http": "3.54.0",
"@aws-sdk/util-buffer-from": "3.52.0",

@@ -35,0 +35,0 @@ "@tsconfig/recommended": "1.0.1",

Sorry, the diff of this file is too big to display

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