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

@aws-sdk/middleware-flexible-checksums

Package Overview
Dependencies
Maintainers
5
Versions
120
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.649.0 to 3.651.0

dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js

83

dist-cjs/index.js

@@ -24,5 +24,15 @@ "use strict";

__export(src_exports, {
CONFIG_REQUEST_CHECKSUM_CALCULATION: () => CONFIG_REQUEST_CHECKSUM_CALCULATION,
CONFIG_RESPONSE_CHECKSUM_VALIDATION: () => CONFIG_RESPONSE_CHECKSUM_VALIDATION,
ChecksumAlgorithm: () => ChecksumAlgorithm,
ChecksumLocation: () => ChecksumLocation,
DEFAULT_CHECKSUM_ALGORITHM: () => DEFAULT_CHECKSUM_ALGORITHM,
DEFAULT_REQUEST_CHECKSUM_CALCULATION: () => DEFAULT_REQUEST_CHECKSUM_CALCULATION,
DEFAULT_RESPONSE_CHECKSUM_VALIDATION: () => DEFAULT_RESPONSE_CHECKSUM_VALIDATION,
ENV_REQUEST_CHECKSUM_CALCULATION: () => ENV_REQUEST_CHECKSUM_CALCULATION,
ENV_RESPONSE_CHECKSUM_VALIDATION: () => ENV_RESPONSE_CHECKSUM_VALIDATION,
NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS: () => NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS,
NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS: () => NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS,
RequestChecksumCalculation: () => RequestChecksumCalculation,
ResponseChecksumValidation: () => ResponseChecksumValidation,
S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM: () => S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM,

@@ -36,2 +46,34 @@ flexibleChecksumsMiddleware: () => flexibleChecksumsMiddleware,

// src/constants.ts
var RequestChecksumCalculation = {
/**
* When set, a checksum will be calculated for all request payloads of operations
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
* AND/OR a `requestAlgorithmMember` is modeled.
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
*/
WHEN_SUPPORTED: "WHEN_SUPPORTED",
/**
* When set, a checksum will only be calculated for request payloads of operations
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
* OR where a `requestAlgorithmMember` is modeled and the user sets it.
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
*/
WHEN_REQUIRED: "WHEN_REQUIRED"
};
var ResponseChecksumValidation = {
/**
* When set, checksum validation MUST be performed on all response payloads of operations
* modeled with the {@link httpChecksum} trait where `responseAlgorithms` is modeled,
* except when no modeled checksum algorithms are supported by an SDK.
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
*/
WHEN_SUPPORTED: "WHEN_SUPPORTED",
/**
* When set, checksum validation MUST NOT be performed on response payloads of operations UNLESS
* the SDK supports the modeled checksum algorithms AND the user has set the `requestValidationModeMember` to `ENABLED`.
* It is currently impossible to model an operation as requiring a response checksum,
* but this setting leaves the door open for future updates.
*/
WHEN_REQUIRED: "WHEN_REQUIRED"
};
var ChecksumAlgorithm = /* @__PURE__ */ ((ChecksumAlgorithm3) => {

@@ -53,2 +95,33 @@ ChecksumAlgorithm3["MD5"] = "MD5";

// src/stringUnionSelector.ts
var stringUnionSelector = /* @__PURE__ */ __name((obj, key, union, type) => {
if (!(key in obj))
return void 0;
const value = obj[key].toUpperCase();
if (!Object.values(union).includes(value)) {
throw new TypeError(`Cannot load ${type} '${key}'. Expected one of ${Object.values(union)}, got '${obj[key]}'.`);
}
return value;
}, "stringUnionSelector");
// src/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.ts
var ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
var CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
var DEFAULT_REQUEST_CHECKSUM_CALCULATION = RequestChecksumCalculation.WHEN_SUPPORTED;
var NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => stringUnionSelector(env, ENV_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, "env" /* ENV */),
configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, "shared config entry" /* CONFIG */),
default: DEFAULT_REQUEST_CHECKSUM_CALCULATION
};
// src/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.ts
var ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
var CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
var DEFAULT_RESPONSE_CHECKSUM_VALIDATION = RequestChecksumCalculation.WHEN_SUPPORTED;
var NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => stringUnionSelector(env, ENV_RESPONSE_CHECKSUM_VALIDATION, RequestChecksumCalculation, "env" /* ENV */),
configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_RESPONSE_CHECKSUM_VALIDATION, RequestChecksumCalculation, "shared config entry" /* CONFIG */),
default: DEFAULT_RESPONSE_CHECKSUM_VALIDATION
};
// src/flexibleChecksumsMiddleware.ts

@@ -304,2 +377,12 @@ var import_protocol_http = require("@smithy/protocol-http");

