Skip to content

Commit

Permalink
feat(client-s3): add md5 header for operations with httpChecksumRequi…
Browse files Browse the repository at this point in the history
…red trait (#2507)

* chore: apply md5 to s3 control operations

* chore: remove stream hasher customization, rename md5 customization to sqs customization

* feat(client-s3): add md5 header for operations with httpChecksumRequired trait

* feat(client-s3-control): add md5 header for operations with httpChecksumRequired trait

* chore: address checkstyle violations
  • Loading branch information
AllanZhengYP authored Jun 24, 2021
1 parent 2e662cd commit cec0692
Show file tree
Hide file tree
Showing 28 changed files with 111 additions and 160 deletions.
16 changes: 16 additions & 0 deletions clients/client-s3-control/S3ControlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ import {
Logger as __Logger,
Provider as __Provider,
StreamCollector as __StreamCollector,
StreamHasher as __StreamHasher,
UrlParser as __UrlParser,
UserAgent as __UserAgent,
} from "@aws-sdk/types";
import { Readable } from "stream";

export type ServiceInputTypes =
| CreateAccessPointCommandInput
Expand Down Expand Up @@ -403,6 +405,20 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
* @internal
*/
defaultUserAgentProvider?: Provider<__UserAgent>;

/**
* A function that, given a hash constructor and a stream, calculates the
* hash of the streamed value.
* @internal
*/
streamHasher?: __StreamHasher<Readable> | __StreamHasher<Blob>;

/**
* A constructor for a class implementing the @aws-sdk/types.Hash interface
* that computes MD5 hashes.
* @internal
*/
md5?: __HashConstructor;
}

type S3ControlClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3-control/commands/CreateBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlCreateBucketCommand,
serializeAws_restXmlCreateBucketCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getRedirectFromPostIdPlugin } from "@aws-sdk/middleware-sdk-s3-control";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -111,6 +112,7 @@ export class CreateBucketCommand extends $Command<
): Handler<CreateBucketCommandInput, CreateBucketCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getRedirectFromPostIdPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketLifecycleConfigurationCommand,
serializeAws_restXmlPutBucketLifecycleConfigurationCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getProcessArnablesPlugin } from "@aws-sdk/middleware-sdk-s3-control";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -84,6 +85,7 @@ export class PutBucketLifecycleConfigurationCommand extends $Command<
): Handler<PutBucketLifecycleConfigurationCommandInput, PutBucketLifecycleConfigurationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getProcessArnablesPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3-control/commands/PutBucketPolicyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketPolicyCommand,
serializeAws_restXmlPutBucketPolicyCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getProcessArnablesPlugin } from "@aws-sdk/middleware-sdk-s3-control";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -100,6 +101,7 @@ export class PutBucketPolicyCommand extends $Command<
): Handler<PutBucketPolicyCommandInput, PutBucketPolicyCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getProcessArnablesPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3-control/commands/PutBucketTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketTaggingCommand,
serializeAws_restXmlPutBucketTaggingCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getProcessArnablesPlugin } from "@aws-sdk/middleware-sdk-s3-control";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -145,6 +146,7 @@ export class PutBucketTaggingCommand extends $Command<
): Handler<PutBucketTaggingCommandInput, PutBucketTaggingCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getProcessArnablesPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
4 changes: 4 additions & 0 deletions clients/client-s3-control/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@
"@aws-sdk/config-resolver": "3.18.0",
"@aws-sdk/credential-provider-node": "3.18.0",
"@aws-sdk/fetch-http-handler": "3.18.0",
"@aws-sdk/hash-blob-browser": "3.18.0",
"@aws-sdk/hash-node": "3.18.0",
"@aws-sdk/hash-stream-node": "3.18.0",
"@aws-sdk/invalid-dependency": "3.18.0",
"@aws-sdk/md5-js": "3.18.0",
"@aws-sdk/middleware-apply-body-checksum": "3.18.0",
"@aws-sdk/middleware-content-length": "3.18.0",
"@aws-sdk/middleware-host-header": "3.18.0",
"@aws-sdk/middleware-logger": "3.18.0",
Expand Down
4 changes: 4 additions & 0 deletions clients/client-s3-control/runtimeConfig.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import packageInfo from "./package.json";

import { Sha256 } from "@aws-crypto/sha256-browser";
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser";
import { invalidProvider } from "@aws-sdk/invalid-dependency";
import { Md5 } from "@aws-sdk/md5-js";
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
Expand All @@ -26,11 +28,13 @@ export const ClientDefaultValues: Required<ClientDefaults> = {
clientVersion: packageInfo.version,
}),
maxAttempts: DEFAULT_MAX_ATTEMPTS,
md5: Md5,
region: invalidProvider("Region is missing"),
requestHandler: new FetchHttpHandler(),
retryModeProvider: () => Promise.resolve(DEFAULT_RETRY_MODE),
sha256: Sha256,
streamCollector,
streamHasher,
utf8Decoder: fromUtf8,
utf8Encoder: toUtf8,
};
4 changes: 4 additions & 0 deletions clients/client-s3-control/runtimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
import { Hash } from "@aws-sdk/hash-node";
import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node";
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { HashConstructor as __HashConstructor } from "@aws-sdk/types";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
Expand All @@ -29,11 +31,13 @@ export const ClientDefaultValues: Required<ClientDefaults> = {
clientVersion: packageInfo.version,
}),
maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
md5: Hash.bind(null, "md5"),
region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
requestHandler: new NodeHttpHandler(),
retryModeProvider: loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
sha256: Hash.bind(null, "sha256"),
streamCollector,
streamHasher,
utf8Decoder: fromUtf8,
utf8Encoder: toUtf8,
};
28 changes: 14 additions & 14 deletions clients/client-s3/S3Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,20 +603,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
regionInfoProvider?: RegionInfoProvider;

