[PM-40237] Require cipher Name only when Data is absent - #8252
Conversation
Blob-encrypted ciphers carry all content in Data, so Name goes unused. The unconditional [Required] attribute forced clients to send a placeholder encrypted empty string. Move the check into IValidatableObject and key it off Cipher.IsDataBlobEncrypted, since Data is also populated for non-blob ciphers.
330a4dc to
a73cd57
Compare
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR drops the unconditional Code Review DetailsNo findings. The XML doc comment defect flagged in the previous review round (dangling |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #8252 +/- ##
==========================================
- Coverage 68.88% 63.21% -5.68%
==========================================
Files 2410 2410
Lines 104442 104450 +8
Branches 9457 9458 +1
==========================================
- Hits 71946 66026 -5920
- Misses 30115 36165 +6050
+ Partials 2381 2259 -122 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-40237 Server counterpart: bitwarden/server#8252 ## 📔 Objective Blob-encrypted ciphers keep all content in the blob, but the server required a non-empty `Name` on cipher requests, so `encrypt_blob_cipher_with_wrapping_key` emitted an encrypted empty string as a placeholder. The server now requires `Name` only for non-blob ciphers, so send `None` and drop the TODOs. Depends on the server change being deployed first. ## 🚨 Breaking Changes None to the client interface.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-40237
SDK counterpart: bitwarden/sdk-internal#1408
📔 Objective
Blob-encrypted ciphers carry all their content in
Data, soNamegoes unused. The unconditional[Required]attribute onCipherRequestModel.Nameforced clients (and the SDK) to send a placeholder encrypted empty string.Nameis now validated viaIValidatableObject, keyed offCipher.IsDataBlobEncrypted(): required for every format except blob encryption. NoteDatais populated for non-blob ciphers too. No change for existing clients.