@aws-sdk/core
Advanced tools
@@ -62,2 +62,3 @@ 'use strict'; | ||
| } | ||
| signingProperties._preRequestSystemClockOffset = config.systemClockOffset; | ||
| const signedRequest = await signer.sign(httpRequest, { | ||
@@ -72,10 +73,14 @@ signingDate: getSkewCorrectedDate(config.systemClockOffset), | ||
| return (error) => { | ||
| const serverTime = error.ServerTime ?? getDateHeader(error.$response); | ||
| const errorException = error; | ||
| const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response); | ||
| if (serverTime) { | ||
| const config = throwSigningPropertyError("config", signingProperties.config); | ||
| const initialSystemClockOffset = config.systemClockOffset; | ||
| config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); | ||
| const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; | ||
| if (clockSkewCorrected && error.$metadata) { | ||
| error.$metadata.clockSkewCorrected = true; | ||
| const preRequestOffset = signingProperties._preRequestSystemClockOffset; | ||
| const newOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); | ||
| const isLocalCorrection = newOffset !== config.systemClockOffset; | ||
| const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset; | ||
| const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection; | ||
| if (clockSkewCorrected && errorException.$metadata) { | ||
| config.systemClockOffset = newOffset; | ||
| errorException.$metadata.clockSkewCorrected = true; | ||
| } | ||
@@ -105,2 +110,3 @@ } | ||
| signingRegionSet ?? [signingRegion]).join(","); | ||
| signingProperties._preRequestSystemClockOffset = config.systemClockOffset; | ||
| const signedRequest = await signer.sign(httpRequest, { | ||
@@ -107,0 +113,0 @@ signingDate: getSkewCorrectedDate(config.systemClockOffset), |
@@ -13,2 +13,3 @@ import { HttpRequest } from "@smithy/core/protocols"; | ||
| signingRegionSet ?? [signingRegion]).join(","); | ||
| signingProperties._preRequestSystemClockOffset = config.systemClockOffset; | ||
| const signedRequest = await signer.sign(httpRequest, { | ||
@@ -15,0 +16,0 @@ signingDate: getSkewCorrectedDate(config.systemClockOffset), |
@@ -42,2 +42,3 @@ import { HttpRequest } from "@smithy/core/protocols"; | ||
| } | ||
| signingProperties._preRequestSystemClockOffset = config.systemClockOffset; | ||
| const signedRequest = await signer.sign(httpRequest, { | ||
@@ -52,10 +53,14 @@ signingDate: getSkewCorrectedDate(config.systemClockOffset), | ||
| return (error) => { | ||
| const serverTime = error.ServerTime ?? getDateHeader(error.$response); | ||
| const errorException = error; | ||
| const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response); | ||
| if (serverTime) { | ||
| const config = throwSigningPropertyError("config", signingProperties.config); | ||
| const initialSystemClockOffset = config.systemClockOffset; | ||
| config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); | ||
| const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; | ||
| if (clockSkewCorrected && error.$metadata) { | ||
| error.$metadata.clockSkewCorrected = true; | ||
| const preRequestOffset = signingProperties._preRequestSystemClockOffset; | ||
| const newOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); | ||
| const isLocalCorrection = newOffset !== config.systemClockOffset; | ||
| const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset; | ||
| const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection; | ||
| if (clockSkewCorrected && errorException.$metadata) { | ||
| config.systemClockOffset = newOffset; | ||
| errorException.$metadata.clockSkewCorrected = true; | ||
| } | ||
@@ -62,0 +67,0 @@ } |
+4
-4
| { | ||
| "name": "@aws-sdk/core", | ||
| "version": "3.974.17", | ||
| "version": "3.974.18", | ||
| "description": "Core functions & classes shared by multiple AWS SDK clients.", | ||
@@ -109,8 +109,8 @@ "scripts": { | ||
| "name": "AWS SDK for JavaScript Team", | ||
| "url": "https://aws.amazon.com/javascript/" | ||
| "url": "https://aws.amazon.com/sdk-for-javascript/" | ||
| }, | ||
| "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@aws-sdk/types": "^3.973.10", | ||
| "@aws-sdk/xml-builder": "^3.972.27", | ||
| "@aws-sdk/types": "^3.973.11", | ||
| "@aws-sdk/xml-builder": "^3.972.28", | ||
| "@aws/lambda-invoke-store": "^0.2.2", | ||
@@ -117,0 +117,0 @@ "@smithy/core": "^3.24.6", |
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
616742
0.24%14644
0.12%Updated