@aws-sdk/core 3.714.0 → 3.723.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.
|
@@ -37,10 +37,7 @@ var import_protocol_http2 = require("@smithy/protocol-http");
|
|
|
37
37
|
|
|
38
38
|
// src/submodules/httpAuthSchemes/utils/getDateHeader.ts
|
|
39
39
|
var import_protocol_http = require("@smithy/protocol-http");
|
|
40
|
-
var getDateHeader = /* @__PURE__ */ __name((response) =>
|
|
41
|
-
var _a, _b;
|
|
42
|
-
return import_protocol_http.HttpResponse.isInstance(response) ? ((_a = response.headers) == null ? void 0 : _a.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date) : void 0;
|
|
43
|
-
}, "getDateHeader");
|
|
40
|
+
var getDateHeader = /* @__PURE__ */ __name((response) => import_protocol_http.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader");
|
|
44
41
|
|
|
45
42
|
// src/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.ts
|
|
46
43
|
var getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate");
|
|
@@ -65,21 +62,20 @@ var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => {
|
|
|
65
62
|
return property;
|
|
66
63
|
}, "throwSigningPropertyError");
|
|
67
64
|
var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
|
|
68
|
-
var _a, _b, _c;
|
|
69
65
|
const context = throwSigningPropertyError(
|
|
70
66
|
"context",
|
|
71
67
|
signingProperties.context
|
|
72
68
|
);
|
|
73
69
|
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
74
|
-
const authScheme =
|
|
70
|
+
const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
|
|
75
71
|
const signerFunction = throwSigningPropertyError(
|
|
76
72
|
"signer",
|
|
77
73
|
config.signer
|
|
78
74
|
);
|
|
79
75
|
const signer = await signerFunction(authScheme);
|
|
80
|
-
const signingRegion = signingProperties
|
|
81
|
-
const signingRegionSet = signingProperties
|
|
82
|
-
const signingName = signingProperties
|
|
76
|
+
const signingRegion = signingProperties?.signingRegion;
|
|
77
|
+
const signingRegionSet = signingProperties?.signingRegionSet;
|
|
78
|
+
const signingName = signingProperties?.signingName;
|
|
83
79
|
return {
|
|
84
80
|
config,
|
|
85
81
|
signer,
|
|
@@ -88,9 +84,11 @@ var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties)
|
|
|
88
84
|
signingName
|
|
89
85
|
};
|
|
90
86
|
}, "validateSigningProperties");
|
|
91
|
-
var
|
|
87
|
+
var AwsSdkSigV4Signer = class {
|
|
88
|
+
static {
|
|
89
|
+
__name(this, "AwsSdkSigV4Signer");
|
|
90
|
+
}
|
|
92
91
|
async sign(httpRequest, identity, signingProperties) {
|
|
93
|
-
var _a;
|
|
94
92
|
if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
|
|
95
93
|
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
96
94
|
}
|
|
@@ -98,11 +96,11 @@ var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
|
|
|
98
96
|
const { config, signer } = validatedProps;
|
|
99
97
|
let { signingRegion, signingName } = validatedProps;
|
|
100
98
|
const handlerExecutionContext = signingProperties.context;
|
|
101
|
-
if (
|
|
99
|
+
if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
|
|
102
100
|
const [first, second] = handlerExecutionContext.authSchemes;
|
|
103
|
-
if (
|
|
104
|
-
signingRegion =
|
|
105
|
-
signingName =
|
|
101
|
+
if (first?.name === "sigv4a" && second?.name === "sigv4") {
|
|
102
|
+
signingRegion = second?.signingRegion ?? signingRegion;
|
|
103
|
+
signingName = second?.signingName ?? signingName;
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
const signedRequest = await signer.sign(httpRequest, {
|
|
@@ -135,22 +133,22 @@ var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
|
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
};
|
|
138
|
-
__name(_AwsSdkSigV4Signer, "AwsSdkSigV4Signer");
|
|
139
|
-
var AwsSdkSigV4Signer = _AwsSdkSigV4Signer;
|
|
140
136
|
var AWSSDKSigV4Signer = AwsSdkSigV4Signer;
|
|
141
137
|
|
|
142
138
|
// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.ts
|
|
143
139
|
var import_protocol_http3 = require("@smithy/protocol-http");
|
|
144
|
-
var
|
|
140
|
+
var AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer {
|
|
141
|
+
static {
|
|
142
|
+
__name(this, "AwsSdkSigV4ASigner");
|
|
143
|
+
}
|
|
145
144
|
async sign(httpRequest, identity, signingProperties) {
|
|
146
|
-
var _a;
|
|
147
145
|
if (!import_protocol_http3.HttpRequest.isInstance(httpRequest)) {
|
|
148
146
|
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
149
147
|
}
|
|
150
148
|
const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(
|
|
151
149
|
signingProperties
|
|
152
150
|
);
|
|
153
|
-
const configResolvedSigningRegionSet = await
|
|
151
|
+
const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
|
|
154
152
|
const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
|
|
155
153
|
const signedRequest = await signer.sign(httpRequest, {
|
|
156
154
|
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
@@ -160,8 +158,6 @@ var _AwsSdkSigV4ASigner = class _AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
|
|
|
160
158
|
return signedRequest;
|
|
161
159
|
}
|
|
162
160
|
};
|
|
163
|
-
__name(_AwsSdkSigV4ASigner, "AwsSdkSigV4ASigner");
|
|
164
|
-
var AwsSdkSigV4ASigner = _AwsSdkSigV4ASigner;
|
|
165
161
|
|
|
166
162
|
// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.ts
|
|
167
163
|
var import_core = require("@smithy/core");
|
|
@@ -111,7 +111,7 @@ var parseJsonBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyS
|
|
|
111
111
|
try {
|
|
112
112
|
return JSON.parse(encoded);
|
|
113
113
|
} catch (e) {
|
|
114
|
-
if (
|
|
114
|
+
if (e?.name === "SyntaxError") {
|
|
115
115
|
Object.defineProperty(e, "$responseBodyText", {
|
|
116
116
|
value: encoded
|
|
117
117
|
});
|
|
@@ -202,11 +202,10 @@ var parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
|
202
202
|
return value;
|
|
203
203
|
}, "parseXmlErrorBody");
|
|
204
204
|
var loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
205
|
-
|
|
206
|
-
if (((_a = data == null ? void 0 : data.Error) == null ? void 0 : _a.Code) !== void 0) {
|
|
205
|
+
if (data?.Error?.Code !== void 0) {
|
|
207
206
|
return data.Error.Code;
|
|
208
207
|
}
|
|
209
|
-
if (
|
|
208
|
+
if (data?.Code !== void 0) {
|
|
210
209
|
return data.Code;
|
|
211
210
|
}
|
|
212
211
|
if (output.statusCode == 404) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.723.0",
|
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
},
|
|
82
82
|
"license": "Apache-2.0",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@aws-sdk/types": "3.
|
|
85
|
-
"@smithy/core": "^
|
|
86
|
-
"@smithy/node-config-provider": "^
|
|
87
|
-
"@smithy/property-provider": "^
|
|
88
|
-
"@smithy/protocol-http": "^
|
|
89
|
-
"@smithy/signature-v4": "^
|
|
90
|
-
"@smithy/smithy-client": "^
|
|
91
|
-
"@smithy/types": "^
|
|
92
|
-
"@smithy/util-middleware": "^
|
|
84
|
+
"@aws-sdk/types": "3.723.0",
|
|
85
|
+
"@smithy/core": "^3.0.0",
|
|
86
|
+
"@smithy/node-config-provider": "^4.0.0",
|
|
87
|
+
"@smithy/property-provider": "^4.0.0",
|
|
88
|
+
"@smithy/protocol-http": "^5.0.0",
|
|
89
|
+
"@smithy/signature-v4": "^5.0.0",
|
|
90
|
+
"@smithy/smithy-client": "^4.0.0",
|
|
91
|
+
"@smithy/types": "^4.0.0",
|
|
92
|
+
"@smithy/util-middleware": "^4.0.0",
|
|
93
93
|
"fast-xml-parser": "4.4.1",
|
|
94
94
|
"tslib": "^2.6.2"
|
|
95
95
|
},
|
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"concurrently": "7.0.0",
|
|
99
99
|
"downlevel-dts": "0.10.1",
|
|
100
100
|
"rimraf": "3.0.2",
|
|
101
|
-
"typescript": "~
|
|
101
|
+
"typescript": "~5.2.2"
|
|
102
102
|
},
|
|
103
103
|
"engines": {
|
|
104
|
-
"node": ">=
|
|
104
|
+
"node": ">=18.0.0"
|
|
105
105
|
},
|
|
106
106
|
"typesVersions": {
|
|
107
107
|
"<4.0": {
|