diff --git a/Package.swift b/Package.swift index 3a76cf2ed16..1e5dd4360a3 100644 --- a/Package.swift +++ b/Package.swift @@ -75,7 +75,7 @@ let package = Package( ), .target( name: "AWSSDKHTTPAuth", - dependencies: [.crt, .clientRuntime, .smithyChecksumsAPI, "AWSSDKIdentity"], + dependencies: [.crt, .clientRuntime, "AWSSDKIdentity"], path: "./Sources/Core/AWSSDKHTTPAuth" ), .target( diff --git a/Sources/Core/AWSSDKHTTPAuth/AWSSigV4Signer.swift b/Sources/Core/AWSSDKHTTPAuth/AWSSigV4Signer.swift index 3bd85651ef2..be5f5ad16f5 100644 --- a/Sources/Core/AWSSDKHTTPAuth/AWSSigV4Signer.swift +++ b/Sources/Core/AWSSDKHTTPAuth/AWSSigV4Signer.swift @@ -9,7 +9,6 @@ import Smithy import SmithyIdentityAPI import SmithyHTTPAPI import SmithyHTTPAuthAPI -import SmithyChecksumsAPI import AwsCommonRuntimeKit import ClientRuntime import Foundation @@ -68,7 +67,7 @@ public class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer { signingConfig: crtSigningConfig, signature: requestSignature, trailingHeaders: unsignedRequest.trailingHeaders, - checksumAlgorithm: signingProperties.get(key: SigningPropertyKeys.checksum) + checksumString: signingProperties.get(key: SigningPropertyKeys.checksum) ) } @@ -105,11 +104,11 @@ public class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer { let signedBodyHeader: AWSSignedBodyHeader = signingProperties.get(key: SigningPropertyKeys.signedBodyHeader) ?? .none // Determine signed body value - let checksum = signingProperties.get(key: SigningPropertyKeys.checksum) + let checksumIsPresent = signingProperties.get(key: SigningPropertyKeys.checksum) != nil let isChunkedEligibleStream = signingProperties.get(key: SigningPropertyKeys.isChunkedEligibleStream) ?? false let signedBodyValue: AWSSignedBodyValue = determineSignedBodyValue( - checksum: checksum, + checksumIsPresent: checksumIsPresent, isChunkedEligbleStream: isChunkedEligibleStream, isUnsignedBody: unsignedBody ) @@ -218,7 +217,7 @@ public class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer { } private func determineSignedBodyValue( - checksum: ChecksumAlgorithm?, + checksumIsPresent: Bool, isChunkedEligbleStream: Bool, isUnsignedBody: Bool ) -> AWSSignedBodyValue { @@ -228,7 +227,7 @@ public class AWSSigV4Signer: SmithyHTTPAuthAPI.Signer { } // streaming + eligible for chunked transfer - if checksum == nil { + if !checksumIsPresent { return isUnsignedBody ? .unsignedPayload : .streamingSha256Payload } else { // checksum is present diff --git a/Sources/Core/AWSSDKHTTPAuth/SigV4AuthScheme.swift b/Sources/Core/AWSSDKHTTPAuth/SigV4AuthScheme.swift index c0cd83f046d..d7c1396f0b7 100644 --- a/Sources/Core/AWSSDKHTTPAuth/SigV4AuthScheme.swift +++ b/Sources/Core/AWSSDKHTTPAuth/SigV4AuthScheme.swift @@ -58,7 +58,7 @@ public struct SigV4AuthScheme: AuthScheme { updatedSigningProperties.set(key: SigningPropertyKeys.omitSessionToken, value: false) // Copy checksum from middleware context to signing properties - updatedSigningProperties.set(key: SigningPropertyKeys.checksum, value: context.checksum) + updatedSigningProperties.set(key: SigningPropertyKeys.checksum, value: context.checksumString) // Copy chunked streaming eligiblity from middleware context to signing properties updatedSigningProperties.set( diff --git a/Sources/Core/AWSSDKHTTPAuth/SigningPropertyKeys.swift b/Sources/Core/AWSSDKHTTPAuth/SigningPropertyKeys.swift index bace32b6317..ee3a21295c9 100644 --- a/Sources/Core/AWSSDKHTTPAuth/SigningPropertyKeys.swift +++ b/Sources/Core/AWSSDKHTTPAuth/SigningPropertyKeys.swift @@ -7,7 +7,6 @@ import Smithy import SmithyHTTPAuthAPI -import SmithyChecksumsAPI import struct Foundation.TimeInterval public extension SigningPropertyKeys { @@ -21,6 +20,6 @@ public extension SigningPropertyKeys { static let signatureType = AttributeKey(name: "SignatureType") static let bidirectionalStreaming = AttributeKey(name: "BidirectionalStreaming") static let expiration = AttributeKey(name: "Expiration") - static let checksum = AttributeKey(name: "checksum") + static let checksum = AttributeKey(name: "checksum") static let isChunkedEligibleStream = AttributeKey(name: "isChunkedEligibleStream") }