0 && (module.exports = {
ENV_REQUEST_CHECKSUM_CALCULATION,
CONFIG_REQUEST_CHECKSUM_CALCULATION,
DEFAULT_REQUEST_CHECKSUM_CALCULATION,
NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS,
ENV_RESPONSE_CHECKSUM_VALIDATION,
CONFIG_RESPONSE_CHECKSUM_VALIDATION,
DEFAULT_RESPONSE_CHECKSUM_VALIDATION,
NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS,
RequestChecksumCalculation,
ResponseChecksumValidation,
ChecksumAlgorithm,

@@ -306,0 +389,0 @@ ChecksumLocation,

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

export const RequestChecksumCalculation = {
WHEN_SUPPORTED: "WHEN_SUPPORTED",
WHEN_REQUIRED: "WHEN_REQUIRED",
};
export const ResponseChecksumValidation = {
WHEN_SUPPORTED: "WHEN_SUPPORTED",
WHEN_REQUIRED: "WHEN_REQUIRED",
};
export var ChecksumAlgorithm;

@@ -2,0 +10,0 @@ (function (ChecksumAlgorithm) {

2

dist-es/index.js

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

export * from "./NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS";
export * from "./NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS";
export * from "./constants";
export * from "./flexibleChecksumsMiddleware";
export * from "./getFlexibleChecksumsPlugin";
/**
* Determines when a checksum will be calculated for request payloads.
*/
export declare const RequestChecksumCalculation: {
/**
* When set, a checksum will be calculated for all request payloads of operations
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
* AND/OR a `requestAlgorithmMember` is modeled.
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
*/
readonly WHEN_SUPPORTED: "WHEN_SUPPORTED";
/**
* When set, a checksum will only be calculated for request payloads of operations
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
* OR where a `requestAlgorithmMember` is modeled and the user sets it.
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
*/
readonly WHEN_REQUIRED: "WHEN_REQUIRED";
};
export type RequestChecksumCalculation = (typeof RequestChecksumCalculation)[keyof typeof RequestChecksumCalculation];
/**
* Determines when checksum validation will be performed on response payloads.
*/
export declare const ResponseChecksumValidation: {
/**
* When set, checksum validation MUST be performed on all response payloads of operations
* modeled with the {@link httpChecksum} trait where `responseAlgorithms` is modeled,
* except when no modeled checksum algorithms are supported by an SDK.
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
*/
readonly WHEN_SUPPORTED: "WHEN_SUPPORTED";
/**
* When set, checksum validation MUST NOT be performed on response payloads of operations UNLESS
* the SDK supports the modeled checksum algorithms AND the user has set the `requestValidationModeMember` to `ENABLED`.
* It is currently impossible to model an operation as requiring a response checksum,
* but this setting leaves the door open for future updates.
*/
readonly WHEN_REQUIRED: "WHEN_REQUIRED";
};
export type ResponseChecksumValidation = (typeof ResponseChecksumValidation)[keyof typeof ResponseChecksumValidation];
/**
* Checksum Algorithms supported by the SDK.

@@ -3,0 +43,0 @@ */

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

export * from "./NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS";
export * from "./NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS";
export * from "./constants";
export * from "./flexibleChecksumsMiddleware";
export * from "./getFlexibleChecksumsPlugin";

@@ -0,1 +1,13 @@

export declare const RequestChecksumCalculation: {
readonly WHEN_SUPPORTED: "WHEN_SUPPORTED";
readonly WHEN_REQUIRED: "WHEN_REQUIRED";
};
export type RequestChecksumCalculation =
(typeof RequestChecksumCalculation)[keyof typeof RequestChecksumCalculation];
export declare const ResponseChecksumValidation: {
readonly WHEN_SUPPORTED: "WHEN_SUPPORTED";
readonly WHEN_REQUIRED: "WHEN_REQUIRED";
};
export type ResponseChecksumValidation =
(typeof ResponseChecksumValidation)[keyof typeof ResponseChecksumValidation];
export declare enum ChecksumAlgorithm {

@@ -2,0 +14,0 @@ MD5 = "MD5",

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

export * from "./NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS";
export * from "./NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS";
export * from "./constants";
export * from "./flexibleChecksumsMiddleware";
export * from "./getFlexibleChecksumsPlugin";

3

package.json
{
"name": "@aws-sdk/middleware-flexible-checksums",
"version": "3.649.0",
"version": "3.651.0",
"scripts": {

@@ -35,2 +35,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",

"@smithy/is-array-buffer": "^3.0.0",
"@smithy/node-config-provider": "^3.1.5",
"@smithy/protocol-http": "^4.1.1",

@@ -37,0 +38,0 @@ "@smithy/types": "^3.4.0",

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