Skip to content

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

Open
derranW26 wants to merge 2 commits 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 2 commits 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 5 times, most recently 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

@kaustubhbitgo kaustubhbitgo removed their request for review April 28, 2026 05:07
@derranW26 derranW26 requested a review from a team as a code owner April 28, 2026 15:11
@derranW26 derranW26 force-pushed the WCN-187-passkey-types branch from 0d06994 to 1ccb3cc Compare April 28, 2026 15:13
…rf helpers

- WebAuthnOtpDevice: imported from @bitgo/public-types@6.1.0 (id, credentialId, prfSalt?)
- PasskeyAuthResult: stays local (ArrayBuffer not encodable in io-ts)
- WebAuthnProvider: create() -> PublicKeyCredential, get() -> PasskeyAuthResult
- buildEvalByCredential: returns { evalByCredential, credIdToDevice }, skips no-prfSalt devices
- matchDeviceByCredentialId: uses credIdToDevice map, throws retail error message
- export * from './passkey' added to bitgo/index.ts barrel
- unit tests: 8 cases covering happy path, empty list, prfSalt skip, and error message

TICKET: WCN-187
@derranW26 derranW26 force-pushed the WCN-187-passkey-types branch from 5a83949 to b8ee544 Compare April 28, 2026 15:27
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