Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Webauthn Emulator Laravel Package

pronin/webauthn-emulator

A PHP library that emulates WebAuthn authenticators for testing: generate attestation and assertion responses, simulate security keys, and exercise registration and login flows in Laravel and plain PHP test suites without hardware.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What the package is. pronin/webauthn-emulator is not a Laravel package and not a runtime authentication component. It is a framework-agnostic PHP test double that constructs WebAuthn ceremony artifacts — client data, authenticator data, attestation objects, and signed assertions — so a relying party's registration and authentication endpoints can be exercised without physical YubiKeys, Touch ID, or Windows Hello hardware. There is no service provider, facade, config file, or migration.

Architecture fit. It belongs in the verification layer of a WebAuthn relying party, alongside (not instead of) a server-side library such as web-auth/webauthn-lib. It substitutes for the authenticator, not the verifier. That makes it a require-dev concern living under tests/, consumed by feature tests that POST to your /webauthn/register and /webauthn/login endpoints. It does not remove the need for at least one real-browser, real-authenticator end-to-end check per release, because emulator-generated artifacts bypass the JS navigator.credentials path entirely.

Integration feasibility. Low effort on the surface: MIT license, Composer-installable, PSR-4 autoloading, no infrastructure. The real work is alignment — matching its supported attestation statement formats (none, packed, fido-u2f, TPM, Android Key) and COSE algorithms (ES256, RS256, EdDSA) to what your verifier actually accepts, and to the PHP/OpenSSL versions in CI.

Technical risk. Production risk is effectively zero — it never enters a request path. The risks are contained to test integrity:

  • Shared-assumption blind spot. If the emulator and your verifier were both written against the same misreading of the spec, tests pass and production fails. This is the dominant risk with any emulator.
  • Bus factor. One maintainer, 5 stars, 0 dependents, composite score 0.085. There is essentially no community validation. Treat it as a vendored internal tool, not a community-standard dependency.
  • Version drift. Compatibility with your WebAuthn verifier's major version is unverified and must be proven, not assumed.

Key questions. Does it support the specific attestation formats and algorithms our verifier enforces? Which PHP versions are supported, and do they cover our matrix? Can it deliberately produce invalid artifacts (bad signature, wrong origin, wrong rpId, regressed sign counter, replayed challenge) — negative testing is where most of the value is? Does it emulate platform authenticators distinctly from roaming ones, including the uv/up flag combinations we branch on? Is the repo actively released, and what is the last commit date relative to our web-auth/webauthn-lib pin? Does it emit CBOR that round-trips through the same decoder we use in production?

Integration Approach

Stack fit. Laravel 9/10/11 are all fine provided the PHP constraint matches; there is nothing Laravel-specific to wire up. Install with composer require --dev pronin/webauthn-emulator, pin an exact version (not a caret range) in composer.lock, and keep it out of the production image build.

Migration path. If the team currently maintains hand-written attestation JSON fixtures or recorded ceremony payloads, replace them incrementally rather than wholesale: introduce the emulator for new test cases first, keep existing fixtures green, and retire them once parity is demonstrated. Preserve at least one genuine browser-driven test as a permanent canary.

Compatibility. Pin the emulator to the same web-auth/webauthn-lib major version in use, and verify OpenSSL, gmp/bcmath, and sodium extensions are present in every CI image. Validate against the oldest and newest PHP in the support matrix before merging.

Sequencing.

  1. Spike on a throwaway branch: generate one registration attestation and one authentication assertion, feed them to the existing verifier.
  2. Codify a thin internal adapter — a WebAuthnEmulatorFactory test helper wrapping the library — so the vendor package is referenced from exactly one place.
  3. Add negative-path coverage: origin mismatch, rpId mismatch, sign-counter regression, expired challenge, tampered signature.
  4. Add a make:test-style generator or shared trait so product engineers don't hand-assemble ceremony objects.
  5. Only then remove legacy fixtures.

Operational Impact

Maintenance. No runtime maintenance, but this becomes load-bearing for CI: a broken transitive update blocks every PR touching auth. Own it explicitly — assign a named maintainer, review release notes on upgrade, and be prepared to fork and vendor into packages/ if the upstream goes quiet. Budget roughly a day per year for upgrade validation plus the initial ramp.

Support. No upstream support channel and no security process — which is acceptable precisely because it is never deployed. Internal ownership is the only support model; document the adapter's contract in the repo.

Scaling. No production scaling implications. Test-suite scaling is the only concern: per-test key generation is comparatively expensive, so generate keypairs once per test class where isolation permits, or cache deterministic fixtures for the happy path.

Failure modes.

  • Silent false pass — the highest-severity failure; emulator and verifier agree on a wrong assumption. Mitigate with the retained real-browser canary.
  • False failures on environment drift — OpenSSL or PHP minor bumps altering key/signature behavior in CI.
  • Abandonment — no patch available for a new attestation format or algorithm; resolution is a fork.
  • Coupling — tests written against emulator internals rather than HTTP endpoints, making a future swap expensive. The adapter layer is the guardrail.

Ramp-up. Engineers need working fluency in WebAuthn ceremony structure — clientDataJSON, authenticator data flags, CBOR-encoded attestation objects, challenge lifecycle. Estimate one to two days for a mid-level engineer already comfortable with the spec, materially more without it. Given the score and adoption signals, the defensible position is adopt with containment: acceptable as a tactical test accelerant behind a one-file adapter, not as a strategic dependency — and reassess against building minimal in-house fixtures if the surface area you actually need is small.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package