@cdk8s/awscdk-resolver 0.0.101 → 0.0.102

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.
Files changed (137) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/package.json +5 -5
  4. package/node_modules/@aws-sdk/client-sso/package.json +2 -2
  5. package/node_modules/@aws-sdk/client-sso-oidc/package.json +4 -4
  6. package/node_modules/@aws-sdk/client-sts/package.json +4 -4
  7. package/node_modules/@aws-sdk/core/README.md +35 -1
  8. package/node_modules/@aws-sdk/core/client.js +5 -0
  9. package/node_modules/@aws-sdk/core/dist-cjs/index.js +5 -437
  10. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +38 -0
  11. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +226 -0
  12. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +228 -0
  13. package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
  14. package/node_modules/@aws-sdk/core/dist-types/index.d.ts +22 -3
  15. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +3 -3
  16. package/node_modules/@aws-sdk/core/httpAuthSchemes.js +5 -0
  17. package/node_modules/@aws-sdk/core/package.json +39 -2
  18. package/node_modules/@aws-sdk/core/protocols.js +5 -0
  19. package/node_modules/@aws-sdk/credential-provider-ini/package.json +3 -3
  20. package/node_modules/@aws-sdk/credential-provider-node/package.json +3 -3
  21. package/node_modules/@aws-sdk/credential-provider-sso/package.json +2 -2
  22. package/node_modules/@smithy/core/package.json +3 -3
  23. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +10 -3
  24. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +10 -3
  25. package/node_modules/@smithy/fetch-http-handler/package.json +1 -1
  26. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  27. package/node_modules/@smithy/smithy-client/package.json +2 -2
  28. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  29. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  30. package/node_modules/@smithy/util-stream/package.json +2 -2
  31. package/package.json +4 -4
  32. package/node_modules/@aws-sdk/core/CHANGELOG.md +0 -323
  33. package/node_modules/@aws-sdk/core/api-extractor.json +0 -4
  34. package/node_modules/@aws-sdk/core/dist-cjs/client/emitWarningIfUnsupportedVersion.js +0 -1
  35. package/node_modules/@aws-sdk/core/dist-cjs/client/index.js +0 -1
  36. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +0 -1
  37. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws_sdk/index.js +0 -1
  38. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +0 -1
  39. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/index.js +0 -1
  40. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getDateHeader.js +0 -1
  41. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getSkewCorrectedDate.js +0 -1
  42. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +0 -1
  43. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/index.js +0 -1
  44. package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/isClockSkewed.js +0 -1
  45. package/node_modules/@aws-sdk/core/dist-cjs/protocols/coercing-serializers.js +0 -1
  46. package/node_modules/@aws-sdk/core/dist-cjs/protocols/common.js +0 -1
  47. package/node_modules/@aws-sdk/core/dist-cjs/protocols/index.js +0 -1
  48. package/node_modules/@aws-sdk/core/dist-cjs/protocols/json/awsExpectUnion.js +0 -1
  49. package/node_modules/@aws-sdk/core/dist-cjs/protocols/json/parseJsonBody.js +0 -1
  50. package/node_modules/@aws-sdk/core/dist-cjs/protocols/xml/parseXmlBody.js +0 -1
  51. package/node_modules/@aws-sdk/core/integ/request-handlers/request-handlers.integ.spec.ts +0 -158
  52. package/node_modules/@aws-sdk/core/jest.config.integ.js +0 -4
  53. package/node_modules/@aws-sdk/core/jest.config.js +0 -6
  54. package/node_modules/@aws-sdk/core/scripts/lint.js +0 -24
  55. package/node_modules/@aws-sdk/core/src/client/emitWarningIfUnsupportedVersion.spec.ts +0 -70
  56. package/node_modules/@aws-sdk/core/src/client/emitWarningIfUnsupportedVersion.ts +0 -26
  57. package/node_modules/@aws-sdk/core/src/client/index.ts +0 -1
  58. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.spec.ts +0 -30
  59. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts +0 -134
  60. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/index.ts +0 -2
  61. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +0 -244
  62. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/index.ts +0 -1
  63. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getDateHeader.ts +0 -7
  64. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getSkewCorrectedDate.spec.ts +0 -17
  65. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getSkewCorrectedDate.ts +0 -8
  66. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.spec.ts +0 -37
  67. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts +0 -18
  68. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/index.ts +0 -3
  69. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/isClockSkewed.spec.ts +0 -32
  70. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/isClockSkewed.ts +0 -12
  71. package/node_modules/@aws-sdk/core/src/index.ts +0 -3
  72. package/node_modules/@aws-sdk/core/src/protocols/coercing-serializers.spec.ts +0 -76
  73. package/node_modules/@aws-sdk/core/src/protocols/coercing-serializers.ts +0 -72
  74. package/node_modules/@aws-sdk/core/src/protocols/common.ts +0 -5
  75. package/node_modules/@aws-sdk/core/src/protocols/index.ts +0 -4
  76. package/node_modules/@aws-sdk/core/src/protocols/json/awsExpectUnion.spec.ts +0 -30
  77. package/node_modules/@aws-sdk/core/src/protocols/json/awsExpectUnion.ts +0 -17
  78. package/node_modules/@aws-sdk/core/src/protocols/json/parseJsonBody.ts +0 -60
  79. package/node_modules/@aws-sdk/core/src/protocols/xml/parseXmlBody.spec.ts +0 -60
  80. package/node_modules/@aws-sdk/core/src/protocols/xml/parseXmlBody.ts +0 -64
  81. package/node_modules/@aws-sdk/core/tsconfig.cjs.json +0 -9
  82. package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +0 -1
  83. package/node_modules/@aws-sdk/core/tsconfig.es.json +0 -9
  84. package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +0 -1
  85. package/node_modules/@aws-sdk/core/tsconfig.types.json +0 -9
  86. package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +0 -1
  87. /package/node_modules/@aws-sdk/core/dist-es/{client → submodules/client}/emitWarningIfUnsupportedVersion.js +0 -0
  88. /package/node_modules/@aws-sdk/core/dist-es/{client → submodules/client}/index.js +0 -0
  89. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/AwsSdkSigV4Signer.js +0 -0
  90. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/index.js +0 -0
  91. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/resolveAwsSdkSigV4Config.js +0 -0
  92. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/index.js +0 -0
  93. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getDateHeader.js +0 -0
  94. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getSkewCorrectedDate.js +0 -0
  95. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getUpdatedSystemClockOffset.js +0 -0
  96. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/index.js +0 -0
  97. /package/node_modules/@aws-sdk/core/dist-es/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/isClockSkewed.js +0 -0
  98. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/coercing-serializers.js +0 -0
  99. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/common.js +0 -0
  100. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/index.js +0 -0
  101. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/json/awsExpectUnion.js +0 -0
  102. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/json/parseJsonBody.js +0 -0
  103. /package/node_modules/@aws-sdk/core/dist-es/{protocols → submodules/protocols}/xml/parseXmlBody.js +0 -0
  104. /package/node_modules/@aws-sdk/core/dist-types/{client → submodules/client}/emitWarningIfUnsupportedVersion.d.ts +0 -0
  105. /package/node_modules/@aws-sdk/core/dist-types/{client → submodules/client}/index.d.ts +0 -0
  106. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/AwsSdkSigV4Signer.d.ts +0 -0
  107. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/index.d.ts +0 -0
  108. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/resolveAwsSdkSigV4Config.d.ts +0 -0
  109. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/index.d.ts +0 -0
  110. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getDateHeader.d.ts +0 -0
  111. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getSkewCorrectedDate.d.ts +0 -0
  112. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getUpdatedSystemClockOffset.d.ts +0 -0
  113. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/index.d.ts +0 -0
  114. /package/node_modules/@aws-sdk/core/dist-types/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/isClockSkewed.d.ts +0 -0
  115. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/coercing-serializers.d.ts +0 -0
  116. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/common.d.ts +0 -0
  117. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/index.d.ts +0 -0
  118. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/json/awsExpectUnion.d.ts +0 -0
  119. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/json/parseJsonBody.d.ts +0 -0
  120. /package/node_modules/@aws-sdk/core/dist-types/{protocols → submodules/protocols}/xml/parseXmlBody.d.ts +0 -0
  121. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{client → submodules/client}/emitWarningIfUnsupportedVersion.d.ts +0 -0
  122. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{client → submodules/client}/index.d.ts +0 -0
  123. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/AwsSdkSigV4Signer.d.ts +0 -0
  124. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/index.d.ts +0 -0
  125. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/aws_sdk/resolveAwsSdkSigV4Config.d.ts +0 -0
  126. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/index.d.ts +0 -0
  127. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getDateHeader.d.ts +0 -0
  128. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getSkewCorrectedDate.d.ts +0 -0
  129. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/getUpdatedSystemClockOffset.d.ts +0 -0
  130. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/index.d.ts +0 -0
  131. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{httpAuthSchemes → submodules/httpAuthSchemes}/utils/isClockSkewed.d.ts +0 -0
  132. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/coercing-serializers.d.ts +0 -0
  133. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/common.d.ts +0 -0
  134. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/index.d.ts +0 -0
  135. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/json/awsExpectUnion.d.ts +0 -0
  136. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/json/parseJsonBody.d.ts +0 -0
  137. /package/node_modules/@aws-sdk/core/dist-types/ts3.4/{protocols → submodules/protocols}/xml/parseXmlBody.d.ts +0 -0
