Skip to content

feat(sdk-core): WCN-187 add passkey types, webauthn provider interface, and prf helpers#8610

Open
derranW26 wants to merge 1 commit intomasterfrom
WCN-187-passkey-types
Open

feat(sdk-core): WCN-187 add passkey types, webauthn provider interface, and prf helpers#8610
derranW26 wants to merge 1 commit intomasterfrom
WCN-187-passkey-types

Conversation

@derranW26
Copy link
Copy Markdown
Contributor

Summary

  • Adds PasskeyDevice, PasskeyAuthResult, and WebAuthnProvider types to modules/sdk-core/src/bitgo/passkey/types.ts
  • Adds buildEvalByCredential — maps credId → prfSalt for WebAuthn PRF evalByCredential object
  • Adds matchDeviceByCredentialId — resolves a WebAuthn assertion's credential ID back to its PasskeyDevice, throws descriptively if not found
  • Unit tests for both PRF helpers (happy path + error cases)

Depends on

  • WCN-186 (@bitgo/passkey-crypto) must be merged first — downstream tickets (3–7) will use these types alongside derivePassword/deriveEnterpriseSalt from that package

Notes

  • WebAuthnProvider targets browser only (PublicKeyCredential types) — no Node.js or React Native
  • No any types

@linear
Copy link
Copy Markdown

linear Bot commented Apr 22, 2026

@derranW26 derranW26 marked this pull request as ready for review April 22, 2026 16:57
@derranW26 derranW26 requested review from a team as code owners April 22, 2026 16:57
@derranW26 derranW26 force-pushed the WCN-187-passkey-types branch 4 times, most recently from 7623c7d to b89ec3a Compare April 23, 2026 19:52
…rf helpers

- WebAuthnOtpDevice: registration-flow type with credID, fmt, publicKey, prfSalt?, encryptedPrv?
- PasskeyAuthResult: mirrors retail ChallengeFor2FAWithPrfResult exactly
- WebAuthnProvider: browser abstraction returning PublicKeyCredential | null
- buildEvalByCredential: takes KeychainWebauthnDevice[], reads authenticatorInfo.credID
- matchDeviceByCredentialId: takes KeychainWebauthnDevice[], throws with known IDs on miss
- export * from './passkey' added to bitgo/index.ts barrel
- unit tests: 7 cases covering happy path, empty list, and descriptive error content

TICKET: WCN-187
@derranW26 derranW26 force-pushed the WCN-187-passkey-types branch from b89ec3a to 29526ab Compare April 23, 2026 19:54
Copy link
Copy Markdown
Contributor

@alextse-bg alextse-bg left a comment

Choose a reason for hiding this comment

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

code changes lgtm, not sure I have enough context to review the type changes tho

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.

2 participants