Skip to content

Commit

Permalink
fix(client-s3): add staticContextParams in endpoint param instructions (
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Dec 14, 2022
1 parent 0cba099 commit d229edd
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 221 deletions.
1 change: 1 addition & 0 deletions clients/client-s3/src/commands/CreateBucketCommand.ts
Expand Up @@ -202,6 +202,7 @@ export class CreateBucketCommand extends $Command<

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
DisableAccessPoints: { type: "staticContextParams", value: true },
Bucket: { type: "contextParams", name: "Bucket" },
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
Expand Down
@@ -1,6 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getWriteGetObjectResponseEndpointPlugin } from "@aws-sdk/middleware-sdk-s3";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
Expand Down Expand Up @@ -82,6 +81,7 @@ export class WriteGetObjectResponseCommand extends $Command<

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseObjectLambdaEndpoint: { type: "staticContextParams", value: true },
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
Expand Down Expand Up @@ -112,7 +112,6 @@ export class WriteGetObjectResponseCommand extends $Command<
this.middlewareStack.use(
getEndpointPlugin(configuration, WriteGetObjectResponseCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getWriteGetObjectResponseEndpointPlugin(configuration));

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

Expand Down
1 change: 0 additions & 1 deletion clients/client-s3/test/S3.spec.ts
Expand Up @@ -136,7 +136,6 @@ describe("Endpoints from ARN", () => {
expect(result.request.headers["authorization"]).contains(
`Credential=${credentials.accessKeyId}/${date}/${region}/s3-object-lambda/aws4_request`
);
expect(result.request.headers["transfer-encoding"]).to.equal("chunked");
});
});
});
Expand Down
Expand Up @@ -180,12 +180,6 @@ public List<RuntimeClientPlugin> getClientPlugins() {
(m, s, o) -> EXCEPTIONS_OF_200_OPERATIONS.contains(o.getId().getName(s))
&& isS3(s))
.build(),
RuntimeClientPlugin.builder()
.withConventions(AwsDependency.S3_MIDDLEWARE.dependency,
"WriteGetObjectResponseEndpoint", HAS_MIDDLEWARE)
.operationPredicate((m, s, o) -> isS3(s)
&& o.getId().getName(s).equals("WriteGetObjectResponse"))
.build(),
RuntimeClientPlugin.builder()
.withConventions(AwsDependency.ADD_EXPECT_CONTINUE.dependency, "AddExpectContinue",
HAS_MIDDLEWARE)
Expand Down
1 change: 0 additions & 1 deletion packages/middleware-sdk-s3/package.json
Expand Up @@ -20,7 +20,6 @@
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/middleware-bucket-endpoint": "*",
"@aws-sdk/protocol-http": "*",
"@aws-sdk/types": "*",
"@aws-sdk/util-arn-parser": "*",
Expand Down
1 change: 0 additions & 1 deletion packages/middleware-sdk-s3/src/index.ts
Expand Up @@ -2,4 +2,3 @@ export * from "./check-content-length-header";
export * from "./configuration";
export * from "./throw-200-exceptions";
export * from "./validate-bucket-name";
export * from "./write-get-object-response-endpoint";

This file was deleted.

This file was deleted.

0 comments on commit d229edd

Please sign in to comment.