You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/21 10:46:45 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3873: Add support for checksum algorithms in AWS

tustvold commented on code in PR #3873:
URL: https://github.com/apache/arrow-rs/pull/3873#discussion_r1143190371


##########
object_store/src/aws/client.rs:
##########
@@ -281,10 +286,22 @@ impl S3Client {
     ) -> Result<Response> {
         let credential = self.get_credential().await?;
         let url = self.config.path_url(path);
-
         let mut builder = self.client.request(Method::PUT, url);
+
+        let mut payload_checksum = None;
+
         if let Some(bytes) = bytes {
-            builder = builder.body(bytes)
+            payload_checksum = match self.config().checksum {
+                Some(checksum) => {
+                    let digest = checksum.digest(&bytes);

Review Comment:
   I think this is only correct if the checksum is a sha256 digest?



##########
object_store/src/aws/client.rs:
##########
@@ -281,10 +286,22 @@ impl S3Client {
     ) -> Result<Response> {
         let credential = self.get_credential().await?;
         let url = self.config.path_url(path);
-
         let mut builder = self.client.request(Method::PUT, url);
+
+        let mut payload_checksum = None;
+
         if let Some(bytes) = bytes {
-            builder = builder.body(bytes)
+            payload_checksum = match self.config().checksum {
+                Some(checksum) => {
+                    let digest = checksum.digest(&bytes);

Review Comment:
   I think passing this to the request signing is only correct if the checksum is a sha256 digest?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org