Skip to content

[PM-40519] feat: Add passkey cipher storage and identity foundation to TestHarness - #2977

Open
morganzellers-bw wants to merge 1 commit into
mainfrom
pm-40519-testharness-passkeys-storage-foundation
Open

[PM-40519] feat: Add passkey cipher storage and identity foundation to TestHarness#2977
morganzellers-bw wants to merge 1 commit into
mainfrom
pm-40519-testharness-passkeys-storage-foundation

Conversation

@morganzellers-bw

@morganzellers-bw morganzellers-bw commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-40519

📔 Objective

Adds the persistence and data-model foundation for passkey test scenarios in the TestHarness, split from PR #2945 for size.

  • CipherStorageService persists SDK-encrypted ciphers across app relaunches, backed by UserDefaults.
  • StoredCipher is a Codable mirror of the handful of Cipher/Fido2Credential fields these scenarios populate, since BitwardenSdk.Cipher isn't itself Codable.
  • SyntheticIdentity/PasskeyKeychainItem model the throwaway identity persisted in the Keychain so the same crypto keys survive relaunches.
  • PasskeyError and supporting fixtures round out the layer.
  • No Fido2/SDK-client orchestration yet; PR [PM-40519] feat: Add SDK-backed passkey registration and assertion services to TestHarness #2945 builds the Fido2CredentialStore/Fido2UserInterface/PasskeyService layer on top of this.

Stack: #2977#2945#2946#2947#2948

@morganzellers-bw morganzellers-bw added app:password-manager Bitwarden Password Manager app context ai-review Request a Claude code review labels Aug 18, 2026
@morganzellers-bw
morganzellers-bw requested a review from a team as a code owner August 18, 2026 17:16
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds the persistence and data-model foundation for SDK-backed passkey scenarios in the Test Harness: a UserDefaults-backed CipherStorageService, a Codable StoredCipher mirror of BitwardenSdk.Cipher, SyntheticIdentity/PasskeyKeychainItem models, PasskeyError, SDK fixtures, and the XcodeGen/Sourcery wiring to link BitwardenSdk into TestHarnessShared. I reviewed the storage round-trip logic, the lossy-by-design Cipher reconstruction, keychain item protection level, secret handling, target/dependency configuration, and test coverage.

Secret handling looks correct for this context: only SDK ciphertext (Cipher.key, Fido2Credential.keyValue) lands in UserDefaults, while the synthetic identity material is modeled as a keychain item with kSecAttrAccessibleWhenUnlockedThisDeviceOnly. The lossy fields dropped by StoredCipher (notes, collectionIds, attachments, data, extra Fido2 credentials) are documented and match the fixed defaults these scenarios create, and both the nil-returning guards and the JSON round-trip are covered by tests.

Code Review Details

No findings.

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.50%. Comparing base (f4b4283) to head (4d77e40).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2977   +/-   ##
=======================================
  Coverage   79.50%   79.50%           
=======================================
  Files        1169     1169           
  Lines       75028    75028           
=======================================
+ Hits        59650    59652    +2     
+ Misses      15378    15376    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@morganzellers-bw
morganzellers-bw force-pushed the pm-40519-testharness-passkeys-storage-foundation branch 2 times, most recently from e1a5d73 to e3f6aa9 Compare August 19, 2026 14:12
Introduces the persistence and data-model layer for the SDK-backed
passkey scenarios: a UserDefaults-backed cipher store, its Codable
mirror of the SDK's Cipher/Fido2Credential shape, the synthetic
identity model, keychain item, and supporting errors/fixtures. This
is the foundation the Fido2-driving services (registration,
assertion, credential listing) build on top of in a follow-up PR.
@morganzellers-bw
morganzellers-bw force-pushed the pm-40519-testharness-passkeys-storage-foundation branch from e3f6aa9 to 4d77e40 Compare August 20, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant