Socket
Socket
Sign inDemoInstall

@aws-sdk/signature-v4

Package Overview
Dependencies
Maintainers
5
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.226.0 to 3.254.0

3

dist-cjs/credentialDerivation.js

@@ -5,2 +5,3 @@ "use strict";

const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding");
const util_utf8_1 = require("@aws-sdk/util-utf8");
const constants_1 = require("./constants");

@@ -37,4 +38,4 @@ const signingKeyCache = {};

const hash = new ctor(secret);
hash.update(data);
hash.update((0, util_utf8_1.toUint8Array)(data));
return hash.digest();
};

@@ -6,2 +6,3 @@ "use strict";

const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding");
const util_utf8_1 = require("@aws-sdk/util-utf8");
const constants_1 = require("./constants");

@@ -19,3 +20,3 @@ const getPayloadHash = async ({ headers, body }, hashConstructor) => {

const hashCtor = new hashConstructor();
hashCtor.update(body);
hashCtor.update((0, util_utf8_1.toUint8Array)(body));
return (0, util_hex_encoding_1.toHex)(await hashCtor.digest());

@@ -22,0 +23,0 @@ }

@@ -6,2 +6,3 @@ "use strict";

const util_middleware_1 = require("@aws-sdk/util-middleware");
const util_utf8_1 = require("@aws-sdk/util-utf8");
const constants_1 = require("./constants");

@@ -83,3 +84,3 @@ const credentialDerivation_1 = require("./credentialDerivation");

const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
hash.update(stringToSign);
hash.update((0, util_utf8_1.toUint8Array)(stringToSign));
return (0, util_hex_encoding_1.toHex)(await hash.digest());

@@ -123,3 +124,3 @@ }

const hash = new this.sha256();
hash.update(canonicalRequest);
hash.update((0, util_utf8_1.toUint8Array)(canonicalRequest));
const hashedRequest = await hash.digest();

@@ -155,3 +156,3 @@ return `${constants_1.ALGORITHM_IDENTIFIER}

const hash = new this.sha256(await keyPromise);
hash.update(stringToSign);
hash.update((0, util_utf8_1.toUint8Array)(stringToSign));
return (0, util_hex_encoding_1.toHex)(await hash.digest());

@@ -158,0 +159,0 @@ }

import { toHex } from "@aws-sdk/util-hex-encoding";
import { toUint8Array } from "@aws-sdk/util-utf8";
import { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from "./constants";

@@ -30,4 +31,4 @@ const signingKeyCache = {};

const hash = new ctor(secret);
hash.update(data);
hash.update(toUint8Array(data));
return hash.digest();
};
import { isArrayBuffer } from "@aws-sdk/is-array-buffer";
import { toHex } from "@aws-sdk/util-hex-encoding";
import { toUint8Array } from "@aws-sdk/util-utf8";
import { SHA256_HEADER, UNSIGNED_PAYLOAD } from "./constants";

@@ -15,3 +16,3 @@ export const getPayloadHash = async ({ headers, body }, hashConstructor) => {

const hashCtor = new hashConstructor();
hashCtor.update(body);
hashCtor.update(toUint8Array(body));
return toHex(await hashCtor.digest());

@@ -18,0 +19,0 @@ }

import { toHex } from "@aws-sdk/util-hex-encoding";
import { normalizeProvider } from "@aws-sdk/util-middleware";
import { toUint8Array } from "@aws-sdk/util-utf8";
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";

@@ -79,3 +80,3 @@ import { createScope, getSigningKey } from "./credentialDerivation";

const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
hash.update(stringToSign);
hash.update(toUint8Array(stringToSign));
return toHex(await hash.digest());

@@ -119,3 +120,3 @@ }

const hash = new this.sha256();
hash.update(canonicalRequest);
hash.update(toUint8Array(canonicalRequest));
const hashedRequest = await hash.digest();

@@ -151,3 +152,3 @@ return `${ALGORITHM_IDENTIFIER}

const hash = new this.sha256(await keyPromise);
hash.update(stringToSign);
hash.update(toUint8Array(stringToSign));
return toHex(await hash.digest());

@@ -154,0 +155,0 @@ }

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