/**
* A constructor for a class implementing the @aws-sdk/types.Hash interface
* that computes MD5 hashes.
* @internal
*/
md5?: __HashConstructor;

/**
* A function that, given a hash constructor and a stream, calculates the
* hash of the streamed value.
* @internal
*/
streamHasher?: __StreamHasher<Readable> | __StreamHasher<Blob>;

/**
* Whether to escape request path when signing the request.
*/
Expand All @@ -636,6 +622,20 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
* The function that provides necessary utilities for generating and parsing event stream
*/
eventStreamSerdeProvider?: __EventStreamSerdeProvider;

/**
* A function that, given a hash constructor and a stream, calculates the
* hash of the streamed value.
* @internal
*/
streamHasher?: __StreamHasher<Readable> | __StreamHasher<Blob>;

/**
* A constructor for a class implementing the @aws-sdk/types.Hash interface
* that computes MD5 hashes.
* @internal
*/
md5?: __HashConstructor;
}

type S3ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutBucketAclCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketAclCommand,
serializeAws_restXmlPutBucketAclCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -252,6 +253,7 @@ export class PutBucketAclCommand extends $Command<
): Handler<PutBucketAclCommandInput, PutBucketAclCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutBucketEncryptionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketEncryptionCommand,
serializeAws_restXmlPutBucketEncryptionCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -94,6 +95,7 @@ export class PutBucketEncryptionCommand extends $Command<
): Handler<PutBucketEncryptionCommandInput, PutBucketEncryptionCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutBucketLoggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketLoggingCommand,
serializeAws_restXmlPutBucketLoggingCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -141,6 +142,7 @@ export class PutBucketLoggingCommand extends $Command<
): Handler<PutBucketLoggingCommandInput, PutBucketLoggingCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketOwnershipControlsCommand,
serializeAws_restXmlPutBucketOwnershipControlsCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -78,6 +79,7 @@ export class PutBucketOwnershipControlsCommand extends $Command<
): Handler<PutBucketOwnershipControlsCommandInput, PutBucketOwnershipControlsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutBucketRequestPaymentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketRequestPaymentCommand,
serializeAws_restXmlPutBucketRequestPaymentCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -80,6 +81,7 @@ export class PutBucketRequestPaymentCommand extends $Command<
): Handler<PutBucketRequestPaymentCommandInput, PutBucketRequestPaymentCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutBucketVersioningCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketVersioningCommand,
serializeAws_restXmlPutBucketVersioningCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -110,6 +111,7 @@ export class PutBucketVersioningCommand extends $Command<
): Handler<PutBucketVersioningCommandInput, PutBucketVersioningCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutBucketWebsiteCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutBucketWebsiteCommand,
serializeAws_restXmlPutBucketWebsiteCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -187,6 +188,7 @@ export class PutBucketWebsiteCommand extends $Command<
): Handler<PutBucketWebsiteCommandInput, PutBucketWebsiteCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutObjectAclCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutObjectAclCommand,
serializeAws_restXmlPutObjectAclCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -239,6 +240,7 @@ export class PutObjectAclCommand extends $Command<
): Handler<PutObjectAclCommandInput, PutObjectAclCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutObjectLegalHoldCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutObjectLegalHoldCommand,
serializeAws_restXmlPutObjectLegalHoldCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -65,6 +66,7 @@ export class PutObjectLegalHoldCommand extends $Command<
): Handler<PutObjectLegalHoldCommandInput, PutObjectLegalHoldCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutObjectLockConfigurationCommand,
serializeAws_restXmlPutObjectLockConfigurationCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -82,6 +83,7 @@ export class PutObjectLockConfigurationCommand extends $Command<
): Handler<PutObjectLockConfigurationCommandInput, PutObjectLockConfigurationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 2 additions & 0 deletions clients/client-s3/commands/PutObjectRetentionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deserializeAws_restXmlPutObjectRetentionCommand,
serializeAws_restXmlPutObjectRetentionCommand,
} from "../protocols/Aws_restXml";
import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum";
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -64,6 +65,7 @@ export class PutObjectRetentionCommand extends $Command<
): Handler<PutObjectRetentionCommandInput, PutObjectRetentionCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

Expand Down
Loading

0 comments on commit cec0692

Please sign in to comment.