@aws-sdk/core 3.623.0 → 3.624.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/dist-cjs/submodules/httpAuthSchemes/index.js +16 -3
- package/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +11 -1
- package/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +1 -1
- package/dist-types/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
- package/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +5 -1
- package/package.json +1 -1
|
@@ -25,7 +25,8 @@ __export(httpAuthSchemes_exports, {
|
|
|
25
25
|
AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner,
|
|
26
26
|
AwsSdkSigV4Signer: () => AwsSdkSigV4Signer,
|
|
27
27
|
resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config,
|
|
28
|
-
resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config
|
|
28
|
+
resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config,
|
|
29
|
+
validateSigningProperties: () => validateSigningProperties
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(httpAuthSchemes_exports);
|
|
31
32
|
|
|
@@ -87,10 +88,21 @@ var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties)
|
|
|
87
88
|
}, "validateSigningProperties");
|
|
88
89
|
var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
|
|
89
90
|
async sign(httpRequest, identity, signingProperties) {
|
|
91
|
+
var _a;
|
|
90
92
|
if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
|
|
91
93
|
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
92
94
|
}
|
|
93
|
-
const
|
|
95
|
+
const validatedProps = await validateSigningProperties(signingProperties);
|
|
96
|
+
const { config, signer } = validatedProps;
|
|
97
|
+
let { signingRegion, signingName } = validatedProps;
|
|
98
|
+
const handlerExecutionContext = signingProperties.context;
|
|
99
|
+
if (((_a = handlerExecutionContext == null ? void 0 : handlerExecutionContext.authSchemes) == null ? void 0 : _a.length) ?? 0 > 1) {
|
|
100
|
+
const [first, second] = handlerExecutionContext.authSchemes;
|
|
101
|
+
if ((first == null ? void 0 : first.name) === "sigv4a" && (second == null ? void 0 : second.name) === "sigv4") {
|
|
102
|
+
signingRegion = (second == null ? void 0 : second.signingRegion) ?? signingRegion;
|
|
103
|
+
signingName = (second == null ? void 0 : second.signingName) ?? signingName;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
94
106
|
const signedRequest = await signer.sign(httpRequest, {
|
|
95
107
|
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
96
108
|
signingRegion,
|
|
@@ -249,5 +261,6 @@ var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
|
|
|
249
261
|
AwsSdkSigV4ASigner,
|
|
250
262
|
AwsSdkSigV4Signer,
|
|
251
263
|
resolveAWSSDKSigV4Config,
|
|
252
|
-
resolveAwsSdkSigV4Config
|
|
264
|
+
resolveAwsSdkSigV4Config,
|
|
265
|
+
validateSigningProperties
|
|
253
266
|
});
|
|
@@ -28,7 +28,17 @@ export class AwsSdkSigV4Signer {
|
|
|
28
28
|
if (!HttpRequest.isInstance(httpRequest)) {
|
|
29
29
|
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const validatedProps = await validateSigningProperties(signingProperties);
|
|
32
|
+
const { config, signer } = validatedProps;
|
|
33
|
+
let { signingRegion, signingName } = validatedProps;
|
|
34
|
+
const handlerExecutionContext = signingProperties.context;
|
|
35
|
+
if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
|
|
36
|
+
const [first, second] = handlerExecutionContext.authSchemes;
|
|
37
|
+
if (first?.name === "sigv4a" && second?.name === "sigv4") {
|
|
38
|
+
signingRegion = second?.signingRegion ?? signingRegion;
|
|
39
|
+
signingName = second?.signingName ?? signingName;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
32
42
|
const signedRequest = await signer.sign(httpRequest, {
|
|
33
43
|
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
34
44
|
signingRegion: signingRegion,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer";
|
|
1
|
+
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties } from "./AwsSdkSigV4Signer";
|
|
2
2
|
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
|
|
3
3
|
export * from "./resolveAwsSdkSigV4Config";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer";
|
|
1
|
+
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties } from "./AwsSdkSigV4Signer";
|
|
2
2
|
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
|
|
3
3
|
export * from "./resolveAwsSdkSigV4Config";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
AwsSdkSigV4Signer,
|
|
3
|
+
AWSSDKSigV4Signer,
|
|
4
|
+
validateSigningProperties,
|
|
5
|
+
} from "./AwsSdkSigV4Signer";
|
|
2
6
|
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
|
|
3
7
|
export * from "./resolveAwsSdkSigV4Config";
|
package/package.json
CHANGED