import { AwsCredentialIdentity, HashConstructor } from "@aws-sdk/types";
import { AwsCredentialIdentity, ChecksumConstructor, HashConstructor } from "@aws-sdk/types";
/**

@@ -22,3 +22,3 @@ * Create a string describing the scope of credentials used to sign a request.

*/
export declare const getSigningKey: (sha256Constructor: HashConstructor, credentials: AwsCredentialIdentity, shortDate: string, region: string, service: string) => Promise<Uint8Array>;
export declare const getSigningKey: (sha256Constructor: ChecksumConstructor | HashConstructor, credentials: AwsCredentialIdentity, shortDate: string, region: string, service: string) => Promise<Uint8Array>;
/**

@@ -25,0 +25,0 @@ * @internal

@@ -1,5 +0,5 @@

import { HashConstructor, HttpRequest } from "@aws-sdk/types";
import { ChecksumConstructor, HashConstructor, HttpRequest } from "@aws-sdk/types";
/**
* @private
*/
export declare const getPayloadHash: ({ headers, body }: HttpRequest, hashConstructor: HashConstructor) => Promise<string>;
export declare const getPayloadHash: ({ headers, body }: HttpRequest, hashConstructor: ChecksumConstructor | HashConstructor) => Promise<string>;

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

import { AwsCredentialIdentity, EventSigner, EventSigningArguments, FormattedEvent, HashConstructor, HttpRequest, Provider, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments, SigningArguments, StringSigner } from "@aws-sdk/types";
import { AwsCredentialIdentity, ChecksumConstructor, EventSigner, EventSigningArguments, FormattedEvent, HashConstructor, HttpRequest, Provider, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments, SigningArguments, StringSigner } from "@aws-sdk/types";
export interface SignatureV4Init {

@@ -21,3 +21,3 @@ /**

*/
sha256?: HashConstructor;
sha256?: ChecksumConstructor | HashConstructor;
/**

@@ -42,3 +42,3 @@ * Whether to uri-escape the request URI path as part of computing the

export interface SignatureV4CryptoInit {
sha256: HashConstructor;
sha256: ChecksumConstructor | HashConstructor;
}

@@ -45,0 +45,0 @@ export declare class SignatureV4 implements RequestPresigner, RequestSigner, StringSigner, EventSigner {

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

import { AwsCredentialIdentity, HashConstructor } from "@aws-sdk/types";
import {
AwsCredentialIdentity,
ChecksumConstructor,
HashConstructor,
} from "@aws-sdk/types";
export declare const createScope: (

@@ -8,3 +12,3 @@ shortDate: string,

export declare const getSigningKey: (
sha256Constructor: HashConstructor,
sha256Constructor: ChecksumConstructor | HashConstructor,
credentials: AwsCredentialIdentity,

@@ -11,0 +15,0 @@ shortDate: string,

@@ -1,5 +0,9 @@

import { HashConstructor, HttpRequest } from "@aws-sdk/types";
import {
ChecksumConstructor,
HashConstructor,
HttpRequest,
} from "@aws-sdk/types";
export declare const getPayloadHash: (
{ headers, body }: HttpRequest,
hashConstructor: HashConstructor
hashConstructor: ChecksumConstructor | HashConstructor
) => Promise<string>;
import {
AwsCredentialIdentity,
ChecksumConstructor,
EventSigner,

@@ -20,3 +21,3 @@ EventSigningArguments,

credentials: AwsCredentialIdentity | Provider<AwsCredentialIdentity>;
sha256?: HashConstructor;
sha256?: ChecksumConstructor | HashConstructor;
uriEscapePath?: boolean;

@@ -26,3 +27,3 @@ applyChecksum?: boolean;

export interface SignatureV4CryptoInit {
sha256: HashConstructor;
sha256: ChecksumConstructor | HashConstructor;
}

@@ -29,0 +30,0 @@ export declare class SignatureV4

{
"name": "@aws-sdk/signature-v4",
"version": "3.226.0",
"version": "3.254.0",
"description": "A standalone implementation of the AWS Signature V4 request signing algorithm",

@@ -25,11 +25,12 @@ "main": "./dist-cjs/index.js",

"@aws-sdk/is-array-buffer": "3.201.0",
"@aws-sdk/types": "3.226.0",
"@aws-sdk/types": "3.254.0",
"@aws-sdk/util-hex-encoding": "3.201.0",
"@aws-sdk/util-middleware": "3.226.0",
"@aws-sdk/util-middleware": "3.254.0",
"@aws-sdk/util-uri-escape": "3.201.0",
"@aws-sdk/util-utf8": "3.254.0",
"tslib": "^2.3.1"
},
"devDependencies": {
"@aws-crypto/sha256-js": "2.0.0",
"@aws-sdk/protocol-http": "3.226.0",
"@aws-crypto/sha256-js": "3.0.0",
"@aws-sdk/protocol-http": "3.254.0",
"@aws-sdk/util-buffer-from": "3.208.0",

@@ -36,0 +37,0 @@ "@tsconfig/recommended": "1.0.1",

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