Skip to content

feat(auth-emulator): Add mock Passkey (WebAuthn) support - #10609

Merged
macastelaz merged 7 commits into
firebase:passkey-auth-emulatorfrom
macastelaz:feat-auth-emulator-passkey
Jun 11, 2026
Merged

macastelaz merged 7 commits into
firebase:passkey-auth-emulatorfrom
macastelaz:feat-auth-emulator-passkey

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Description

Add support to the auth emulator for the passkey API surface. Passkey support is currently in "private preview" on a feature branch of the firebase web auth SDK (https://github.com/firebase/firebase-js-sdk/tree/passkey) and we are working towards a beta release which will involve updating the auth quickstart that in turn relies on the auth emulator.

Scenarios Tested

Using a locally modified quickstart version with passkey support pointing at a locally running auth emulator with these changes (https://screenshot.googleplex.com/3EbEZapL5Ax8o8h.png) I manually verified:

  • Sign in with passkey
  • Enrolling a passkey
  • Unerolling a passkey
  • Getting passkeys enrolled for a user

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces passkey support to the Auth emulator. It adds passkey enrollment and sign-in operations, updates the OpenAPI spec generation scripts, and implements the corresponding backend emulator logic in operations.ts and state.ts. Feedback on the changes suggests improving type safety by avoiding any casts when parsing authenticator responses and avoiding the non-null assertion operator (!) when filtering passkeys to delete.

Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/operations.ts Resolved
@macastelaz
macastelaz force-pushed the feat-auth-emulator-passkey branch from ec1aa42 to 12e0f15 Compare June 9, 2026 19:44
@codecov-commenter

codecov-commenter commented Jun 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.47826% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@88339cf). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/emulator/auth/operations.ts 93.33% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10609   +/-   ##
=======================================
  Coverage        ?   57.49%           
=======================================
  Files           ?      603           
  Lines           ?    38534           
  Branches        ?     7755           
=======================================
  Hits            ?    22156           
  Misses          ?    14583           
  Partials        ?     1795           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

},
type: "object",
},
emailPrivacyConfig: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems new/possibly unrelated to the Passkey support. Just want to double check that it ought to be here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Odd - I'm honestly not sure how this snuck in. Thanks for catching it and flagging it. It has been removed in #10636

Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/operations.ts Resolved
Comment thread src/emulator/auth/state.ts Resolved
Comment thread src/emulator/auth/state.ts Resolved
@macastelaz
macastelaz changed the base branch from main to passkey-auth-emulator June 11, 2026 21:40
@macastelaz
macastelaz merged commit 78fcf97 into firebase:passkey-auth-emulator Jun 11, 2026
47 checks passed
macastelaz added a commit that referenced this pull request Jun 12, 2026
* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <[email protected]>
macastelaz added a commit that referenced this pull request Jun 12, 2026
* feat(auth-emulator): Add mock Passkey (WebAuthn) support (#10609)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <[email protected]>

* Address PR review comments

* Fix TS conversion error by using assertion function for BlockingFunctionsJwtPayload

* Trigger CLA check

* Do not allow duplicate credentialIds

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* perf(auth-emulator): optimize duplicate credential checks and sign-in lookups

---------

Co-authored-by: Joe Hanley <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
bkendall pushed a commit that referenced this pull request Jul 9, 2026
* feat(auth-emulator): Add mock Passkey (WebAuthn) support (#10609)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <[email protected]>

* Address PR review comments

* Fix TS conversion error by using assertion function for BlockingFunctionsJwtPayload

* Trigger CLA check

* Do not allow duplicate credentialIds

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* perf(auth-emulator): optimize duplicate credential checks and sign-in lookups

---------

Co-authored-by: Joe Hanley <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
bkendall pushed a commit that referenced this pull request Jul 9, 2026
* feat(auth-emulator): Add mock Passkey (WebAuthn) support (#10609)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <[email protected]>

* Address PR review comments

* Fix TS conversion error by using assertion function for BlockingFunctionsJwtPayload

* Trigger CLA check

* Do not allow duplicate credentialIds

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* perf(auth-emulator): optimize duplicate credential checks and sign-in lookups

---------

Co-authored-by: Joe Hanley <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
yuichi0301 pushed a commit to yuichi0301/firebase-tools that referenced this pull request Aug 16, 2026
)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support (firebase#10609)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <[email protected]>

* Address PR review comments

* Fix TS conversion error by using assertion function for BlockingFunctionsJwtPayload

* Trigger CLA check

* Do not allow duplicate credentialIds

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* perf(auth-emulator): optimize duplicate credential checks and sign-in lookups

---------

Co-authored-by: Joe Hanley <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

5 participants