@cdk8s/awscdk-resolver 0.0.63 → 0.0.65
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/.jsii +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormationClient.d.ts +4 -4
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.browser.d.ts +1 -4
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.d.ts +1 -4
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.native.d.ts +1 -4
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/CloudFormationClient.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
- package/node_modules/@aws-sdk/client-cloudformation/package.json +35 -35
- package/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts +4 -4
- package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts +3 -3
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
- package/node_modules/@aws-sdk/client-sso/package.json +32 -32
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts +4 -4
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts +3 -3
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
- package/node_modules/@aws-sdk/client-sso-oidc/package.json +34 -34
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts +4 -4
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts +1 -4
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts +3 -3
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -13
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts +2 -14
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -13
- package/node_modules/@aws-sdk/client-sts/package.json +33 -33
- package/node_modules/@aws-sdk/core/CHANGELOG.md +22 -0
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +7 -8
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +5 -0
- package/node_modules/@aws-sdk/core/integ/request-handlers/request-handlers.integ.spec.ts +158 -0
- package/node_modules/@aws-sdk/core/jest.config.integ.js +4 -0
- package/node_modules/@aws-sdk/core/package.json +8 -7
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.spec.ts +30 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.ts +10 -8
- package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +1 -1
- package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-http/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +5 -5
- package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
- package/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-endpoints/package.json +4 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +4 -4
- package/node_modules/@smithy/abort-controller/dist-cjs/index.js +1 -4
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/dist-cjs/index.js +10 -10
- package/node_modules/@smithy/config-resolver/package.json +4 -4
- package/node_modules/@smithy/core/package.json +8 -8
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +5 -5
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/eventstream-codec/package.json +2 -2
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +1 -1
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +4 -4
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +4 -4
- package/node_modules/@smithy/middleware-endpoint/package.json +7 -7
- package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +11 -10
- package/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js +1 -0
- package/node_modules/@smithy/middleware-retry/dist-types/configurations.d.ts +7 -2
- package/node_modules/@smithy/middleware-retry/dist-types/retryDecider.d.ts +3 -0
- package/node_modules/@smithy/middleware-retry/dist-types/ts3.4/configurations.d.ts +7 -2
- package/node_modules/@smithy/middleware-retry/dist-types/ts3.4/retryDecider.d.ts +3 -0
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +2 -2
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +54 -4
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +41 -3
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +11 -0
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/dist-cjs/index.js +3 -3
- package/node_modules/@smithy/protocol-http/dist-types/httpHandler.d.ts +22 -3
- package/node_modules/@smithy/protocol-http/dist-types/ts3.4/httpHandler.d.ts +20 -1
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +10 -4
- package/node_modules/@smithy/service-error-classification/dist-es/index.js +3 -1
- package/node_modules/@smithy/service-error-classification/dist-types/index.d.ts +7 -0
- package/node_modules/@smithy/service-error-classification/dist-types/ts3.4/index.d.ts +7 -0
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +7 -7
- package/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js +1 -1
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +5 -5
- package/node_modules/@smithy/signature-v4/package.json +5 -5
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +38 -38
- package/node_modules/@smithy/smithy-client/dist-types/client.d.ts +6 -3
- package/node_modules/@smithy/smithy-client/dist-types/ts3.4/client.d.ts +6 -3
- package/node_modules/@smithy/smithy-client/package.json +6 -6
- package/node_modules/@smithy/types/dist-cjs/index.js +7 -7
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +18 -4
- package/node_modules/@smithy/types/dist-types/retry.d.ts +6 -1
- package/node_modules/@smithy/types/dist-types/shapes.d.ts +10 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +18 -4
- package/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +6 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +10 -1
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +3 -3
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +10 -10
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/package.json +5 -5
- package/node_modules/@smithy/util-waiter/dist-cjs/index.js +3 -3
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/package.json +5 -5
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-sdk/client-sts",
|
3
3
|
"description": "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
|
4
|
-
"version": "3.
|
4
|
+
"version": "3.523.0",
|
5
5
|
"scripts": {
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-sts",
|
@@ -22,40 +22,40 @@
|
|
22
22
|
"dependencies": {
|
23
23
|
"@aws-crypto/sha256-browser": "3.0.0",
|
24
24
|
"@aws-crypto/sha256-js": "3.0.0",
|
25
|
-
"@aws-sdk/core": "3.
|
26
|
-
"@aws-sdk/middleware-host-header": "3.
|
27
|
-
"@aws-sdk/middleware-logger": "3.
|
28
|
-
"@aws-sdk/middleware-recursion-detection": "3.
|
29
|
-
"@aws-sdk/middleware-user-agent": "3.
|
30
|
-
"@aws-sdk/region-config-resolver": "3.
|
31
|
-
"@aws-sdk/types": "3.
|
32
|
-
"@aws-sdk/util-endpoints": "3.
|
33
|
-
"@aws-sdk/util-user-agent-browser": "3.
|
34
|
-
"@aws-sdk/util-user-agent-node": "3.
|
35
|
-
"@smithy/config-resolver": "^2.1.
|
36
|
-
"@smithy/core": "^1.3.
|
37
|
-
"@smithy/fetch-http-handler": "^2.4.
|
38
|
-
"@smithy/hash-node": "^2.1.
|
39
|
-
"@smithy/invalid-dependency": "^2.1.
|
40
|
-
"@smithy/middleware-content-length": "^2.1.
|
41
|
-
"@smithy/middleware-endpoint": "^2.4.
|
42
|
-
"@smithy/middleware-retry": "^2.1.
|
43
|
-
"@smithy/middleware-serde": "^2.1.
|
44
|
-
"@smithy/middleware-stack": "^2.1.
|
45
|
-
"@smithy/node-config-provider": "^2.2.
|
46
|
-
"@smithy/node-http-handler": "^2.
|
47
|
-
"@smithy/protocol-http": "^3.
|
48
|
-
"@smithy/smithy-client": "^2.
|
49
|
-
"@smithy/types": "^2.
|
50
|
-
"@smithy/url-parser": "^2.1.
|
25
|
+
"@aws-sdk/core": "3.523.0",
|
26
|
+
"@aws-sdk/middleware-host-header": "3.523.0",
|
27
|
+
"@aws-sdk/middleware-logger": "3.523.0",
|
28
|
+
"@aws-sdk/middleware-recursion-detection": "3.523.0",
|
29
|
+
"@aws-sdk/middleware-user-agent": "3.523.0",
|
30
|
+
"@aws-sdk/region-config-resolver": "3.523.0",
|
31
|
+
"@aws-sdk/types": "3.523.0",
|
32
|
+
"@aws-sdk/util-endpoints": "3.523.0",
|
33
|
+
"@aws-sdk/util-user-agent-browser": "3.523.0",
|
34
|
+
"@aws-sdk/util-user-agent-node": "3.523.0",
|
35
|
+
"@smithy/config-resolver": "^2.1.3",
|
36
|
+
"@smithy/core": "^1.3.4",
|
37
|
+
"@smithy/fetch-http-handler": "^2.4.3",
|
38
|
+
"@smithy/hash-node": "^2.1.3",
|
39
|
+
"@smithy/invalid-dependency": "^2.1.3",
|
40
|
+
"@smithy/middleware-content-length": "^2.1.3",
|
41
|
+
"@smithy/middleware-endpoint": "^2.4.3",
|
42
|
+
"@smithy/middleware-retry": "^2.1.3",
|
43
|
+
"@smithy/middleware-serde": "^2.1.3",
|
44
|
+
"@smithy/middleware-stack": "^2.1.3",
|
45
|
+
"@smithy/node-config-provider": "^2.2.3",
|
46
|
+
"@smithy/node-http-handler": "^2.4.1",
|
47
|
+
"@smithy/protocol-http": "^3.2.1",
|
48
|
+
"@smithy/smithy-client": "^2.4.1",
|
49
|
+
"@smithy/types": "^2.10.1",
|
50
|
+
"@smithy/url-parser": "^2.1.3",
|
51
51
|
"@smithy/util-base64": "^2.1.1",
|
52
52
|
"@smithy/util-body-length-browser": "^2.1.1",
|
53
53
|
"@smithy/util-body-length-node": "^2.2.1",
|
54
|
-
"@smithy/util-defaults-mode-browser": "^2.1.
|
55
|
-
"@smithy/util-defaults-mode-node": "^2.2.
|
56
|
-
"@smithy/util-endpoints": "^1.1.
|
57
|
-
"@smithy/util-middleware": "^2.1.
|
58
|
-
"@smithy/util-retry": "^2.1.
|
54
|
+
"@smithy/util-defaults-mode-browser": "^2.1.3",
|
55
|
+
"@smithy/util-defaults-mode-node": "^2.2.2",
|
56
|
+
"@smithy/util-endpoints": "^1.1.3",
|
57
|
+
"@smithy/util-middleware": "^2.1.3",
|
58
|
+
"@smithy/util-retry": "^2.1.3",
|
59
59
|
"@smithy/util-utf8": "^2.1.1",
|
60
60
|
"fast-xml-parser": "4.2.5",
|
61
61
|
"tslib": "^2.5.0"
|
@@ -88,7 +88,7 @@
|
|
88
88
|
},
|
89
89
|
"license": "Apache-2.0",
|
90
90
|
"peerDependencies": {
|
91
|
-
"@aws-sdk/credential-provider-node": "^3.
|
91
|
+
"@aws-sdk/credential-provider-node": "^3.523.0"
|
92
92
|
},
|
93
93
|
"browser": {
|
94
94
|
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
|
@@ -3,6 +3,28 @@
|
|
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.523.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.522.0...v3.523.0) (2024-02-27)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **core:** add error metadata indicating clock skew correction ([#5830](https://github.com/aws/aws-sdk-js-v3/issues/5830)) ([46e5e8d](https://github.com/aws/aws-sdk-js-v3/commit/46e5e8daa0b13208f149bbd0b54857498558e152))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [3.521.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.520.0...v3.521.0) (2024-02-23)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* requestHandler ctor param pass-through ([#5820](https://github.com/aws/aws-sdk-js-v3/issues/5820)) ([9fec71d](https://github.com/aws/aws-sdk-js-v3/commit/9fec71d1933cd8e3db118c164bca16edc2305532))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
6
28
|
# [3.513.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.512.0...v3.513.0) (2024-02-13)
|
7
29
|
|
8
30
|
|
@@ -120,11 +120,13 @@ var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
|
|
120
120
|
return (error) => {
|
121
121
|
const serverTime = error.ServerTime ?? getDateHeader(error.$response);
|
122
122
|
if (serverTime) {
|
123
|
-
const config = throwSigningPropertyError(
|
124
|
-
|
125
|
-
signingProperties.config
|
126
|
-
);
|
123
|
+
const config = throwSigningPropertyError("config", signingProperties.config);
|
124
|
+
const initialSystemClockOffset = config.systemClockOffset;
|
127
125
|
config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
|
126
|
+
const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
|
127
|
+
if (clockSkewCorrected && error.$metadata) {
|
128
|
+
error.$metadata.clockSkewCorrected = true;
|
129
|
+
}
|
128
130
|
}
|
129
131
|
throw error;
|
130
132
|
};
|
@@ -132,10 +134,7 @@ var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
|
|
132
134
|
successHandler(httpResponse, signingProperties) {
|
133
135
|
const dateHeader = getDateHeader(httpResponse);
|
134
136
|
if (dateHeader) {
|
135
|
-
const config = throwSigningPropertyError(
|
136
|
-
"config",
|
137
|
-
signingProperties.config
|
138
|
-
);
|
137
|
+
const config = throwSigningPropertyError("config", signingProperties.config);
|
139
138
|
config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
|
140
139
|
}
|
141
140
|
}
|
@@ -39,7 +39,12 @@ export class AwsSdkSigV4Signer {
|
|
39
39
|
const serverTime = error.ServerTime ?? getDateHeader(error.$response);
|
40
40
|
if (serverTime) {
|
41
41
|
const config = throwSigningPropertyError("config", signingProperties.config);
|
42
|
+
const initialSystemClockOffset = config.systemClockOffset;
|
42
43
|
config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
|
44
|
+
const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
|
45
|
+
if (clockSkewCorrected && error.$metadata) {
|
46
|
+
error.$metadata.clockSkewCorrected = true;
|
47
|
+
}
|
43
48
|
}
|
44
49
|
throw error;
|
45
50
|
};
|
@@ -0,0 +1,158 @@
|
|
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,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-sdk/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.523.0",
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients",
|
5
5
|
"scripts": {
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
@@ -12,7 +12,8 @@
|
|
12
12
|
"lint": "node ./scripts/lint.js",
|
13
13
|
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
|
14
14
|
"extract:docs": "api-extractor run --local",
|
15
|
-
"test": "jest"
|
15
|
+
"test": "jest",
|
16
|
+
"test:integration": "jest -c jest.config.integ.js"
|
16
17
|
},
|
17
18
|
"main": "./dist-cjs/index.js",
|
18
19
|
"module": "./dist-es/index.js",
|
@@ -24,11 +25,11 @@
|
|
24
25
|
},
|
25
26
|
"license": "Apache-2.0",
|
26
27
|
"dependencies": {
|
27
|
-
"@smithy/core": "^1.3.
|
28
|
-
"@smithy/protocol-http": "^3.
|
29
|
-
"@smithy/signature-v4": "^2.1.
|
30
|
-
"@smithy/smithy-client": "^2.
|
31
|
-
"@smithy/types": "^2.
|
28
|
+
"@smithy/core": "^1.3.4",
|
29
|
+
"@smithy/protocol-http": "^3.2.1",
|
30
|
+
"@smithy/signature-v4": "^2.1.3",
|
31
|
+
"@smithy/smithy-client": "^2.4.1",
|
32
|
+
"@smithy/types": "^2.10.1",
|
32
33
|
"tslib": "^2.5.0"
|
33
34
|
},
|
34
35
|
"devDependencies": {
|
@@ -0,0 +1,30 @@
|
|
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
|
+
});
|
@@ -45,6 +45,9 @@ interface AwsSdkSigV4AuthSigningProperties {
|
|
45
45
|
*/
|
46
46
|
interface AwsSdkSigV4Exception extends ServiceException {
|
47
47
|
ServerTime?: string;
|
48
|
+
$metadata: ServiceException["$metadata"] & {
|
49
|
+
clockSkewCorrected?: boolean;
|
50
|
+
};
|
48
51
|
}
|
49
52
|
|
50
53
|
/**
|
@@ -104,11 +107,13 @@ export class AwsSdkSigV4Signer implements HttpSigner {
|
|
104
107
|
const serverTime: string | undefined =
|
105
108
|
(error as AwsSdkSigV4Exception).ServerTime ?? getDateHeader((error as AwsSdkSigV4Exception).$response);
|
106
109
|
if (serverTime) {
|
107
|
-
const config = throwSigningPropertyError(
|
108
|
-
|
109
|
-
signingProperties.config as AwsSdkSigV4Config | undefined
|
110
|
-
);
|
110
|
+
const config = throwSigningPropertyError("config", signingProperties.config as AwsSdkSigV4Config | undefined);
|
111
|
+
const initialSystemClockOffset = config.systemClockOffset;
|
111
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
|
+
}
|
112
117
|
}
|
113
118
|
throw error;
|
114
119
|
};
|
@@ -117,10 +122,7 @@ export class AwsSdkSigV4Signer implements HttpSigner {
|
|
117
122
|
successHandler(httpResponse: HttpResponse | unknown, signingProperties: Record<string, unknown>): void {
|
118
123
|
const dateHeader = getDateHeader(httpResponse);
|
119
124
|
if (dateHeader) {
|
120
|
-
const config = throwSigningPropertyError(
|
121
|
-
"config",
|
122
|
-
signingProperties.config as AwsSdkSigV4Config | undefined
|
123
|
-
);
|
125
|
+
const config = throwSigningPropertyError("config", signingProperties.config as AwsSdkSigV4Config | undefined);
|
124
126
|
config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
|
125
127
|
}
|
126
128
|
}
|