Skip to content

Commit 3c23a83

Browse files
authored
chore: update @aws-crypto/* to 5.2.0 series (#1306)
* chore: update @aws-crypto/* to 5.2.0 series * fix unit test * update yarn lock
1 parent b137126 commit 3c23a83

File tree

8 files changed

+78
-50
lines changed

8 files changed

+78
-50
lines changed

.changeset/afraid-cooks-grin.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@smithy/eventstream-codec": minor
3+
"@smithy/hash-blob-browser": minor
4+
"@smithy/hash-stream-node": minor
5+
"@smithy/signature-v4": minor
6+
---
7+
8+
update versions of @aws-crypto/\* packages

packages/eventstream-codec/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"license": "Apache-2.0",
2424
"dependencies": {
25-
"@aws-crypto/crc32": "3.0.0",
25+
"@aws-crypto/crc32": "5.2.0",
2626
"@smithy/types": "workspace:^",
2727
"@smithy/util-hex-encoding": "workspace:^",
2828
"tslib": "^2.6.2"

packages/hash-blob-browser/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"tslib": "^2.6.2"
2929
},
3030
"devDependencies": {
31-
"@aws-crypto/sha256-js": "3.0.0",
3231
"@smithy/util-hex-encoding": "workspace:^",
3332
"concurrently": "7.0.0",
3433
"downlevel-dts": "0.10.1",
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
import { Sha256 } from "@aws-crypto/sha256-js";
21
import { toHex } from "@smithy/util-hex-encoding";
32

43
import { blobHasher } from "./index";
54

65
describe("blobHasher", () => {
7-
const blob = new Blob(["Shot through the bar, but you're too late bizzbuzz you give foo, a bad name."]);
6+
const blob = new Blob(["test-string"]);
87

9-
it("calculates the SHA256 hash of a blob", async () => {
10-
const result = await blobHasher(Sha256, blob);
8+
class Hash {
9+
public value: string;
10+
update(value: string) {
11+
this.value = value;
12+
}
13+
async digest() {
14+
return new TextEncoder().encode(this.value);
15+
}
16+
}
17+
18+
it("calls update and digest of the given Hash class on the blob", async () => {
19+
const result = await blobHasher(Hash, blob);
1120

1221
expect(result instanceof Uint8Array).toBe(true);
13-
expect(toHex(result)).toBe("24dabf4db3774a3224d571d4c089a9c570c3045dbe1e67ee9ee2e2677f57dbe0");
22+
expect(toHex(result)).toBe("3131362c3130312c3131352c3131362c34352c3131352c3131362c3131342c3130352c3131302c313033");
1423
});
1524
});

packages/hash-stream-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"tslib": "^2.6.2"
2828
},
2929
"devDependencies": {
30-
"@aws-crypto/sha256-js": "3.0.0",
30+
"@aws-crypto/sha256-js": "5.2.0",
3131
"@smithy/util-hex-encoding": "workspace:^",
3232
"@types/node": "^16.18.96",
3333
"concurrently": "7.0.0",

packages/signature-v4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"tslib": "^2.6.2"
3434
},
3535
"devDependencies": {
36-
"@aws-crypto/sha256-js": "3.0.0",
36+
"@aws-crypto/sha256-js": "5.2.0",
3737
"@smithy/protocol-http": "workspace:^",
3838
"concurrently": "7.0.0",
3939
"downlevel-dts": "0.10.1",

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public enum TypeScriptDependency implements Dependency {
5656
@Deprecated AWS_SDK_UTIL_ENDPOINTS("dependencies", "@aws-sdk/util-endpoints", false),
5757
UTIL_ENDPOINTS("dependencies", "@smithy/util-endpoints", false),
5858

59-
AWS_CRYPTO_SHA256_BROWSER("dependencies", "@aws-crypto/sha256-browser", "3.0.0", true),
60-
AWS_CRYPTO_SHA256_JS("dependencies", "@aws-crypto/sha256-js", "3.0.0", true),
59+
AWS_CRYPTO_SHA256_BROWSER("dependencies", "@aws-crypto/sha256-browser", "5.2.0", true),
60+
AWS_CRYPTO_SHA256_JS("dependencies", "@aws-crypto/sha256-js", "5.2.0", true),
6161

6262
AWS_SDK_HASH_NODE("dependencies", "@smithy/hash-node", true),
6363

yarn.lock

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ __metadata:
1515
languageName: node
1616
linkType: hard
1717

18-
"@aws-crypto/crc32@npm:3.0.0":
19-
version: 3.0.0
20-
resolution: "@aws-crypto/crc32@npm:3.0.0"
18+
"@aws-crypto/crc32@npm:5.2.0":
19+
version: 5.2.0
20+
resolution: "@aws-crypto/crc32@npm:5.2.0"
2121
dependencies:
22-
"@aws-crypto/util": ^3.0.0
22+
"@aws-crypto/util": ^5.2.0
2323
"@aws-sdk/types": ^3.222.0
24-
tslib: ^1.11.1
25-
checksum: 9fdb3e837fc54119b017ea34fd0a6d71d2c88075d99e1e818a5158e0ad30ced67ddbcc423a11ceeef6cc465ab5ffd91830acab516470b48237ca7abd51be9642
24+
tslib: ^2.6.2
25+
checksum: 1ddf7ec3fccf106205ff2476d90ae1d6625eabd47752f689c761b71e41fe451962b7a1c9ed25fe54e17dd747a62fbf4de06030fe56fe625f95285f6f70b96c57
2626
languageName: node
2727
linkType: hard
2828

29-
"@aws-crypto/sha256-js@npm:3.0.0":
30-
version: 3.0.0
31-
resolution: "@aws-crypto/sha256-js@npm:3.0.0"
29+
"@aws-crypto/sha256-js@npm:5.2.0":
30+
version: 5.2.0
31+
resolution: "@aws-crypto/sha256-js@npm:5.2.0"
3232
dependencies:
33-
"@aws-crypto/util": ^3.0.0
33+
"@aws-crypto/util": ^5.2.0
3434
"@aws-sdk/types": ^3.222.0
35-
tslib: ^1.11.1
36-
checksum: 644ded32ea310237811afae873d3c7320739cb6f6cc39dced9c94801379e68e5ee2cca0c34f0384793fa9e750a7e0a5e2468f95754bd08e6fd72ab833c8fe23c
35+
tslib: ^2.6.2
36+
checksum: 007fbe0436d714d0d0d282e2b61c90e45adcb9ad75eac9ac7ba03d32b56624afd09b2a9ceb4d659661cf17c51d74d1900ab6b00eacafc002da1101664955ca53
3737
languageName: node
3838
linkType: hard
3939

40-
"@aws-crypto/util@npm:^3.0.0":
41-
version: 3.0.0
42-
resolution: "@aws-crypto/util@npm:3.0.0"
40+
"@aws-crypto/util@npm:^5.2.0":
41+
version: 5.2.0
42+
resolution: "@aws-crypto/util@npm:5.2.0"
4343
dependencies:
4444
"@aws-sdk/types": ^3.222.0
45-
"@aws-sdk/util-utf8-browser": ^3.0.0
46-
tslib: ^1.11.1
47-
checksum: d29d5545048721aae3d60b236708535059733019a105f8a64b4e4a8eab7cf8dde1546dc56bff7de20d36140a4d1f0f4693e639c5732a7059273a7b1e56354776
45+
"@smithy/util-utf8": ^2.0.0
46+
tslib: ^2.6.2
47+
checksum: f0f81d9d2771c59946cfec48b86cb23d39f78a966c4a1f89d4753abdc3cb38de06f907d1e6450059b121d48ac65d612ab88bdb70014553a077fc3dabddfbf8d6
4848
languageName: node
4949
linkType: hard
5050

@@ -57,15 +57,6 @@ __metadata:
5757
languageName: node
5858
linkType: hard
5959

60-
"@aws-sdk/util-utf8-browser@npm:^3.0.0":
61-
version: 3.259.0
62-
resolution: "@aws-sdk/util-utf8-browser@npm:3.259.0"
63-
dependencies:
64-
tslib: ^2.3.1
65-
checksum: b6a1e580da1c9b62c749814182a7649a748ca4253edb4063aa521df97d25b76eae3359eb1680b86f71aac668e05cc05c514379bca39ebf4ba998ae4348412da8
66-
languageName: node
67-
linkType: hard
68-
6960
"@aws-smithy/server-apigateway@workspace:smithy-typescript-ssdk-libs/server-apigateway":
7061
version: 0.0.0-use.local
7162
resolution: "@aws-smithy/server-apigateway@workspace:smithy-typescript-ssdk-libs/server-apigateway"
@@ -2261,7 +2252,7 @@ __metadata:
22612252
version: 0.0.0-use.local
22622253
resolution: "@smithy/eventstream-codec@workspace:packages/eventstream-codec"
22632254
dependencies:
2264-
"@aws-crypto/crc32": 3.0.0
2255+
"@aws-crypto/crc32": 5.2.0
22652256
"@smithy/types": "workspace:^"
22662257
"@smithy/util-hex-encoding": "workspace:^"
22672258
"@smithy/util-utf8": "workspace:^"
@@ -2373,7 +2364,6 @@ __metadata:
23732364
version: 0.0.0-use.local
23742365
resolution: "@smithy/hash-blob-browser@workspace:packages/hash-blob-browser"
23752366
dependencies:
2376-
"@aws-crypto/sha256-js": 3.0.0
23772367
"@smithy/chunked-blob-reader": "workspace:^"
23782368
"@smithy/chunked-blob-reader-native": "workspace:^"
23792369
"@smithy/types": "workspace:^"
@@ -2407,7 +2397,7 @@ __metadata:
24072397
version: 0.0.0-use.local
24082398
resolution: "@smithy/hash-stream-node@workspace:packages/hash-stream-node"
24092399
dependencies:
2410-
"@aws-crypto/sha256-js": 3.0.0
2400+
"@aws-crypto/sha256-js": 5.2.0
24112401
"@smithy/types": "workspace:^"
24122402
"@smithy/util-hex-encoding": "workspace:^"
24132403
"@smithy/util-utf8": "workspace:^"
@@ -2433,6 +2423,15 @@ __metadata:
24332423
languageName: unknown
24342424
linkType: soft
24352425

2426+
"@smithy/is-array-buffer@npm:^2.2.0":
2427+
version: 2.2.0
2428+
resolution: "@smithy/is-array-buffer@npm:2.2.0"
2429+
dependencies:
2430+
tslib: ^2.6.2
2431+
checksum: cd12c2e27884fec89ca8966d33c9dc34d3234efe89b33a9b309c61ebcde463e6f15f6a02d31d4fddbfd6e5904743524ca5b95021b517b98fe10957c2da0cd5fc
2432+
languageName: node
2433+
linkType: hard
2434+
24362435
"@smithy/is-array-buffer@workspace:^, @smithy/is-array-buffer@workspace:packages/is-array-buffer":
24372436
version: 0.0.0-use.local
24382437
resolution: "@smithy/is-array-buffer@workspace:packages/is-array-buffer"
@@ -2710,7 +2709,7 @@ __metadata:
27102709
version: 0.0.0-use.local
27112710
resolution: "@smithy/signature-v4@workspace:packages/signature-v4"
27122711
dependencies:
2713-
"@aws-crypto/sha256-js": 3.0.0
2712+
"@aws-crypto/sha256-js": 5.2.0
27142713
"@smithy/is-array-buffer": "workspace:^"
27152714
"@smithy/protocol-http": "workspace:^"
27162715
"@smithy/types": "workspace:^"
@@ -2810,6 +2809,16 @@ __metadata:
28102809
languageName: unknown
28112810
linkType: soft
28122811

2812+
"@smithy/util-buffer-from@npm:^2.2.0":
2813+
version: 2.2.0
2814+
resolution: "@smithy/util-buffer-from@npm:2.2.0"
2815+
dependencies:
2816+
"@smithy/is-array-buffer": ^2.2.0
2817+
tslib: ^2.6.2
2818+
checksum: 424c5b7368ae5880a8f2732e298d17879a19ca925f24ca45e1c6c005f717bb15b76eb28174d308d81631ad457ea0088aab0fd3255dd42f45a535c81944ad64d3
2819+
languageName: node
2820+
linkType: hard
2821+
28132822
"@smithy/util-buffer-from@workspace:^, @smithy/util-buffer-from@workspace:packages/util-buffer-from":
28142823
version: 0.0.0-use.local
28152824
resolution: "@smithy/util-buffer-from@workspace:packages/util-buffer-from"
@@ -3010,6 +3019,16 @@ __metadata:
30103019
languageName: unknown
30113020
linkType: soft
30123021

3022+
"@smithy/util-utf8@npm:^2.0.0":
3023+
version: 2.3.0
3024+
resolution: "@smithy/util-utf8@npm:2.3.0"
3025+
dependencies:
3026+
"@smithy/util-buffer-from": ^2.2.0
3027+
tslib: ^2.6.2
3028+
checksum: 00e55d4b4e37d48be0eef3599082402b933c52a1407fed7e8e8ad76d94d81a0b30b8bfaf2047c59d9c3af31e5f20e7a8c959cb7ae270f894255e05a2229964f0
3029+
languageName: node
3030+
linkType: hard
3031+
30133032
"@smithy/util-utf8@workspace:^, @smithy/util-utf8@workspace:packages/util-utf8":
30143033
version: 0.0.0-use.local
30153034
resolution: "@smithy/util-utf8@workspace:packages/util-utf8"
@@ -10617,20 +10636,13 @@ __metadata:
1061710636
languageName: node
1061810637
linkType: hard
1061910638

10620-
"tslib@npm:^1.11.1, tslib@npm:^1.8.0, tslib@npm:^1.9.0":
10639+
"tslib@npm:^1.8.0, tslib@npm:^1.9.0":
1062110640
version: 1.14.1
1062210641
resolution: "tslib@npm:1.14.1"
1062310642
checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd
1062410643
languageName: node
1062510644
linkType: hard
1062610645

10627-
"tslib@npm:^2.3.1":
10628-
version: 2.5.3
10629-
resolution: "tslib@npm:2.5.3"
10630-
checksum: 88902b309afaf83259131c1e13da1dceb0ad1682a213143a1346a649143924d78cf3760c448b84d796938fd76127183894f8d85cbb3bf9c4fddbfcc140c0003c
10631-
languageName: node
10632-
linkType: hard
10633-
1063410646
"tslib@npm:^2.5.0":
1063510647
version: 2.5.0
1063610648
resolution: "tslib@npm:2.5.0"

0 commit comments

Comments
 (0)