Skip to content

feat(passkey-crypto): WCN-195 integration tests and complete package exports#8701

Merged
derranW26 merged 1 commit intomasterfrom
WCN-195/passkey-integration-tests
May 7, 2026
Merged

feat(passkey-crypto): WCN-195 integration tests and complete package exports#8701
derranW26 merged 1 commit intomasterfrom
WCN-195/passkey-integration-tests

Conversation

@derranW26
Copy link
Copy Markdown
Contributor

Summary

  • Adds test/integration/passkeyLifecycle.test.ts with 5 focused integration test suites covering the full passkey lifecycle end-to-end
  • Adds test helpers: fixtures.ts, mockBitGo.ts (stateful stub with real sjcl encrypt/decrypt), mockProvider.ts (deterministic WebAuthn provider)
  • Exports attachPasskeyToWallet and derivePasskeyPrfKey from src/index.ts (these were added in prior tickets but not exported)
  • Adds integration-test script to package.json
  • Installs missing @bitgo/wasm-mps@1.8.1 transitive dep (required for sdk-core barrel to load)

Integration test coverage

Suite What it uniquely verifies
register → attach registerPasskey output feeds into attachPasskeyToWallet; private key round-trips through PRF-derived password; prfSalt is valid base64url
attach → derivePasskeyPrfKey After attach writes webauthnDevices to keychain, derivePasskeyPrfKey reads them and returns the same passphrase; round-trip decryption proves it
full lifecycle All 5 functions chained with shared state; both DEL endpoints (/webauthndevice and /user/otp) are hit
PRF salt wiring attachPasskeyToWallet passes deriveEnterpriseSalt(baseSalt, enterpriseId) as the eval salt in provider.get()
error propagation Wrong passphrase on removePasskeyFromWallet uses real sjcl — genuinely fails decryptKeychainPrivateKey and aborts before DEL

Test plan

  • npm run unit-test — 47 passing
  • npm run integration-test — 52 passing

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 6, 2026

@derranW26 derranW26 force-pushed the WCN-195/passkey-integration-tests branch from d891fa1 to b912d7b Compare May 6, 2026 19:38
@derranW26 derranW26 marked this pull request as ready for review May 6, 2026 20:51
@derranW26 derranW26 requested review from a team as code owners May 6, 2026 20:51
Copy link
Copy Markdown
Contributor

@mmcshinsky-bitgo mmcshinsky-bitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really thorough integration coverage — glad to see the wrong-passphrase and no-DEL ordering invariants pinned down.

@mmcshinsky-bitgo mmcshinsky-bitgo self-assigned this May 6, 2026
- Add test/integration/passkeyLifecycle.test.ts with 5 describe blocks
  covering register→attach, attach→derive, full lifecycle, PRF salt
  wiring, and error propagation
- Add test/integration/helpers/ (fixtures, mockBitGo, mockProvider)
- Export attachPasskeyToWallet and derivePasskeyPrfKey from index.ts
- Add integration-test script to package.json
- Add sjcl to devDependencies (used directly in mockBitGo for real
  encrypt/decrypt — same underlying library as bitgo.encrypt/decrypt)

TICKET: WCN-195
@derranW26 derranW26 force-pushed the WCN-195/passkey-integration-tests branch from b912d7b to 941dd67 Compare May 7, 2026 15:14
@derranW26 derranW26 merged commit e1a3022 into master May 7, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants