Skip to content
docsv0.9.0

WebAuthnCredentialStore

The registry of registered passkeys — the WebAuthn public-key store. Mirrors {@see \Milpa\Auth\Contracts\SessionStore}: the leaf declares WHAT it needs, the host implements HOW (Doctrine, etc.). Two invariants the contract REQUIRES and the implementation MUST enforce: global `credentialId` uniqueness (usernameless login resolves a user by credential id alone), and that `updateSignCount` records the latest counter — which is a clone-detection SIGNAL, never an authorization gate.

WebAuthnCredentialStore::save()

abstract public function save(Milpa\Auth\WebAuthn\WebAuthnCredentialRecord $record): void

Persist a newly registered credential. MUST reject a duplicate credentialId (global uniqueness).

Parameters

Parameters of save()
NameTypeDescription
$recordMilpa\Auth\WebAuthn\WebAuthnCredentialRecord

WebAuthnCredentialStore::findByCredentialId()

abstract public function findByCredentialId(string $credentialId): ?Milpa\Auth\WebAuthn\WebAuthnCredentialRecord

The credential with this id, or null if unknown (the usernameless/discoverable lookup).

Parameters

Parameters of findByCredentialId()
NameTypeDescription
$credentialIdstring

WebAuthnCredentialStore::listForActor()

abstract public function listForActor(string $actorId): array

The actor's credentials — builds a ceremony's allowCredentials.

Parameters

Parameters of listForActor()
NameTypeDescription
$actorIdstring

WebAuthnCredentialStore::updateSignCount()

abstract public function updateSignCount(string $credentialId, int $signCount): void

Record the latest sign counter for a credential after an assertion (a signal, not a gate).

Parameters

Parameters of updateSignCount()
NameTypeDescription
$credentialIdstring
$signCountint