@aws-sdk/s3-presigned-post 3.252.0 → 3.254.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint");
6
6
  const signature_v4_1 = require("@aws-sdk/signature-v4");
7
7
  const util_format_url_1 = require("@aws-sdk/util-format-url");
8
8
  const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding");
9
+ const util_utf8_1 = require("@aws-sdk/util-utf8");
9
10
  const constants_1 = require("./constants");
10
11
  const createPresignedPost = async (client, { Bucket, Key, Conditions = [], Fields = {}, Expires = 3600 }) => {
11
12
  var _a, _b;
@@ -64,6 +65,6 @@ exports.createPresignedPost = createPresignedPost;
64
65
  const iso8601 = (date) => date.toISOString().replace(/\.\d{3}Z$/, "Z");
65
66
  const hmac = (ctor, secret, data) => {
66
67
  const hash = new ctor(secret);
67
- hash.update(data);
68
+ hash.update((0, util_utf8_1.toUint8Array)(data));
68
69
  return hash.digest();
69
70
  };
@@ -3,6 +3,7 @@ import { getEndpointFromInstructions, toEndpointV1, } from "@aws-sdk/middleware-
3
3
  import { createScope, getSigningKey } from "@aws-sdk/signature-v4";
4
4
  import { formatUrl } from "@aws-sdk/util-format-url";
5
5
  import { toHex } from "@aws-sdk/util-hex-encoding";
6
+ import { toUint8Array } from "@aws-sdk/util-utf8";
6
7
  import { ALGORITHM_IDENTIFIER, ALGORITHM_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, } from "./constants";
7
8
  export const createPresignedPost = async (client, { Bucket, Key, Conditions = [], Fields = {}, Expires = 3600 }) => {
8
9
  const { systemClockOffset, base64Encoder, utf8Decoder, sha256 } = client.config;
@@ -59,6 +60,6 @@ export const createPresignedPost = async (client, { Bucket, Key, Conditions = []
59
60
  const iso8601 = (date) => date.toISOString().replace(/\.\d{3}Z$/, "Z");
60
61
  const hmac = (ctor, secret, data) => {
61
62
  const hash = new ctor(secret);
62
- hash.update(data);
63
+ hash.update(toUint8Array(data));
63
64
  return hash.digest();
64
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/s3-presigned-post",
3
- "version": "3.252.0",
3
+ "version": "3.254.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,17 +20,18 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/middleware-endpoint": "3.226.0",
24
- "@aws-sdk/signature-v4": "3.226.0",
25
- "@aws-sdk/types": "3.226.0",
26
- "@aws-sdk/util-format-url": "3.226.0",
23
+ "@aws-sdk/middleware-endpoint": "3.254.0",
24
+ "@aws-sdk/signature-v4": "3.254.0",
25
+ "@aws-sdk/types": "3.254.0",
26
+ "@aws-sdk/util-format-url": "3.254.0",
27
27
  "@aws-sdk/util-hex-encoding": "3.201.0",
28
+ "@aws-sdk/util-utf8": "3.254.0",
28
29
  "tslib": "^2.3.1"
29
30
  },
30
31
  "devDependencies": {
31
- "@aws-sdk/client-s3": "3.252.0",
32
- "@aws-sdk/hash-node": "3.226.0",
33
- "@aws-sdk/protocol-http": "3.226.0",
32
+ "@aws-sdk/client-s3": "3.254.0",
33
+ "@aws-sdk/hash-node": "3.254.0",
34
+ "@aws-sdk/protocol-http": "3.254.0",
34
35
  "@tsconfig/recommended": "1.0.1",
35
36
  "@types/node": "^14.14.31",
36
37
  "concurrently": "7.0.0",