diff --git a/aws-s3-transfer-manager/Cargo.toml b/aws-s3-transfer-manager/Cargo.toml index b2d2da4..c4a0c18 100644 --- a/aws-s3-transfer-manager/Cargo.toml +++ b/aws-s3-transfer-manager/Cargo.toml @@ -11,13 +11,20 @@ publish = false [dependencies] async-channel = "2.3.1" async-trait = "0.1.82" -aws-config = { version = "1.5.6", features = ["behavior-version-latest"] } -aws-sdk-s3 = { version = "1.51.0", features = ["behavior-version-latest"] } -aws-smithy-async = "1.2.1" -aws-smithy-experimental = { version = "0.1.3", features = ["crypto-aws-lc"] } -aws-smithy-runtime-api = "1.7.1" -aws-smithy-types = "1.2.6" -aws-types = "1.3.3" +#aws-config = { version = "1.5.6", features = ["behavior-version-latest"] } +#aws-sdk-s3 = { version = "1.51.0", features = ["behavior-version-latest"] } +#aws-smithy-async = "1.2.1" +#aws-smithy-experimental = { version = "0.1.3", features = ["crypto-aws-lc"] } +#aws-smithy-runtime-api = "1.7.1" +#aws-smithy-types = "1.2.6" +#aws-types = "1.3.3" +aws-config = { path = "../../motorcade/aws-sdk/sdk/aws-config" } +aws-sdk-s3 = { path = "../../motorcade/aws-sdk/sdk/s3" } +aws-smithy-async = { path = "../../motorcade/aws-sdk/sdk/aws-smithy-async" } +aws-smithy-experimental = { path = "../../motorcade/aws-sdk/sdk/aws-smithy-experimental", features = ["crypto-aws-lc"] } +aws-smithy-runtime-api = { path = "../../motorcade/aws-sdk/sdk/aws-smithy-runtime-api" } +aws-smithy-types = { path = "../../motorcade/aws-sdk/sdk/aws-smithy-types" } +aws-types = { path = "../../motorcade/aws-sdk/sdk/aws-types" } blocking = "1.6.0" bytes = "1" bytes-utils = "0.1.4" @@ -30,9 +37,12 @@ tracing = "0.1" walkdir = "2" [dev-dependencies] -aws-sdk-s3 = { version = "1.51.0", features = ["behavior-version-latest", "test-util"] } -aws-smithy-mocks-experimental = "0.2.1" -aws-smithy-runtime = { version = "1.7.1", features = ["client", "connector-hyper-0-14-x", "test-util", "wire-mock"] } +#aws-sdk-s3 = { version = "1.51.0", features = ["behavior-version-latest", "test-util"] } +#aws-smithy-mocks-experimental = "0.2.1" +#aws-smithy-runtime = { version = "1.7.1", features = ["client", "connector-hyper-0-14-x", "test-util", "wire-mock"] } +aws-sdk-s3 = { path = "../../motorcade/aws-sdk/sdk/s3", features = ["behavior-version-latest", "test-util"] } +aws-smithy-mocks-experimental = { path = "../../motorcade/aws-sdk/sdk/aws-smithy-mocks-experimental" } +aws-smithy-runtime = { path = "../../motorcade/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x", "test-util", "wire-mock"] } clap = { version = "4.5.7", default-features = false, features = ["derive", "std", "help"] } console-subscriber = "0.4.0" http-02x = { package = "http", version = "0.2.9" } diff --git a/aws-s3-transfer-manager/src/io/adapters.rs b/aws-s3-transfer-manager/src/io/adapters.rs index 0e2e0f2..803cafe 100644 --- a/aws-s3-transfer-manager/src/io/adapters.rs +++ b/aws-s3-transfer-manager/src/io/adapters.rs @@ -118,7 +118,7 @@ where let data: Bytes = inner_buf.into(); let part_number = *this.next_part; *this.next_part += 1; - let part = PartData { part_number, data }; + let part = PartData::new(part_number, data); return Poll::Ready(Some(Ok(part))); } else if n == 0 { // EOF diff --git a/aws-s3-transfer-manager/src/io/stream.rs b/aws-s3-transfer-manager/src/io/stream.rs index 98f4ec7..2906ccf 100644 --- a/aws-s3-transfer-manager/src/io/stream.rs +++ b/aws-s3-transfer-manager/src/io/stream.rs @@ -171,6 +171,13 @@ pub struct PartData { // 1-indexed pub(crate) part_number: u64, pub(crate) data: Bytes, + + // TODO: getters, setters, builders, docs, cats, dogs, etc + pub checksum_crc32: Option, + pub checksum_crc32_c: Option, + pub checksum_crc64_nvme: Option, + pub checksum_sha1: Option, + pub checksum_sha256: Option, } impl PartData { @@ -183,6 +190,11 @@ impl PartData { Self { part_number, data: data.into(), + checksum_crc32: None, + checksum_crc32_c: None, + checksum_crc64_nvme: None, + checksum_sha1: None, + checksum_sha256: None, } } } diff --git a/aws-s3-transfer-manager/src/operation/upload.rs b/aws-s3-transfer-manager/src/operation/upload.rs index ccc08a1..bfb05aa 100644 --- a/aws-s3-transfer-manager/src/operation/upload.rs +++ b/aws-s3-transfer-manager/src/operation/upload.rs @@ -40,6 +40,8 @@ impl Upload { handle: Arc, mut input: crate::operation::upload::UploadInput, ) -> Result { + input = validate_and_fix_up_checksum_fields(&handle, input)?; + let min_mpu_threshold = handle.mpu_threshold_bytes(); let stream = input.take_body(); @@ -66,6 +68,95 @@ impl Upload { } } +/// Validate checksum fields. +/// Fix up the input and return it, so that checksum_algorithm and multipart_checksum_type +/// are both set, if we're doing checksums at all. +fn validate_and_fix_up_checksum_fields( + handle: &crate::client::Handle, + mut input: crate::operation::upload::UploadInput, +) -> Result { + use aws_sdk_s3::types::{ChecksumAlgorithm, ChecksumType}; + + // Ensure user didn't pass multiple full_object_checksum_ values + let full_object_checksum_count = [ + &input.full_object_checksum_crc32, + &input.full_object_checksum_crc32_c, + &input.full_object_checksum_crc64_nvme, + ] + .iter() + .filter(|x| x.is_some()) + .count(); + if full_object_checksum_count > 1 { + return Err(error::invalid_input( + "Expecting a single full_object_checksum_ value. Multiple values are not allowed.", + )); + } + + // Ensure that, if user set multipart_checksum_type, we know the algorithm they want to use + if input.multipart_checksum_type.is_some() + && input.checksum_algorithm.is_none() + && full_object_checksum_count == 0 + { + return Err(error::invalid_input( + "multipart_checksum_type can only be used when a checksum algorithm is specified.", + )); + } + + // If user set full_object_checksum_ value, ensure checksum_algorithm is set to match + if full_object_checksum_count == 1 { + let expected_algorithm = if input.full_object_checksum_crc32.is_some() { + ChecksumAlgorithm::Crc32 + } else if input.full_object_checksum_crc32_c.is_some() { + ChecksumAlgorithm::Crc32C + } else { + assert!(input.full_object_checksum_crc64_nvme.is_some()); + ChecksumAlgorithm::Crc64Nvme + }; + + match &input.checksum_algorithm { + None => input.checksum_algorithm = Some(expected_algorithm), + Some(checksum_algorithm) => { + if checksum_algorithm != &expected_algorithm { + return Err(error::invalid_input( + "Given checksum_algorithm does not match full_object_checksum_ value", + )); + } + } + } + } + + // If checksum_algorithm is still unset, but request_checksum_calculation is WhenSupported, + // default to using Crc64Nvme. + if input.checksum_algorithm.is_none() + && handle + .config + .client() + .config() + .request_checksum_calculation() + .unwrap() + .eq(&aws_sdk_s3::config::RequestChecksumCalculation::WhenSupported) + { + input.checksum_algorithm = Some(ChecksumAlgorithm::Crc64Nvme); + } + + // If multipart_checksum_type is still unset, and we know the algorithm, + // default to FullObject (unless it's SHA which must use Composite for multipart) + if input.multipart_checksum_type.is_none() { + input.multipart_checksum_type = match &input.checksum_algorithm { + None => None, + Some( + ChecksumAlgorithm::Crc32 | ChecksumAlgorithm::Crc32C | ChecksumAlgorithm::Crc64Nvme, + ) => Some(ChecksumType::FullObject), + Some(ChecksumAlgorithm::Sha1 | ChecksumAlgorithm::Sha256) => { + Some(ChecksumType::Composite) + } + Some(_) => return Err(error::invalid_input("Unknown checksum_algorithm")), + }; + } + + Ok(input) +} + async fn try_start_put_object( ctx: UploadContext, stream: InputStream, @@ -126,6 +217,9 @@ async fn put_object( .set_object_lock_legal_hold_status(ctx.request.object_lock_legal_hold_status.clone()) .set_expected_bucket_owner(ctx.request.expected_bucket_owner.clone()) .set_checksum_algorithm(ctx.request.checksum_algorithm.clone()) + .set_checksum_crc32(ctx.request.full_object_checksum_crc32.clone()) + .set_checksum_crc32_c(ctx.request.full_object_checksum_crc32_c.clone()) + .set_checksum_crc64_nvme(ctx.request.full_object_checksum_crc64_nvme.clone()) .send() .instrument(tracing::info_span!( "send-upload-part", @@ -211,6 +305,7 @@ async fn start_mpu(ctx: &UploadContext) -> Result ///

