fix: add Content-MD5 header for Object Lock compliance#41241
fix: add Content-MD5 header for Object Lock compliance#41241NilanshBansal merged 1 commit intoreleasefrom
Conversation
WalkthroughAdds pre-upload MD5 computation and Content-Length setting in AmazonS3 upload flow. Sets ObjectMetadata ContentMD5 (Base64) and logs it; falls back without MD5 if algorithm unavailable. Introduces a unit test verifying MD5 hashing and Base64 encoding utilities. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AmazonS3Plugin
participant AWS_S3
Client->>AmazonS3Plugin: uploadFileInS3(payload, metadata)
activate AmazonS3Plugin
AmazonS3Plugin->>AmazonS3Plugin: Compute MD5(payload)
alt MD5 available
AmazonS3Plugin->>AmazonS3Plugin: Set metadata.ContentMD5 (Base64)\nSet metadata.ContentLength
else MD5 unavailable
Note over AmazonS3Plugin: Log warning\nProceed without ContentMD5
AmazonS3Plugin->>AmazonS3Plugin: Set metadata.ContentLength
end
AmazonS3Plugin->>AWS_S3: PutObject(payload, metadata)
AWS_S3-->>AmazonS3Plugin: Response
deactivate AmazonS3Plugin
AmazonS3Plugin-->>Client: Result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/17859885587. |
|
Deploy-Preview-URL: https://ce-41241.dp.appsmith.com |
Description
Problem:
Users were unable to upload files to S3 buckets with Object Lock enabled, receiving the error:
Root Cause:
The S3 plugin's
uploadFileInS3method was not setting the requiredContent-MD5header that AWS mandates for uploads to Object Lock-enabled buckets to ensure data integrity.Solution:
uploadFileInS3method to calculate MD5 checksum of file payloadContent-MD5header inObjectMetadatausing Base64-encoded MD5 hashFixes #41240
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/17908934321
Commit: e2577b1
Cypress dashboard.
Tags:
@tag.SanitySpec:
Mon, 22 Sep 2025 09:22:02 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
Bug Fixes
Tests