PasskeyCredentialStore
PasskeyCredentialStore
Passkeys stored in a JSON file, for tests and small applications.
class PasskeyCredentialStore implements \Hazaar\Auth\Interface\PasskeyCredentialStoreImplements: Hazaar\Auth\Interface\PasskeyCredentialStore
Every lookup reads the whole file, so it suits a modest number of passkeys. Reads take a shared lock and writes an exclusive one for the whole read-change-write, so concurrent requests can't lose each other's changes. The file is created with 0600 permissions.
Properties
file
private string $fileType: string
Methods
__construct
public __construct(array|Options $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$config | array | Hazaar\Auth\Store\File\PasskeyCredentialStore\Options |
findById
public findById(string $credentialId): ?PasskeyCredentialReturns: Hazaar\Auth\WebAuthn\PasskeyCredential
Parameters
| Parameter | Type | Description |
|---|---|---|
$credentialId | string |
findByIdentity
public findByIdentity(string $identity): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
findIdentityByUserHandle
public findIdentityByUserHandle(string $userHandle): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$userHandle | string |
getUserHandle
public getUserHandle(string $identity): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
save
public save(PasskeyCredential $credential): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$credential | Hazaar\Auth\WebAuthn\PasskeyCredential |
recordUse
public recordUse(string $credentialId, int $signCount, bool $backupState, int $usedAt): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$credentialId | string | |
$signCount | int | |
$backupState | bool | |
$usedAt | int |
rename
public rename(string $identity, string $credentialId, string $name): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$credentialId | string | |
$name | string |
delete
public delete(string $identity, string $credentialId): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$credentialId | string |
read
private read(): arrayReturns: array
modify
Runs a change under an exclusive lock, and writes the file if the change reports that it changed something.
private modify(callable $change): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$change | callable |
decode
private decode(string $json): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$json | string |
Generated by Hazaar API Doc Generator on Wed, 28 Oct 2026 08:43:30 +0000