feat(passkey-crypto): WCN-195 integration tests and complete package exports#8701
Merged
feat(passkey-crypto): WCN-195 integration tests and complete package exports#8701
Conversation
d891fa1 to
b912d7b
Compare
mmcshinsky-bitgo
approved these changes
May 6, 2026
Contributor
mmcshinsky-bitgo
left a comment
There was a problem hiding this comment.
Really thorough integration coverage — glad to see the wrong-passphrase and no-DEL ordering invariants pinned down.
ranga-r2
approved these changes
May 7, 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
b912d7b to
941dd67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/integration/passkeyLifecycle.test.tswith 5 focused integration test suites covering the full passkey lifecycle end-to-endfixtures.ts,mockBitGo.ts(stateful stub with real sjcl encrypt/decrypt),mockProvider.ts(deterministic WebAuthn provider)attachPasskeyToWalletandderivePasskeyPrfKeyfromsrc/index.ts(these were added in prior tickets but not exported)integration-testscript topackage.json@bitgo/wasm-mps@1.8.1transitive dep (required for sdk-core barrel to load)Integration test coverage
register → attachregisterPasskeyoutput feeds intoattachPasskeyToWallet; private key round-trips through PRF-derived password;prfSaltis valid base64urlattach → derivePasskeyPrfKeywebauthnDevicesto keychain,derivePasskeyPrfKeyreads them and returns the same passphrase; round-trip decryption proves itfull lifecycle/webauthndeviceand/user/otp) are hitPRF salt wiringattachPasskeyToWalletpassesderiveEnterpriseSalt(baseSalt, enterpriseId)as the eval salt inprovider.get()error propagationremovePasskeyFromWalletuses real sjcl — genuinely failsdecryptKeychainPrivateKeyand aborts before DELTest plan
npm run unit-test— 47 passingnpm run integration-test— 52 passing