Skip to content

Commit ae04135

Browse files
Chase Coalwelltrivikr
Chase Coalwell
authored andcommitted
fix: add BucketEndpoint config plugin (#572)
* fix: add BucketEndpoint config plugin * fix: package exports
1 parent 06383bb commit ae04135

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ && testServiceId(s, "S3"))
118118
.operationPredicate((m, s, o) -> o.getId().getName().equals("Predict")
119119
&& testServiceId(s, "Machine Learning"))
120120
.build(),
121+
/**
122+
* BUCKET_ENDPOINT_MIDDLEWARE needs two separate plugins. The first resolves the config in the client.
123+
* The second applies the middleware to bucket endpoint operations.
124+
*/
125+
RuntimeClientPlugin.builder()
126+
.withConventions(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE.dependency, "BucketEndpoint",
127+
HAS_CONFIG)
128+
.servicePredicate((m, s) -> testServiceId(s, "S3"))
129+
.build(),
121130
RuntimeClientPlugin.builder()
122131
.withConventions(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE.dependency, "BucketEndpoint",
123132
HAS_MIDDLEWARE)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {
2+
bucketEndpointMiddleware,
3+
getBucketEndpointPlugin,
4+
resolveBucketEndpointConfig
5+
} from "./index";
6+
7+
describe("middleware-bucket-endpoint package exports", () => {
8+
it("bucketEndpointMiddleware", () => {
9+
expect(typeof bucketEndpointMiddleware).toBe("function");
10+
});
11+
12+
it("getBucketEndpointPlugin", () => {
13+
expect(typeof getBucketEndpointPlugin).toBe("function");
14+
});
15+
16+
it("resolveBucketEndpointConfig", () => {
17+
expect(typeof resolveBucketEndpointConfig).toBe("function");
18+
});
19+
});
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from "./bucketEndpointMiddleware";
22
export * from "./bucketHostname";
3+
export * from "./configurations";

0 commit comments

Comments
 (0)