ChallengeRecord
A single-use, expiring WebAuthn challenge, bound to a ceremony (and, for registration, to the target actor). The challenge bytes are the secret the ceremony proves knowledge of, so they follow the secret-bearing contract: private, redacted in dumps, non-serializable, non-clonable, one `value()` exit. Compared in constant time. A {@see Contracts\ChallengeStore} holds it; the host store enforces single use.
ChallengeRecord::__construct()
public function __construct(string $id, string $challenge, Milpa\Auth\WebAuthn\CeremonyType $ceremonyType, DateTimeImmutable $issuedAt, int $ttlSeconds, ?string $actorId = null):Parameters
| Name | Type | Description |
|---|---|---|
| $id | string | |
| $challenge | string | |
| $ceremonyType | Milpa\Auth\WebAuthn\CeremonyType | |
| $issuedAt | DateTimeImmutable | |
| $ttlSeconds | int | |
| $actorId | ?string |
ChallengeRecord::value()
public function value(): stringThe one deliberate way to read the challenge bytes — for the verifier to match the ceremony.
ChallengeRecord::matches()
public function matches(string $candidate): boolWhether $candidate equals the challenge, compared in constant time (no early-exit leak).
Parameters
| Name | Type | Description |
|---|---|---|
| $candidate | string |
ChallengeRecord::isExpired()
public function isExpired(DateTimeImmutable $now): boolWhether this challenge has expired as of $now (issuedAt + ttl). Fail-closed: expired ⇒ unusable.
Parameters
| Name | Type | Description |
|---|---|---|
| $now | DateTimeImmutable |
ChallengeRecord::__debugInfo()
public function __debugInfo(): arrayReturns
redacted for safe dumping
ChallengeRecord::__serialize()
public function __serialize(): arrayChallengeRecord::__clone()
public function __clone(): void