QA-2420: add OrganizationCardCipherScene to the seeder - #8294
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8294 +/- ##
==========================================
- Coverage 63.77% 63.76% -0.01%
==========================================
Files 2470 2470
Lines 105918 105918
Branches 9596 9596
==========================================
- Hits 67544 67543 -1
- Misses 36054 36055 +1
Partials 2320 2320 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1c3a2cf to
f020dcf
Compare
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Re-reviewed after the force-push; the changeset is now a single new file, Code Review DetailsNo findings. |
theMickster
left a comment
There was a problem hiding this comment.
The Claude Code Comment here is the one fix to the PR that we should make. Otherwise, I'm good with the code.
Adds a standalone OrganizationCardCipherScene that seeds an org-owned card cipher encrypted with the org key and assigned to the requested collections, mirroring UserCardCipherScene for card fields and OrganizationLoginCipherScene for owner resolution and collection-aware persistence. CardCipherSeeder is unchanged. Includes a factory unit test asserting org ownership and per-field org-key decryption.
f020dcf to
fd0eea4
Compare
🎟️ Tracking
QA-2420: https://bitwarden.atlassian.net/browse/QA-2420
📔 Objective
The seeder can create org-owned login ciphers but has no way to create an org-owned card cipher; card seeding exists user-side only. This blocks per-test seeding for the org ClientEvents card tests, whose cases view and edit a card in an org collection and need one already seeded. This adds
OrganizationCardCipherScene, mirroringUserCardCipherScenefor the card fields andOrganizationLoginCipherScenefor owner resolution and collection-aware persistence: it resolves the org, encrypts the card with the org key (OrganizationIdset,UserIdnull), and writes it to the requested collections throughCreateAsync(cipher, collectionIds).CardCipherSeederalready produces an org-key card, so it is unchanged. The reflection-based scene registration picks the scene up automatically by class name.Includes a factory unit test that seeds an org card with a generated org key and asserts ownership (
Cardtype,OrganizationIdset,UserIdnull) plus per-field decryption back to plaintext with the org key. Verified by a passing build (0 errors) and the code-review and security-review agent passes.