@@ -1,158 +0,0 @@
1
- import { Kinesis } from "@aws-sdk/client-kinesis";
2
- import { S3 } from "@aws-sdk/client-s3";
3
- import { TranscribeStreaming } from "@aws-sdk/client-transcribe-streaming";
4
- import { WebSocketFetchHandler } from "@aws-sdk/middleware-websocket";
5
- import { XhrHttpHandler } from "@aws-sdk/xhr-http-handler";
6
- import { FetchHttpHandler } from "@smithy/fetch-http-handler";
7
- import { NodeHttp2Handler, NodeHttpHandler } from "@smithy/node-http-handler";
8
- import { Agent } from "https";
9
-
10
- describe("request handler initialization", () => {
11
- describe("http", () => {
12
- it("should init with instances", async () => {
13
- let instance: NodeHttpHandler;
14
- let agentInstance: Agent;
15
- const client = new S3({
16
- requestHandler: (instance = new NodeHttpHandler({
17
- requestTimeout: 2_000,
18
- httpsAgent: (agentInstance = new Agent({ maxSockets: 25 })),
19
- })),
20
- });
21
- expect(client.config.requestHandler).toBe(instance);
22
- (instance as any).config = await (instance as any).configProvider;
23
- expect((instance as any).config.httpsAgent).toBe(agentInstance);
24
- expect((instance as any).config.requestTimeout).toEqual(2_000);
25
- expect(agentInstance.maxSockets).toEqual(25);
26
- });
27
- it("should init with Agent pass-through", async () => {
28
- let instance: NodeHttpHandler;
29
- const client = new S3({
30
- requestHandler: (instance = new NodeHttpHandler({
31
- requestTimeout: 2_000,
32
- httpsAgent: { maxSockets: 25 },
33
- })),
34
- });
35
- expect(client.config.requestHandler).toBe(instance);
36
- (instance as any).config = await (instance as any).configProvider;
37
- expect((instance as any).config.requestTimeout).toEqual(2_000);
38
- expect((instance as any).config.httpsAgent.maxSockets).toEqual(25);
39
- });
40
- it("should init with ctor pass-through with Agent instance", async () => {
41
- let agentInstance: Agent;
42
- const client = new S3({
43
- requestHandler: {
44
- requestTimeout: 2_000,
45
- httpsAgent: (agentInstance = new Agent({ maxSockets: 25 })),
46
- },
47
- });
48
- expect(client.config.requestHandler).toBeInstanceOf(NodeHttpHandler);
49
- const instance = client.config.requestHandler;
50
- (instance as any).config = await (instance as any).configProvider;
51
- expect((instance as any).config.httpsAgent).toBe(agentInstance);
52
- expect((instance as any).config.requestTimeout).toEqual(2_000);
53
- expect(agentInstance.maxSockets).toEqual(25);
54
- });
55
- it("should init with ctor and Agent pass-through", async () => {
56
- const client = new S3({
57
- requestHandler: {
58
- requestTimeout: 2_000,
59
- httpsAgent: {
60
- maxSockets: 25,
61
- },
62
- },
63
- });
64
- expect(client.config.requestHandler).toBeInstanceOf(NodeHttpHandler);
65
- const instance = client.config.requestHandler;
66
- (instance as any).config = await (instance as any).configProvider;
67
- expect((instance as any).config.httpsAgent).toBeInstanceOf(Agent);
68
- const agentInstance = (instance as any).config.httpsAgent;
69
- expect((instance as any).config.requestTimeout).toEqual(2_000);
70
- expect(agentInstance.maxSockets).toEqual(25);
71
- });
72
- });
73
-
74
- describe("http2", () => {
75
- it("should init with instances", async () => {
76
- let instance: NodeHttp2Handler;
77
- const client = new Kinesis({
78
- requestHandler: (instance = new NodeHttp2Handler({
79
- requestTimeout: 2_000,
80
- })),
81
- });
82
- expect(client.config.requestHandler).toBe(instance);
83
- (instance as any).config = await (instance as any).configProvider;
84
- expect((instance as any).config.requestTimeout).toEqual(2_000);
85
- });
86
- it("should init with ctor pass-through", async () => {
87
- const client = new Kinesis({
88
- requestHandler: {
89
- requestTimeout: 2_000,
90
- },
91
- });
92
- expect(client.config.requestHandler).toBeInstanceOf(NodeHttp2Handler);
93
- const instance = client.config.requestHandler;
94
- (instance as any).config = await (instance as any).configProvider;
95
- expect((instance as any).config.requestTimeout).toEqual(2_000);
96
- });
97
- });
98
-
99
- describe("fetch", () => {
100
- it("should init with instances", async () => {
101
- let instance: FetchHttpHandler;
102
- const handler = FetchHttpHandler.create((instance = new FetchHttpHandler({ requestTimeout: 2_000 })));
103
- expect(handler).toBe(instance);
104
- expect((instance as any).config.requestTimeout).toEqual(2_000);
105
- });
106
- it("should init with ctor pass-through", async () => {
107
- const handler = FetchHttpHandler.create({ requestTimeout: 2_000 });
108
- expect(handler).toBeInstanceOf(FetchHttpHandler);
109
- expect((handler as any).config.requestTimeout).toEqual(2_000);
110
- });
111
- });
112
-
113
- describe("websocket", () => {
114
- it("should init with instances", async () => {
115
- let instance: WebSocketFetchHandler;
116
- const handler = WebSocketFetchHandler.create(
117
- (instance = new WebSocketFetchHandler({ connectionTimeout: 2_000 }))
118
- );
119
- const client = new TranscribeStreaming({
120
- requestHandler: handler,
121
- });
122
- expect(client.config.requestHandler).toBe(instance);
123
- expect(handler).toBe(instance);
124
- expect((await (handler as any).configPromise).connectionTimeout).toEqual(2_000);
125
- });
126
- it("should init with ctor pass-through", async () => {
127
- const handler = WebSocketFetchHandler.create({ connectionTimeout: 2_000 });
128
- const client = new TranscribeStreaming({
129
- requestHandler: handler,
130
- });
131
- expect(client.config.requestHandler).toBe(handler);
132
- expect(handler).toBeInstanceOf(WebSocketFetchHandler);
133
- expect((await (handler as any).configPromise).connectionTimeout).toEqual(2_000);
134
- });
135
- });
136
-
137
- describe("xhr", () => {
138
- it("should init with instances", async () => {
139
- let instance: XhrHttpHandler;
140
- const handler = XhrHttpHandler.create((instance = new XhrHttpHandler({ requestTimeout: 2_000 })));
141
- const client = new S3({
142
- requestHandler: instance,
143
- });
144
- expect(client.config.requestHandler).toBe(handler);
145
- expect(handler).toBe(instance);
146
- expect((handler as any).config.requestTimeout).toEqual(2_000);
147
- });
148
- it("should init with ctor pass-through", async () => {
149
- const handler = XhrHttpHandler.create({ requestTimeout: 2_000 });
150
- const client = new S3({
151
- requestHandler: handler,
152
- });
153
- expect(client.config.requestHandler).toBe(handler);
154
- expect(handler).toBeInstanceOf(XhrHttpHandler);
155
- expect((handler as any).config.requestTimeout).toEqual(2_000);
156
- });
157
- });
158
- });
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- preset: "ts-jest",
3
- testMatch: ["**/*.integ.spec.ts"],
4
- };
@@ -1,6 +0,0 @@
1
- const base = require("../../jest.config.base.js");
2
-
3
- module.exports = {
4
- ...base,
5
- testPathIgnorePatterns: ["/node_modules/"],
6
- };
@@ -1,24 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
-
5
- const root = path.join(__dirname, "..");
6
-
7
- const pkgJson = require(path.join(root, "package.json"));
8
- const srcFolders = fs.readdirSync(path.join(root, "src"));
9
-
10
- assert(pkgJson.exports === undefined, "We cannot support package.json exports yet.");
11
-
12
- /**
13
- * We probably can't enable package.json exports until
14
- * dropping support for Node.js 14.x and TypeScript 4.6.
15
- */
16
- process.exit(0);
17
-
18
- for (const srcFolder of srcFolders) {
19
- if (fs.lstatSync(path.join(root, "src", srcFolder)).isDirectory()) {
20
- if (!pkgJson.exports["./" + srcFolder]) {
21
- throw new Error(`${srcFolder} is missing exports statement in package.json`);
22
- }
23
- }
24
- }
@@ -1,70 +0,0 @@
1
- describe("emitWarningIfUnsupportedVersion", () => {
2
- let emitWarningIfUnsupportedVersion: any;
3
- const emitWarning = process.emitWarning;
4
- const supportedVersion = "16.0.0";
5
-
6
- beforeEach(() => {
7
- const module = require("./emitWarningIfUnsupportedVersion");
8
- emitWarningIfUnsupportedVersion = module.emitWarningIfUnsupportedVersion;
9
- });
10
-
11
- afterEach(() => {
12
- jest.clearAllMocks();
13
- jest.resetModules();
14
- process.emitWarning = emitWarning;
15
- });
16
-
17
- describe.skip(`emits warning for Node.js <${supportedVersion}`, () => {
18
- const getPreviousMajorVersion = (major: number) => (major === 0 ? 0 : major - 1);
19
-
20
- const getPreviousMinorVersion = ([major, minor]: [number, number]) =>
21
- minor === 0 ? [getPreviousMajorVersion(major), 9] : [major, minor - 1];
22
-
23
- const getPreviousPatchVersion = ([major, minor, patch]: [number, number, number]) =>
24
- patch === 0 ? [...getPreviousMinorVersion([major, minor]), 9] : [major, minor, patch - 1];
25
-
26
- const [major, minor, patch] = supportedVersion.split(".").map(Number);
27
- it.each(
28
- [
29
- getPreviousPatchVersion([major, minor, patch]),
30
- [...getPreviousMinorVersion([major, minor]), 0],
31
- [getPreviousMajorVersion(major), 0, 0],
32
- ].map((arr) => `v${arr.join(".")}`)
33
- )(`%s`, async (unsupportedVersion) => {
34
- process.emitWarning = jest.fn();
35
- emitWarningIfUnsupportedVersion(unsupportedVersion);
36
-
37
- // Verify that the warning was emitted.
38
- expect(process.emitWarning).toHaveBeenCalledTimes(1);
39
- expect(process.emitWarning).toHaveBeenCalledWith(
40
- `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
41
- no longer support Node.js 14.x on May 1, 2024.
42
-
43
- To continue receiving updates to AWS services, bug fixes, and security
44
- updates please upgrade to an active Node.js LTS version.
45
-
46
- More information can be found at: https://a.co/dzr2AJd`
47
- );
48
-
49
- // Verify that the warning emits only once.
50
- emitWarningIfUnsupportedVersion(unsupportedVersion);
51
- expect(process.emitWarning).toHaveBeenCalledTimes(1);
52
- });
53
- });
54
-
55
- describe(`emits no warning for Node.js >=${supportedVersion}`, () => {
56
- const [major, minor, patch] = supportedVersion.split(".").map(Number);
57
- it.each(
58
- [
59
- [major, minor, patch],
60
- [major, minor, patch + 1],
61
- [major, minor + 1, 0],
62
- [major + 1, 0, 0],
63
- ].map((arr) => `v${arr.join(".")}`)
64
- )(`%s`, async (unsupportedVersion) => {
65
- process.emitWarning = jest.fn();
66
- emitWarningIfUnsupportedVersion(unsupportedVersion);
67
- expect(process.emitWarning).not.toHaveBeenCalled();
68
- });
69
- });
70
- });
@@ -1,26 +0,0 @@
1
- // Stores whether the warning was already emitted.
2
- let warningEmitted = false;
3
-
4
- /**
5
- * @internal
6
- *
7
- * Emits warning if the provided Node.js version string is
8
- * pending deprecation by AWS SDK JSv3.
9
- *
10
- * @param version - The Node.js version string.
11
- */
12
- export const emitWarningIfUnsupportedVersion = (version: string) => {
13
- if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
14
- warningEmitted = true;
15
- // ToDo: Turn back warning for future Node.js version deprecation
16
- // process.emitWarning(
17
- // `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
18
- // no longer support Node.js 14.x on May 1, 2024.
19
-
20
- // To continue receiving updates to AWS services, bug fixes, and security
21
- // updates please upgrade to an active Node.js LTS version.
22
-
23
- // More information can be found at: https://a.co/dzr2AJd`
24
- // );
25
- }
26
- };
@@ -1 +0,0 @@
1
- export * from "./emitWarningIfUnsupportedVersion";
@@ -1,30 +0,0 @@
1
- import { AwsSdkSigV4Signer } from "./AwsSdkSigV4Signer";
2
-
3
- describe(AwsSdkSigV4Signer.name, () => {
4
- it("sets clockSkewCorrected metadata in error handler if systemClockOffset was updated", async () => {
5
- const signer = new AwsSdkSigV4Signer();
6
-
7
- let error: Error | any;
8
- try {
9
- signer.errorHandler({
10
- config: {
11
- systemClockOffset: 30 * 60 * 1000,
12
- },
13
- })(
14
- Object.assign(new Error("uh oh"), {
15
- $metadata: {},
16
- $response: {
17
- headers: {
18
- date: new Date().toISOString(),
19
- },
20
- statusCode: 500,
21
- },
22
- })
23
- );
24
- } catch (e) {
25
- error = e as Error;
26
- }
27
-
28
- expect((error as any).$metadata.clockSkewCorrected).toBe(true);
29
- });
30
- });
@@ -1,134 +0,0 @@
1
- import { HttpRequest } from "@smithy/protocol-http";
2
- import { ServiceException } from "@smithy/smithy-client";
3
- import {
4
- AuthScheme,
5
- AwsCredentialIdentity,
6
- HandlerExecutionContext,
7
- HttpRequest as IHttpRequest,
8
- HttpResponse,
9
- HttpSigner,
10
- RequestSigner,
11
- } from "@smithy/types";
12
-
13
- import { getDateHeader, getSkewCorrectedDate, getUpdatedSystemClockOffset } from "../utils";
14
-
15
- /**
16
- * @internal
17
- */
18
- const throwSigningPropertyError = <T>(name: string, property: T | undefined): T | never => {
19
- if (!property) {
20
- throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
21
- }
22
- return property;
23
- };
24
-
25
- /**
26
- * @internal
27
- */
28
- interface AwsSdkSigV4Config {
29
- systemClockOffset: number;
30
- signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
31
- }
32
-
33
- /**
34
- * @internal
35
- */
36
- interface AwsSdkSigV4AuthSigningProperties {
37
- config: AwsSdkSigV4Config;
38
- signer: RequestSigner;
39
- signingRegion?: string;
40
- signingName?: string;
41
- }
42
-
43
- /**
44
- * @internal
45
- */
46
- interface AwsSdkSigV4Exception extends ServiceException {
47
- ServerTime?: string;
48
- $metadata: ServiceException["$metadata"] & {
49
- clockSkewCorrected?: boolean;
50
- };
51
- }
52
-
53
- /**
54
- * @internal
55
- */
56
- const validateSigningProperties = async (
57
- signingProperties: Record<string, unknown>
58
- ): Promise<AwsSdkSigV4AuthSigningProperties> => {
59
- const context = throwSigningPropertyError(
60
- "context",
61
- signingProperties.context as HandlerExecutionContext | undefined
62
- );
63
- const config = throwSigningPropertyError("config", signingProperties.config as AwsSdkSigV4Config | undefined);
64
- const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
65
- const signerFunction = throwSigningPropertyError(
66
- "signer",
67
- config.signer as ((authScheme?: AuthScheme) => Promise<RequestSigner>) | undefined
68
- );
69
- const signer = await signerFunction(authScheme);
70
- const signingRegion: string | undefined = signingProperties?.signingRegion as string | undefined;
71
- const signingName = signingProperties?.signingName as string | undefined;
72
- return {
73
- config,
74
- signer,
75
- signingRegion,
76
- signingName,
77
- };
78
- };
79
-
80
- /**
81
- * @internal
82
- */
83
- export class AwsSdkSigV4Signer implements HttpSigner {
84
- async sign(
85
- httpRequest: IHttpRequest,
86
- /**
87
- * `identity` is bound in {@link resolveAWSSDKSigV4Config}
88
- */
89
- identity: AwsCredentialIdentity,
90
- signingProperties: Record<string, unknown>
91
- ): Promise<IHttpRequest> {
92
- if (!HttpRequest.isInstance(httpRequest)) {
93
- throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
94
- }
95
- const { config, signer, signingRegion, signingName } = await validateSigningProperties(signingProperties);
96
-
97
- const signedRequest = await signer.sign(httpRequest, {
98
- signingDate: getSkewCorrectedDate(config.systemClockOffset),
99
- signingRegion: signingRegion,
100
- signingService: signingName,
101
- });
102
- return signedRequest;
103
- }
104
-
105
- errorHandler(signingProperties: Record<string, unknown>): (error: Error) => never {
106
- return (error: Error) => {
107
- const serverTime: string | undefined =
108
- (error as AwsSdkSigV4Exception).ServerTime ?? getDateHeader((error as AwsSdkSigV4Exception).$response);
109
- if (serverTime) {
110
- const config = throwSigningPropertyError("config", signingProperties.config as AwsSdkSigV4Config | undefined);
111
- const initialSystemClockOffset = config.systemClockOffset;
112
- config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
113
- const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
114
- if (clockSkewCorrected && (error as AwsSdkSigV4Exception).$metadata) {
115
- (error as AwsSdkSigV4Exception).$metadata.clockSkewCorrected = true;
116
- }
117
- }
118
- throw error;
119
- };
120
- }
121
-
122
- successHandler(httpResponse: HttpResponse | unknown, signingProperties: Record<string, unknown>): void {
123
- const dateHeader = getDateHeader(httpResponse);
124
- if (dateHeader) {
125
- const config = throwSigningPropertyError("config", signingProperties.config as AwsSdkSigV4Config | undefined);
126
- config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
127
- }
128
- }
129
- }
130
-
131
- /**
132
- * @deprecated renamed to {@link AwsSdkSigV4Signer}
133
- */
134
- export const AWSSDKSigV4Signer = AwsSdkSigV4Signer;
@@ -1,2 +0,0 @@
1
- export * from "./AwsSdkSigV4Signer";
2
- export * from "./resolveAwsSdkSigV4Config";