Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add BucketEndpoint config plugin #572

Merged
merged 2 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";