@aws-sdk/middleware-sdk-s3 3.58.0 → 3.66.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.66.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.65.0...v3.66.0) (2022-04-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * **signature-v4-multi-region:** support multi-region sigv4a signer ([#3518](https://github.com/aws/aws-sdk-js-v3/issues/3518)) ([16aa220](https://github.com/aws/aws-sdk-js-v3/commit/16aa22042c92b33c702f775b87e830fb767e479c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28)
7
18
 
8
19
  **Note:** Version bump only for package @aws-sdk/middleware-sdk-s3
package/dist-cjs/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./S3SignatureV4"), exports);
5
4
  tslib_1.__exportStar(require("./throw-200-exceptions"), exports);
6
5
  tslib_1.__exportStar(require("./use-regional-endpoint"), exports);
7
6
  tslib_1.__exportStar(require("./validate-bucket-name"), exports);
package/dist-es/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./S3SignatureV4";
2
1
  export * from "./throw-200-exceptions";
3
2
  export * from "./use-regional-endpoint";
4
3
  export * from "./validate-bucket-name";
@@ -1,4 +1,3 @@
1
- export * from "./S3SignatureV4";
2
1
  export * from "./throw-200-exceptions";
3
2
  export * from "./use-regional-endpoint";
4
3
  export * from "./validate-bucket-name";
@@ -1,4 +1,3 @@
1
- export * from "./S3SignatureV4";
2
1
  export * from "./throw-200-exceptions";
3
2
  export * from "./use-regional-endpoint";
4
3
  export * from "./validate-bucket-name";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-s3",
3
- "version": "3.58.0",
3
+ "version": "3.66.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",
@@ -13,12 +13,6 @@
13
13
  "main": "./dist-cjs/index.js",
14
14
  "module": "./dist-es/index.js",
15
15
  "types": "./dist-types/index.d.ts",
16
- "browser": {
17
- "@aws-sdk/signature-v4-crt": false
18
- },
19
- "react-native": {
20
- "@aws-sdk/signature-v4-crt": false
21
- },
22
16
  "author": {
23
17
  "name": "AWS SDK for JavaScript Team",
24
18
  "url": "https://aws.amazon.com/javascript/"
@@ -26,13 +20,11 @@
26
20
  "license": "Apache-2.0",
27
21
  "dependencies": {
28
22
  "@aws-sdk/protocol-http": "3.58.0",
29
- "@aws-sdk/signature-v4": "3.58.0",
30
23
  "@aws-sdk/types": "3.55.0",
31
24
  "@aws-sdk/util-arn-parser": "3.55.0",
32
25
  "tslib": "^2.3.1"
33
26
  },
34
27
  "devDependencies": {
35
- "@aws-sdk/signature-v4-crt": "3.58.0",
36
28
  "@tsconfig/recommended": "1.0.1",
37
29
  "concurrently": "7.0.0",
38
30
  "downlevel-dts": "0.7.0",
@@ -40,14 +32,6 @@
40
32
  "typedoc": "0.19.2",
41
33
  "typescript": "~4.6.2"
42
34
  },
43
- "peerDependencies": {
44
- "@aws-sdk/signature-v4-crt": "^3.54.1"
45
- },
46
- "peerDependenciesMeta": {
47
- "@aws-sdk/signature-v4-crt": {
48
- "optional": true
49
- }
50
- },
51
35
  "engines": {
52
36
  "node": ">= 12.0.0"
53
37
  },
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.S3SignatureV4 = void 0;
4
- const signature_v4_1 = require("@aws-sdk/signature-v4");
5
- class S3SignatureV4 {
6
- constructor(options) {
7
- this.sigv4Signer = new signature_v4_1.SignatureV4(options);
8
- this.signerOptions = options;
9
- }
10
- async sign(requestToSign, options = {}) {
11
- if (options.signingRegion === "*") {
12
- if (this.signerOptions.runtime !== "node")
13
- throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
14
- return this.getSigv4aSigner().sign(requestToSign, options);
15
- }
16
- return this.sigv4Signer.sign(requestToSign, options);
17
- }
18
- async presign(originalRequest, options = {}) {
19
- if (options.signingRegion === "*") {
20
- if (this.signerOptions.runtime !== "node")
21
- throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
22
- return this.getSigv4aSigner().presign(originalRequest, options);
23
- }
24
- return this.sigv4Signer.presign(originalRequest, options);
25
- }
26
- getSigv4aSigner() {
27
- if (!this.sigv4aSigner) {
28
- let CrtSignerV4;
29
- try {
30
- CrtSignerV4 = require("@aws-sdk/signature-v4-crt").CrtSignerV4;
31
- if (typeof CrtSignerV4 !== "function")
32
- throw new Error();
33
- }
34
- catch (e) {
35
- e.message =
36
- `${e.message}\nPlease check if you have installed "@aws-sdk/signature-v4-crt" package explicitly. \n` +
37
- "For more information please go to " +
38
- "https://github.com/aws/aws-sdk-js-v3##functionality-requiring-aws-common-runtime-crt";
39
- throw e;
40
- }
41
- this.sigv4aSigner = new CrtSignerV4({
42
- ...this.signerOptions,
43
- signingAlgorithm: 1,
44
- });
45
- }
46
- return this.sigv4aSigner;
47
- }
48
- }
49
- exports.S3SignatureV4 = S3SignatureV4;
@@ -1,55 +0,0 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
- import { SignatureV4 } from "@aws-sdk/signature-v4";
3
- var S3SignatureV4 = (function () {
4
- function S3SignatureV4(options) {
5
- this.sigv4Signer = new SignatureV4(options);
6
- this.signerOptions = options;
7
- }
8
- S3SignatureV4.prototype.sign = function (requestToSign, options) {
9
- if (options === void 0) { options = {}; }
10
- return __awaiter(this, void 0, void 0, function () {
11
- return __generator(this, function (_a) {
12
- if (options.signingRegion === "*") {
13
- if (this.signerOptions.runtime !== "node")
14
- throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
15
- return [2, this.getSigv4aSigner().sign(requestToSign, options)];
16
- }
17
- return [2, this.sigv4Signer.sign(requestToSign, options)];
18
- });
19
- });
20
- };
21
- S3SignatureV4.prototype.presign = function (originalRequest, options) {
22
- if (options === void 0) { options = {}; }
23
- return __awaiter(this, void 0, void 0, function () {
24
- return __generator(this, function (_a) {
25
- if (options.signingRegion === "*") {
26
- if (this.signerOptions.runtime !== "node")
27
- throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
28
- return [2, this.getSigv4aSigner().presign(originalRequest, options)];
29
- }
30
- return [2, this.sigv4Signer.presign(originalRequest, options)];
31
- });
32
- });
33
- };
34
- S3SignatureV4.prototype.getSigv4aSigner = function () {
35
- if (!this.sigv4aSigner) {
36
- var CrtSignerV4_1;
37
- try {
38
- CrtSignerV4_1 = require("@aws-sdk/signature-v4-crt").CrtSignerV4;
39
- if (typeof CrtSignerV4_1 !== "function")
40
- throw new Error();
41
- }
42
- catch (e) {
43
- e.message =
44
- "".concat(e.message, "\nPlease check if you have installed \"@aws-sdk/signature-v4-crt\" package explicitly. \n") +
45
- "For more information please go to " +
46
- "https://github.com/aws/aws-sdk-js-v3##functionality-requiring-aws-common-runtime-crt";
47
- throw e;
48
- }
49
- this.sigv4aSigner = new CrtSignerV4_1(__assign(__assign({}, this.signerOptions), { signingAlgorithm: 1 }));
50
- }
51
- return this.sigv4aSigner;
52
- };
53
- return S3SignatureV4;
54
- }());
55
- export { S3SignatureV4 };
@@ -1,22 +0,0 @@
1
- import { SignatureV4CryptoInit, SignatureV4Init } from "@aws-sdk/signature-v4";
2
- import { HttpRequest, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments } from "@aws-sdk/types";
3
- export declare type S3SignerV4Init = SignatureV4Init & SignatureV4CryptoInit & {
4
- runtime?: string;
5
- };
6
- /**
7
- * A SigV4-compatible signer for S3 service. In order to support SigV4a algorithm according to the operation input
8
- * dynamically, the signer wraps native module SigV4a signer and JS SigV4 signer. It signs the request with SigV4a
9
- * algorithm if the request needs to be signed with `*` region. Otherwise, it signs the request with normal SigV4
10
- * signer.
11
- * Note that SigV4a signer is only supported in Node.js now because it depends on a native dependency.
12
- * @private
13
- */
14
- export declare class S3SignatureV4 implements RequestPresigner, RequestSigner {
15
- private readonly sigv4Signer;
16
- private sigv4aSigner?;
17
- private readonly signerOptions;
18
- constructor(options: S3SignerV4Init);
19
- sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
20
- presign(originalRequest: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
21
- private getSigv4aSigner;
22
- }
@@ -1,15 +0,0 @@
1
- import { SignatureV4CryptoInit, SignatureV4Init } from "@aws-sdk/signature-v4";
2
- import { HttpRequest, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments } from "@aws-sdk/types";
3
- export declare type S3SignerV4Init = SignatureV4Init & SignatureV4CryptoInit & {
4
- runtime?: string;
5
- };
6
-
7
- export declare class S3SignatureV4 implements RequestPresigner, RequestSigner {
8
- private readonly sigv4Signer;
9
- private sigv4aSigner?;
10
- private readonly signerOptions;
11
- constructor(options: S3SignerV4Init);
12
- sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
13
- presign(originalRequest: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
14
- private getSigv4aSigner;
15
- }