Skip to content

Commit

Permalink
fix: add BucketEndpoint config plugin (#572)
Browse files Browse the repository at this point in the history
* fix: add BucketEndpoint config plugin

* fix: package exports
  • Loading branch information
Chase Coalwell authored and trivikr committed Jan 3, 2020
1 parent 06383bb commit ae04135
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ && testServiceId(s, "S3"))
.operationPredicate((m, s, o) -> o.getId().getName().equals("Predict")
&& testServiceId(s, "Machine Learning"))
.build(),
/**
* BUCKET_ENDPOINT_MIDDLEWARE needs two separate plugins. The first resolves the config in the client.
* The second applies the middleware to bucket endpoint operations.
*/
RuntimeClientPlugin.builder()
.withConventions(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE.dependency, "BucketEndpoint",
HAS_CONFIG)
.servicePredicate((m, s) -> testServiceId(s, "S3"))
.build(),
RuntimeClientPlugin.builder()
.withConventions(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE.dependency, "BucketEndpoint",
HAS_MIDDLEWARE)
Expand Down
19 changes: 19 additions & 0 deletions packages/middleware-bucket-endpoint/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
bucketEndpointMiddleware,
getBucketEndpointPlugin,
resolveBucketEndpointConfig
} from "./index";

describe("middleware-bucket-endpoint package exports", () => {
it("bucketEndpointMiddleware", () => {
expect(typeof bucketEndpointMiddleware).toBe("function");
});

it("getBucketEndpointPlugin", () => {
expect(typeof getBucketEndpointPlugin).toBe("function");
});

it("resolveBucketEndpointConfig", () => {
expect(typeof resolveBucketEndpointConfig).toBe("function");
});
});
1 change: 1 addition & 0 deletions packages/middleware-bucket-endpoint/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./bucketEndpointMiddleware";
export * from "./bucketHostname";
export * from "./configurations";

0 comments on commit ae04135

Please sign in to comment.