-
Notifications
You must be signed in to change notification settings - Fork 869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for unsigned payloads in aws #3741
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the appropriate key to AmazonS3ConfigKey
, and corresponding parsing (FromStr
) and serialisation (AsRef
) methods, such that the new option can be configured via the storage options interface.
@roeap How do we add integration test for this option. |
There are some tests for these options, you could add a case in that test. arrow-rs/object_store/src/aws/mod.rs Lines 1194 to 1218 in ceba128
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just a few minor comments, but overall I think this looks good!
object_store/src/aws/mod.rs
Outdated
@@ -822,6 +837,13 @@ impl AmazonS3Builder { | |||
self | |||
} | |||
|
|||
/// Sets the client to not include payload checksum in signature calculation. | |||
/// See [unsigned payload option](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html) | |||
pub fn with_unsigned_payload(mut self) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in other cases for boolean options, we pass in the actual parameter, so that true and false can explicitly be set. While not overly critical, I think its better to be consistent,.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this change but for reference an existing option with_imdsv1_fallback does not take boolean argument.
I am not sure what general convention are around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thank you. Apologies for the slow review
object_store/src/aws/mod.rs
Outdated
@@ -1222,6 +1252,14 @@ mod tests { | |||
stream_get(&integration).await; | |||
} | |||
|
|||
#[tokio::test] | |||
async fn s3_test_unsigned_payload() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to race with s3_test above, it likely needs to be rolled into the same test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, will it be better to add something like https://crates.io/crates/serial_test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather avoid additional test dependencies if possible. I see no issue with just merging this into the same test as above, the stack trace will make it clear what test failed
I'm afraid I messed up the sequencing and so this missed the release today... Too many plates... Thank you once again |
Benchmark runs are scheduled for baseline = 5cc0f9b and contender = e7eb304. e7eb304 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3737 .
Rationale for this change
Explained in #3737
What changes are included in this PR?
with_unsigned_payload
configuration option to AmazonS3Builder.sign_payload
bool to S3Config andRequestSigner
.sign_payload
is set to true it will work as before and set a SHA256 hash tox-amz-content-sha256
. Otherwise it will set it as"UNSIGNED_PAYLOAD"
Are there any user-facing changes?
with_unsigned_payload