Skip to content

Commit 1945d47

Browse files
fix(client-s3): disable bucket endpoint plugin in WriteGetObjectResponseCommand (#3344)
* fix(client-s3): disable bucket endpoint pluggin for WriteGetObjectResponseCommand * chore: fix checkstyle error Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
1 parent bfc9257 commit 1945d47

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { getBucketEndpointPlugin } from "@aws-sdk/middleware-bucket-endpoint";
21
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
32
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
43
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -93,7 +92,6 @@ export class WriteGetObjectResponseCommand extends $Command<
9392
options?: __HttpHandlerOptions
9493
): Handler<WriteGetObjectResponseCommandInput, WriteGetObjectResponseCommandOutput> {
9594
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
96-
this.middlewareStack.use(getBucketEndpointPlugin(configuration));
9795

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

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
public final class AddS3Config implements TypeScriptIntegration {
5656
private static final Logger LOGGER = Logger.getLogger(AddS3Config.class.getName());
5757

58-
private static final Set<String> SSEC_OPERATIONS = SetUtils.of("SSECustomerKey", "CopySourceSSECustomerKey");
58+
private static final Set<String> SSEC_INPUT_KEYS = SetUtils.of("SSECustomerKey", "CopySourceSSECustomerKey");
59+
60+
private static final Set<String> BUCKET_ENDPOINT_INPUT_KEYS = SetUtils.of("Bucket");
5961

6062
private static final Set<String> NON_BUCKET_ENDPOINT_OPERATIONS = SetUtils.of(
6163
"CreateBucket",
@@ -178,14 +180,14 @@ && testServiceId(s))
178180
.build(),
179181
RuntimeClientPlugin.builder()
180182
.withConventions(AwsDependency.SSEC_MIDDLEWARE.dependency, "Ssec", HAS_MIDDLEWARE)
181-
.operationPredicate((m, s, o) -> testInputContainsMember(m, o, SSEC_OPERATIONS)
183+
.operationPredicate((m, s, o) -> testInputContainsMember(m, o, SSEC_INPUT_KEYS)
182184
&& testServiceId(s))
183185
.build(),
184186
RuntimeClientPlugin.builder()
185187
.withConventions(AwsDependency.LOCATION_CONSTRAINT.dependency, "LocationConstraint",
186188
HAS_MIDDLEWARE)
187189
.operationPredicate((m, s, o) -> o.getId().getName(s).equals("CreateBucket")
188-
&& testServiceId(s))
190+
&& testServiceId(s))
189191
.build(),
190192
/**
191193
* BUCKET_ENDPOINT_MIDDLEWARE needs two separate plugins. The first resolves the config in the client.
@@ -200,7 +202,8 @@ && testServiceId(s))
200202
.withConventions(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE.dependency, "BucketEndpoint",
201203
HAS_MIDDLEWARE)
202204
.operationPredicate((m, s, o) -> !NON_BUCKET_ENDPOINT_OPERATIONS.contains(o.getId().getName(s))
203-
&& testServiceId(s))
205+
&& testServiceId(s)
206+
&& testInputContainsMember(m, o, BUCKET_ENDPOINT_INPUT_KEYS))
204207
.build()
205208
);
206209
}

0 commit comments

Comments
 (0)