andyhuangdev opened a new pull request, #11559: URL: https://github.com/apache/ozone/pull/11559
## What changes were proposed in this pull request? S3 Gateway computes the body SHA-256 for UploadPart requests but does not compare it with x-amz-content-sha256, allowing parts with mismatched payload hashes to be committed. This patch extracts the duplicated PutObject validation into a shared write guard method and applies it to both regular and datastream UploadPart paths. Validation runs before commit and returns XAmzContentSHA256Mismatch when the hashes differ. Regression tests cover matching hashes, rejection without committing a part, and preservation of an existing part when an overwrite fails validation. Existing multipart test fixtures use UNSIGNED-PAYLOAD instead of placeholder hashes. ## What is the link to the Apache JIRA [HDDS-17056](https://issues.apache.org/jira/browse/HDDS-17056) ## How was this patch tested? - Confirmed the new mismatch test failed on both regular and datastream paths before the fix. - All 1,601 S3 Gateway unit tests passed after the fix. - Project checkstyle and git diff --check passed. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