CRC32C

///
  • + ///

    CRC64NVME

  • + ///
  • ///

    SHA1

  • ///
  • ///

    SHA256

  • @@ -260,6 +262,8 @@ impl UploadFluentBuilder { ///
  • ///

    CRC32C

  • ///
  • + ///

    CRC64NVME

  • + ///
  • ///

    SHA1

  • ///
  • ///

    SHA256

  • @@ -283,6 +287,8 @@ impl UploadFluentBuilder { ///
  • ///

    CRC32C

  • ///
  • + ///

    CRC64NVME

  • + ///
  • ///

    SHA1

  • ///
  • ///

    SHA256

  • @@ -294,61 +300,61 @@ impl UploadFluentBuilder { pub fn get_checksum_algorithm(&self) -> &Option { self.inner.get_checksum_algorithm() } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn multipart_checksum_type(mut self, input: aws_sdk_s3::types::ChecksumType) -> Self { + self.inner.multipart_checksum_type = Some(input); + self + } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn set_multipart_checksum_type(mut self, input: Option) -> Self { + self.inner = self.inner.set_multipart_checksum_type(input); + self + } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn get_multipart_checksum_type(&self) -> &Option { + self.inner.get_multipart_checksum_type() + } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_crc32(mut self, input: impl Into) -> Self { - self.inner = self.inner.checksum_crc32(input); + pub fn full_object_checksum_crc32(mut self, input: impl Into) -> Self { + self.inner = self.inner.full_object_checksum_crc32(input); self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_crc32(mut self, input: Option) -> Self { - self.inner = self.inner.set_checksum_crc32(input); + pub fn set_full_object_checksum_crc32(mut self, input: Option) -> Self { + self.inner = self.inner.set_full_object_checksum_crc32(input); self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_crc32(&self) -> Option<&str> { - self.inner.get_checksum_crc32() + pub fn get_full_object_checksum_crc32(&self) -> Option<&str> { + self.inner.get_full_object_checksum_crc32() } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_crc32_c(mut self, input: impl Into) -> Self { - self.inner = self.inner.checksum_crc32_c(input); + pub fn full_object_checksum_crc32_c(mut self, input: impl Into) -> Self { + self.inner = self.inner.full_object_checksum_crc32_c(input); self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_crc32_c(mut self, input: Option) -> Self { - self.inner = self.inner.set_checksum_crc32_c(input); + pub fn set_full_object_checksum_crc32_c(mut self, input: Option) -> Self { + self.inner = self.inner.set_full_object_checksum_crc32_c(input); self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_crc32_c(&self) -> Option<&str> { - self.inner.get_checksum_crc32_c() - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_sha1(mut self, input: impl Into) -> Self { - self.inner = self.inner.checksum_sha1(input); - self - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_sha1(mut self, input: Option) -> Self { - self.inner = self.inner.set_checksum_sha1(input); - self - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_sha1(&self) -> Option<&str> { - self.inner.get_checksum_sha1() + pub fn get_full_object_checksum_crc32_c(&self) -> Option<&str> { + self.inner.get_full_object_checksum_crc32_c() } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_sha256(mut self, input: impl Into) -> Self { - self.inner = self.inner.checksum_sha256(input); + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn full_object_checksum_crc64_nvme(mut self, input: impl Into) -> Self { + self.inner = self.inner.full_object_checksum_crc64_nvme(input); self } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_sha256(mut self, input: Option) -> Self { - self.inner = self.inner.set_checksum_sha256(input); + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn set_full_object_checksum_crc64_nvme(mut self, input: Option) -> Self { + self.inner = self.inner.set_full_object_checksum_crc64_nvme(input); self } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_sha256(&self) -> Option<&str> { - self.inner.get_checksum_sha256() + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn get_full_object_checksum_crc64_nvme(&self) -> Option<&str> { + self.inner.get_full_object_checksum_crc64_nvme() } ///

    The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3.

    pub fn expires(mut self, input: ::aws_smithy_types::DateTime) -> Self { diff --git a/aws-s3-transfer-manager/src/operation/upload/input.rs b/aws-s3-transfer-manager/src/operation/upload/input.rs index 7bce6c6..117b745 100644 --- a/aws-s3-transfer-manager/src/operation/upload/input.rs +++ b/aws-s3-transfer-manager/src/operation/upload/input.rs @@ -9,6 +9,12 @@ use crate::types::FailedMultipartUploadPolicy; use std::fmt::Debug; use std::mem; +// TODO: update docs on multipart_checksum_type to say we default to FullObject, and how Composite only applies to multipart, etc + +// TODO: update docs on checksum_algorithm to say we default to CRC64 + +// TODO: comprehensive docs on checksums + /// Request type for uploading a single object #[non_exhaustive] pub struct UploadInput { @@ -58,6 +64,8 @@ pub struct UploadInput { ///
  • ///

    CRC32C

  • ///
  • + ///

    CRC64NVME

  • + ///
  • ///

    SHA1

  • ///
  • ///

    SHA256

  • @@ -67,14 +75,14 @@ pub struct UploadInput { ///

    For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

    /// pub checksum_algorithm: Option, + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub multipart_checksum_type: Option, ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub checksum_crc32: Option, + pub full_object_checksum_crc32: Option, ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub checksum_crc32_c: Option, - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub checksum_sha1: Option, - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub checksum_sha256: Option, + pub full_object_checksum_crc32_c: Option, + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub full_object_checksum_crc64_nvme: Option, ///

    The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3.

    pub expires: Option<::aws_smithy_types::DateTime>, ///

    Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.

    @@ -279,21 +287,21 @@ impl UploadInput { pub fn checksum_algorithm(&self) -> Option<&aws_sdk_s3::types::ChecksumAlgorithm> { self.checksum_algorithm.as_ref() } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn multipart_checksum_type(&self) -> Option<&aws_sdk_s3::types::ChecksumType> { + self.multipart_checksum_type.as_ref() + } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_crc32(&self) -> Option<&str> { - self.checksum_crc32.as_deref() + pub fn full_object_checksum_crc32(&self) -> Option<&str> { + self.full_object_checksum_crc32.as_deref() } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_crc32_c(&self) -> Option<&str> { - self.checksum_crc32_c.as_deref() - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_sha1(&self) -> Option<&str> { - self.checksum_sha1.as_deref() + pub fn full_object_checksum_crc32_c(&self) -> Option<&str> { + self.full_object_checksum_crc32_c.as_deref() } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_sha256(&self) -> Option<&str> { - self.checksum_sha256.as_deref() + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 64-bit CRC64-NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn full_object_checksum_crc64_nvme(&self) -> Option<&str> { + self.full_object_checksum_crc64_nvme.as_deref() } ///

    The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3.

    pub fn expires(&self) -> Option<&::aws_smithy_types::DateTime> { @@ -473,10 +481,19 @@ impl Debug for UploadInput { formatter.field("content_md5", &self.content_md5); formatter.field("content_type", &self.content_type); formatter.field("checksum_algorithm", &self.checksum_algorithm); - formatter.field("checksum_crc32", &self.checksum_crc32); - formatter.field("checksum_crc32_c", &self.checksum_crc32_c); - formatter.field("checksum_sha1", &self.checksum_sha1); - formatter.field("checksum_sha256", &self.checksum_sha256); + formatter.field("multipart_checksum_type", &self.multipart_checksum_type); + formatter.field( + "full_object_checksum_crc32", + &self.full_object_checksum_crc32, + ); + formatter.field( + "full_object_checksum_crc32_c", + &self.full_object_checksum_crc32_c, + ); + formatter.field( + "full_object_checksum_crc64_nvme", + &self.full_object_checksum_crc64_nvme, + ); formatter.field("expires", &self.expires); formatter.field("grant_full_control", &self.grant_full_control); formatter.field("grant_read", &self.grant_read); @@ -534,10 +551,10 @@ pub struct UploadInputBuilder { pub(crate) content_md5: Option, pub(crate) content_type: Option, pub(crate) checksum_algorithm: Option, - pub(crate) checksum_crc32: Option, - pub(crate) checksum_crc32_c: Option, - pub(crate) checksum_sha1: Option, - pub(crate) checksum_sha256: Option, + pub(crate) multipart_checksum_type: Option, + pub(crate) full_object_checksum_crc32: Option, + pub(crate) full_object_checksum_crc32_c: Option, + pub(crate) full_object_checksum_crc64_nvme: Option, pub(crate) expires: Option<::aws_smithy_types::DateTime>, pub(crate) grant_full_control: Option, pub(crate) grant_read: Option, @@ -769,6 +786,8 @@ impl UploadInputBuilder { ///
  • ///

    CRC32C

  • ///
  • + ///

    CRC64NVME

  • + ///
  • ///

    SHA1

  • ///
  • ///

    SHA256

  • @@ -823,61 +842,61 @@ impl UploadInputBuilder { pub fn get_checksum_algorithm(&self) -> &Option { &self.checksum_algorithm } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn multipart_checksum_type(mut self, input: aws_sdk_s3::types::ChecksumType) -> Self { + self.multipart_checksum_type = Some(input); + self + } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn set_multipart_checksum_type(mut self, input: Option) -> Self { + self.multipart_checksum_type = input; + self + } + ///

    Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn get_multipart_checksum_type(&self) -> &Option { + &self.multipart_checksum_type + } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_crc32(mut self, input: impl Into) -> Self { - self.checksum_crc32 = Some(input.into()); + pub fn full_object_checksum_crc32(mut self, input: impl Into) -> Self { + self.full_object_checksum_crc32 = Some(input.into()); self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_crc32(mut self, input: Option) -> Self { - self.checksum_crc32 = input; + pub fn set_full_object_checksum_crc32(mut self, input: Option) -> Self { + self.full_object_checksum_crc32 = input; self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_crc32(&self) -> Option<&str> { - self.checksum_crc32.as_deref() + pub fn get_full_object_checksum_crc32(&self) -> Option<&str> { + self.full_object_checksum_crc32.as_deref() } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_crc32_c(mut self, input: impl Into) -> Self { - self.checksum_crc32_c = Some(input.into()); + pub fn full_object_checksum_crc32_c(mut self, input: impl Into) -> Self { + self.full_object_checksum_crc32_c = Some(input.into()); self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_crc32_c(mut self, input: Option) -> Self { - self.checksum_crc32_c = input; + pub fn set_full_object_checksum_crc32_c(mut self, input: Option) -> Self { + self.full_object_checksum_crc32_c = input; self } ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_crc32_c(&self) -> Option<&str> { - self.checksum_crc32_c.as_deref() - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_sha1(mut self, input: impl Into) -> Self { - self.checksum_sha1 = Some(input.into()); - self - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_sha1(mut self, input: Option) -> Self { - self.checksum_sha1 = input; - self + pub fn get_full_object_checksum_crc32_c(&self) -> Option<&str> { + self.full_object_checksum_crc32_c.as_deref() } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_sha1(&self) -> Option<&str> { - self.checksum_sha1.as_deref() - } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn checksum_sha256(mut self, input: impl Into) -> Self { - self.checksum_sha256 = Some(input.into()); + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn full_object_checksum_crc64_nvme(mut self, input: impl Into) -> Self { + self.full_object_checksum_crc64_nvme = Some(input.into()); self } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn set_checksum_sha256(mut self, input: Option) -> Self { - self.checksum_sha256 = input; + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn set_full_object_checksum_crc64_nvme(mut self, input: Option) -> Self { + self.full_object_checksum_crc64_nvme = input; self } - ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - pub fn get_checksum_sha256(&self) -> Option<&str> { - self.checksum_sha256.as_deref() + ///

    This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit CRC64NVME checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

    + pub fn get_full_object_checksum_crc64_nvme(&self) -> Option<&str> { + self.full_object_checksum_crc64_nvme.as_deref() } ///

    The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3.

    pub fn expires(mut self, input: ::aws_smithy_types::DateTime) -> Self { @@ -1453,10 +1472,10 @@ impl UploadInputBuilder { content_md5: self.content_md5, content_type: self.content_type, checksum_algorithm: self.checksum_algorithm, - checksum_crc32: self.checksum_crc32, - checksum_crc32_c: self.checksum_crc32_c, - checksum_sha1: self.checksum_sha1, - checksum_sha256: self.checksum_sha256, + multipart_checksum_type: self.multipart_checksum_type, + full_object_checksum_crc32: self.full_object_checksum_crc32, + full_object_checksum_crc32_c: self.full_object_checksum_crc32_c, + full_object_checksum_crc64_nvme: self.full_object_checksum_crc64_nvme, expires: self.expires, grant_full_control: self.grant_full_control, grant_read: self.grant_read, @@ -1498,10 +1517,19 @@ impl Debug for UploadInputBuilder { formatter.field("content_md5", &self.content_md5); formatter.field("content_type", &self.content_type); formatter.field("checksum_algorithm", &self.checksum_algorithm); - formatter.field("checksum_crc32", &self.checksum_crc32); - formatter.field("checksum_crc32_c", &self.checksum_crc32_c); - formatter.field("checksum_sha1", &self.checksum_sha1); - formatter.field("checksum_sha256", &self.checksum_sha256); + formatter.field("multipart_checksum_type", &self.multipart_checksum_type); + formatter.field( + "full_object_checksum_crc32", + &self.full_object_checksum_crc32, + ); + formatter.field( + "full_object_checksum_crc32_c", + &self.full_object_checksum_crc32_c, + ); + formatter.field( + "full_object_checksum_crc64_nvme", + &self.full_object_checksum_crc64_nvme, + ); formatter.field("expires", &self.expires); formatter.field("grant_full_control", &self.grant_full_control); formatter.field("grant_read", &self.grant_read); diff --git a/aws-s3-transfer-manager/src/operation/upload/service.rs b/aws-s3-transfer-manager/src/operation/upload/service.rs index 6b170ce..b7237d9 100644 --- a/aws-s3-transfer-manager/src/operation/upload/service.rs +++ b/aws-s3-transfer-manager/src/operation/upload/service.rs @@ -46,6 +46,12 @@ async fn upload_part_handler(request: UploadPartRequest) -> Result Result