Skip to content

feat(passkey-crypto): add registerPasskey()#8637

Merged
derranW26 merged 1 commit intomasterfrom
passkey/ticket-3-register-passkey
May 6, 2026
Merged

feat(passkey-crypto): add registerPasskey()#8637
derranW26 merged 1 commit intomasterfrom
passkey/ticket-3-register-passkey

Conversation

@derranW26
Copy link
Copy Markdown
Contributor

@derranW26 derranW26 commented Apr 27, 2026

https://linear.app/bitgo/issue/WCN-188/implement-registerpasskey

Summary

  • Adds registerPasskey() to @bitgo/sdk-core — registers a passkey at the BitGo account level
  • Types (WebAuthnOtpDevice, WebAuthnProvider, PasskeyAuthResult, PasskeyGetOptions) are re-exported from @bitgo/passkey-crypto (no local stubs)
  • Exports the new passkey module from sdk-core/src/bitgo/index.ts
  • Updates Dockerfile to include @bitgo/passkey-crypto

Flow

  1. GET /api/v2/user/otp/webauthn/register — fetch server challenge (contains baseSalt)
  2. provider.create() — browser returns attestation
  3. If PRF output present → include scopes: ['prf'] in PUT payload; otherwise omit
  4. PUT /api/v2/user/otp — register the passkey
  5. Returns WebAuthnOtpDevice & { prfSupported: boolean }

Acceptance criteria

  • baseSalt sourced from server challenge — never generated client-side
  • Calls GET before provider.create()
  • PRF output → scopes included; no PRF → scopes omitted
  • Returns prfSupported: boolean
  • Uses PUT — not POST
  • No any types
  • Unit tests cover both PRF branches + call ordering

Test plan

  • Unit tests cover PRF-present branch (scopes included, prfSupported: true)
  • Unit tests cover PRF-absent branch (scopes omitted, prfSupported: false)
  • Unit test asserts GET challenge fires before provider.create()

TICKET: WCN-188

@derranW26 derranW26 force-pushed the passkey/ticket-3-register-passkey branch from c4920f4 to decca2c Compare April 28, 2026 14:39
@derranW26 derranW26 changed the base branch from passkey/ticket-1-passkey-crypto-package to master April 28, 2026 14:39
@derranW26 derranW26 force-pushed the passkey/ticket-3-register-passkey branch from decca2c to 3c9f1e8 Compare May 4, 2026 14:34
@derranW26 derranW26 changed the title feat(sdk-core): add registerPasskey function feat(sdk-core): add registerPasskey() May 4, 2026
@derranW26 derranW26 force-pushed the passkey/ticket-3-register-passkey branch 5 times, most recently from 7de643a to d25cc70 Compare May 4, 2026 15:28
@derranW26 derranW26 marked this pull request as ready for review May 4, 2026 15:52
@derranW26 derranW26 requested review from a team as code owners May 4, 2026 15:52
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 4, 2026

@derranW26
Copy link
Copy Markdown
Contributor Author

@claude review this pr

@derranW26 derranW26 closed this May 4, 2026
@derranW26 derranW26 reopened this May 4, 2026
@derranW26 derranW26 force-pushed the passkey/ticket-3-register-passkey branch 7 times, most recently from ef5ae08 to 55613a8 Compare May 4, 2026 22:20
Comment thread modules/passkey-crypto/src/registerPasskey.ts Outdated
Comment thread modules/passkey-crypto/src/registerPasskey.ts Outdated
@derranW26 derranW26 changed the title feat(sdk-core): add registerPasskey() feat(passkey-crypto): add registerPasskey() May 5, 2026
@derranW26 derranW26 force-pushed the passkey/ticket-3-register-passkey branch from 55613a8 to a943cdf Compare May 5, 2026 17:35
@derranW26 derranW26 merged commit d8a32c5 into master May 6, 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.

2 participants