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

@aws-sdk/middleware-flexible-checksums

Package Overview
Dependencies
Maintainers
5
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-flexible-checksums - npm Package Compare versions

Comparing version 3.731.0 to 3.732.0

16

dist-cjs/index.js

@@ -404,3 +404,3 @@ "use strict";

// src/validateChecksumFromResponse.ts
var validateChecksumFromResponse = /* @__PURE__ */ __name(async (response, { config, responseAlgorithms }) => {
var validateChecksumFromResponse = /* @__PURE__ */ __name(async (response, { config, responseAlgorithms, logger }) => {
const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);

@@ -412,3 +412,12 @@ const { body: responseBody, headers: responseHeaders } = response;

if (checksumFromResponse) {
const checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
let checksumAlgorithmFn;
try {
checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
} catch (error) {
if (algorithm === "CRC64NVME" /* CRC64NVME */) {
logger?.warn(`Skipping ${"CRC64NVME" /* CRC64NVME */} checksum validation: ${error.message}`);
continue;
}
throw error;
}
const { base64Encoder } = config;

@@ -470,3 +479,4 @@ if (isStreaming(responseBody)) {

config,
responseAlgorithms
responseAlgorithms,
logger: context.logger
});

@@ -473,0 +483,0 @@ if (isStreamingBody && collectedStream) {

@@ -44,2 +44,3 @@ import { HttpRequest } from "@smithy/protocol-http";

responseAlgorithms,
logger: context.logger,
});

@@ -46,0 +47,0 @@ if (isStreamingBody && collectedStream) {

import { createChecksumStream } from "@smithy/util-stream";
import { ChecksumAlgorithm } from "./constants";
import { getChecksum } from "./getChecksum";

@@ -7,3 +8,3 @@ import { getChecksumAlgorithmListForResponse } from "./getChecksumAlgorithmListForResponse";

import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction";
export const validateChecksumFromResponse = async (response, { config, responseAlgorithms }) => {
export const validateChecksumFromResponse = async (response, { config, responseAlgorithms, logger }) => {
const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);

@@ -15,3 +16,13 @@ const { body: responseBody, headers: responseHeaders } = response;

if (checksumFromResponse) {
const checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
let checksumAlgorithmFn;
try {
checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
}
catch (error) {
if (algorithm === ChecksumAlgorithm.CRC64NVME) {
logger?.warn(`Skipping ${ChecksumAlgorithm.CRC64NVME} checksum validation: ${error.message}`);
continue;
}
throw error;
}
const { base64Encoder } = config;

@@ -18,0 +29,0 @@ if (isStreaming(responseBody)) {

4

dist-types/ts3.4/validateChecksumFromResponse.d.ts
import { HttpResponse } from "@smithy/protocol-http";
import { Logger } from "@smithy/types";
import { PreviouslyResolved } from "./configuration";

@@ -6,6 +7,7 @@ export interface ValidateChecksumFromResponseOptions {

responseAlgorithms?: string[];
logger?: Logger;
}
export declare const validateChecksumFromResponse: (
response: HttpResponse,
{ config, responseAlgorithms }: ValidateChecksumFromResponseOptions
{ config, responseAlgorithms, logger }: ValidateChecksumFromResponseOptions
) => Promise<void>;
import { HttpResponse } from "@smithy/protocol-http";
import { Logger } from "@smithy/types";
import { PreviouslyResolved } from "./configuration";

@@ -10,3 +11,4 @@ export interface ValidateChecksumFromResponseOptions {

responseAlgorithms?: string[];
logger?: Logger;
}
export declare const validateChecksumFromResponse: (response: HttpResponse, { config, responseAlgorithms }: ValidateChecksumFromResponseOptions) => Promise<void>;
export declare const validateChecksumFromResponse: (response: HttpResponse, { config, responseAlgorithms, logger }: ValidateChecksumFromResponseOptions) => Promise<void>;
{
"name": "@aws-sdk/middleware-flexible-checksums",
"version": "3.731.0",
"version": "3.732.0",
"scripts": {

@@ -5,0 +5,0 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",

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