Skip to content

Commit 6f07c3d

Browse files
committed
test(signature-v4-multi-region): region inline and version update
1 parent 5db4c62 commit 6f07c3d

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

clients/client-s3/test/e2e/s3-mrap-sigv4a.e2e.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
import "@smithy/signature-v4a";
2+
13
import {
2-
S3Client,
34
CreateBucketCommand,
45
HeadBucketCommand,
56
ListObjectsV2Command,
7+
S3Client,
68
waitUntilBucketExists,
79
} from "@aws-sdk/client-s3";
810
import {
9-
S3ControlClient,
1011
CreateMultiRegionAccessPointCommand,
1112
DescribeMultiRegionAccessPointOperationCommand,
1213
GetMultiRegionAccessPointCommand,
1314
Region as S3ControlRegion,
15+
S3ControlClient,
1416
} from "@aws-sdk/client-s3-control";
15-
import { STSClient, GetCallerIdentityCommand } from "@aws-sdk/client-sts";
16-
import { describe, it, expect, beforeAll, afterAll, vi } from "vitest";
17-
18-
import "@smithy/signature-v4a";
17+
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
18+
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
1919

2020
const MRAP_NAME = "jsv3-e2e-mrap-sigv4a-min";
2121
const BUCKET_PREFIX = "jsv3-e2e-mrap-sigv4a-min-";

packages/signature-v4-multi-region/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@aws-sdk/types": "*",
2828
"@smithy/protocol-http": "^5.1.0",
2929
"@smithy/signature-v4": "^5.0.2",
30-
"@smithy/signature-v4a": "file:../../../smithy-typescript/packages/signature-v4a/package.tgz",
30+
"@smithy/signature-v4a": "^3.0.0",
3131
"@smithy/types": "^4.2.0",
3232
"tslib": "^2.6.2"
3333
},

packages/signature-v4-multi-region/src/SignatureV4MultiRegion.browser.integ.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("SignatureV4MultiRegion (Browser Bundle SigV4a Test)", () => {
2828
async digest() {
2929
return Buffer.from(this.hash, "hex");
3030
}
31-
update(chunk: Uint8Array | string) {
31+
update() {
3232
// No-op
3333
}
3434
reset() {

packages/signature-v4-multi-region/src/cloudfront-kvs-sigv4a.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe("CloudFront KeyValue Store with SignatureV4a (JS Implementation)", () =
5757
beforeAll(async () => {
5858
vi.setConfig({ testTimeout: LONG_TIMEOUT, hookTimeout: LONG_TIMEOUT });
5959

60-
const stsClient = new STSClient({});
60+
const stsClient = new STSClient({ region: "us-west-2" });
6161
const { Account } = await stsClient.send(new GetCallerIdentityCommand({}));
6262
const timestamp = Date.now();
6363
keyValueStoreName = `test-store-${Account}-${timestamp}`;

packages/signature-v4-multi-region/src/eventbridge-sigv4a-put-api.e2e.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ const getSubdomainFromUrl = (url: string | undefined): string | undefined => {
3838
// Check if the 3rd part from the end is 'events'
3939
if (hostnameParts.length >= 5 && hostnameParts[hostnameParts.length - 3] === "events") {
4040
return `${hostnameParts[0]}.${hostnameParts[1]}`;
41-
} else {
42-
console.warn(`Hostname format unexpected: ${parsedUrl.hostname}`);
4341
}
4442
} catch (e) {
4543
console.error(`Error parsing EndpointUrl: ${url}`, e);
@@ -112,7 +110,7 @@ describe("EventBridge Client with SignatureV4a", () => {
112110
primaryRegion = "us-west-2";
113111
secondaryRegion = "us-east-1";
114112

115-
stsClient = new STSClient({});
113+
stsClient = new STSClient({ region: primaryRegion });
116114
primaryEbClient = new EventBridgeClient({ region: primaryRegion });
117115
secondaryEbClient = new EventBridgeClient({ region: secondaryRegion });
118116
route53Client = new Route53Client({ region: "us-west-2" });

0 commit comments

Comments
 (0)