Fix/issue 1233
Type of Change
- [ ] New Feature
- [x] Bug Fix
- [ ] Documentation
- [ ] Performance Improvement
- [x] Test/CI
- [ ] Refactor
- [ ] Other:
Related Issues
Fixes #1233
Summary of Changes
This PR addresses an issue where uploading objects larger than 17MB (triggering multipart upload) with checksums to a Vault KMS backend would fail with "Decrypt not fully implemented for Vault backend".
The changes include:
- Implemented
decryptfor Vault Backend: Implemented the missingdecryptmethod incrates/kms/src/backends/vault.rs. Since the current Vault backend implementation uses a simplified non-secure approach (base64 encoding) forgenerate_data_key, thedecryptmethod was implemented as an identity operation (returning the ciphertext as plaintext) to maintain consistency. - Updated
encryptfor Consistency: Updated theencryptmethod incrates/kms/src/backends/vault.rsto also act as an identity operation, ensuring symmetry withdecryptandgenerate_data_key. - Added Tests:
- Added a unit test
test_vault_decrypt_offlineincrates/kms/src/backends/vault.rsto verify the decrypt logic. - Added an end-to-end test
test_vault_large_file_upload_with_checksumincrates/e2e_test/src/kms/kms_vault_test.rsto reproduce the reported issue and verify the fix.
- Added a unit test
Checklist
- [x] I have read and followed the CONTRIBUTING.md guidelines
- [x] Passed
make pre-commit - [x] Added/updated necessary tests
- [ ] Documentation updated (if needed)
- [ ] CI/CD passed (if applicable)
Impact
- [ ] Breaking change (compatibility)
- [ ] Requires doc/config/deployment update
- [ ] Other impact:
Additional Notes
The current Vault backend implementation in rustfs appears to be a simplified version for development/testing (using base64 instead of actual Vault transit encryption for data keys). This fix aligns with that existing design pattern to resolve the immediate crash. A future refactor should address the security of the Vault backend implementation comprehensively.
Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.