From 3fd3f9f765ccf39f1cc4f4f307caa1f6cea30fe4 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Fri, 6 Oct 2023 16:40:40 -0400 Subject: [PATCH] Proper skew logic --- .../src/aws/smithy/kotlin/runtime/http/auth/AwsHttpSigner.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/auth/http-auth-aws/common/src/aws/smithy/kotlin/runtime/http/auth/AwsHttpSigner.kt b/runtime/auth/http-auth-aws/common/src/aws/smithy/kotlin/runtime/http/auth/AwsHttpSigner.kt index 32f18e9dc..112bbb2b6 100644 --- a/runtime/auth/http-auth-aws/common/src/aws/smithy/kotlin/runtime/http/auth/AwsHttpSigner.kt +++ b/runtime/auth/http-auth-aws/common/src/aws/smithy/kotlin/runtime/http/auth/AwsHttpSigner.kt @@ -127,8 +127,9 @@ public class AwsHttpSigner(private val config: Config) : HttpSigner { algorithm = config.algorithm // apply clock skew if applicable - signingDate = (attributes.getOrNull(AwsSigningAttributes.SigningDate) ?: Instant.now()) + - (attributes.getOrNull(HttpOperationContext.ClockSkew) ?: Duration.ZERO) + signingDate = attributes.getOrNull(AwsSigningAttributes.SigningDate) + ?: (Instant.now() + (attributes.getOrNull(HttpOperationContext.ClockSkew) ?: Duration.ZERO)) + signatureType = config.signatureType omitSessionToken = config.omitSessionToken