50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
|
|
export type TPasskeyCredentialStatus = 'active' | 'revoked';
|
||
|
|
|
||
|
|
export type TPasskeyChallengeType = 'registration' | 'login' | 'mfa';
|
||
|
|
|
||
|
|
export type TPasskeyChallengeStatus = 'pending' | 'completed' | 'expired';
|
||
|
|
|
||
|
|
export type TPasskeyTransport =
|
||
|
|
| 'ble'
|
||
|
|
| 'cable'
|
||
|
|
| 'hybrid'
|
||
|
|
| 'internal'
|
||
|
|
| 'nfc'
|
||
|
|
| 'smart-card'
|
||
|
|
| 'usb';
|
||
|
|
|
||
|
|
export type TPasskeyDeviceType = 'singleDevice' | 'multiDevice';
|
||
|
|
|
||
|
|
export interface IPasskeyCredential {
|
||
|
|
id: string;
|
||
|
|
data: {
|
||
|
|
userId: string;
|
||
|
|
label: string;
|
||
|
|
credentialId: string;
|
||
|
|
publicKeyBase64: string;
|
||
|
|
counter: number;
|
||
|
|
deviceType: TPasskeyDeviceType;
|
||
|
|
backedUp: boolean;
|
||
|
|
transports?: TPasskeyTransport[];
|
||
|
|
status: TPasskeyCredentialStatus;
|
||
|
|
createdAt: number;
|
||
|
|
lastUsedAt?: number | null;
|
||
|
|
revokedAt?: number | null;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IWebAuthnChallenge {
|
||
|
|
id: string;
|
||
|
|
data: {
|
||
|
|
userId?: string | null;
|
||
|
|
username?: string | null;
|
||
|
|
mfaChallengeId?: string | null;
|
||
|
|
type: TPasskeyChallengeType;
|
||
|
|
challenge: string;
|
||
|
|
status: TPasskeyChallengeStatus;
|
||
|
|
createdAt: number;
|
||
|
|
expiresAt: number;
|
||
|
|
completedAt?: number | null;
|
||
|
|
};
|
||
|
|
}
|