2026-04-20 10:26:22 +00:00
|
|
|
import type { IPassportCapabilities } from './passportdevice.js';
|
|
|
|
|
|
|
|
|
|
export type TPassportChallengeType =
|
|
|
|
|
| 'device_enrollment'
|
|
|
|
|
| 'authentication'
|
|
|
|
|
| 'step_up'
|
|
|
|
|
| 'physical_access';
|
|
|
|
|
|
|
|
|
|
export type TPassportChallengeStatus = 'pending' | 'approved' | 'expired' | 'rejected';
|
|
|
|
|
|
|
|
|
|
export type TPassportChallengeDeliveryStatus = 'pending' | 'sent' | 'failed' | 'seen';
|
|
|
|
|
|
|
|
|
|
export type TPassportSignatureFormat = 'raw' | 'der';
|
|
|
|
|
|
|
|
|
|
export interface IPassportLocationEvidence {
|
|
|
|
|
latitude: number;
|
|
|
|
|
longitude: number;
|
|
|
|
|
accuracyMeters: number;
|
|
|
|
|
capturedAt: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IPassportNfcEvidence {
|
|
|
|
|
tagId?: string;
|
|
|
|
|
readerId?: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-20 13:21:28 +00:00
|
|
|
export interface IPassportLocationPolicy {
|
|
|
|
|
mode: 'geofence';
|
|
|
|
|
label?: string;
|
|
|
|
|
latitude: number;
|
|
|
|
|
longitude: number;
|
|
|
|
|
radiusMeters: number;
|
|
|
|
|
maxAccuracyMeters?: number;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-20 10:26:22 +00:00
|
|
|
export interface IPassportChallenge {
|
|
|
|
|
id: string;
|
|
|
|
|
data: {
|
|
|
|
|
userId: string;
|
|
|
|
|
deviceId?: string | null;
|
|
|
|
|
type: TPassportChallengeType;
|
|
|
|
|
status: TPassportChallengeStatus;
|
|
|
|
|
tokenHash?: string | null;
|
|
|
|
|
challenge: string;
|
|
|
|
|
metadata: {
|
|
|
|
|
originHost?: string;
|
|
|
|
|
audience?: string;
|
|
|
|
|
notificationTitle?: string;
|
|
|
|
|
deviceLabel?: string;
|
|
|
|
|
requireLocation: boolean;
|
|
|
|
|
requireNfc: boolean;
|
2026-04-20 13:21:28 +00:00
|
|
|
locationPolicy?: IPassportLocationPolicy;
|
2026-04-20 10:26:22 +00:00
|
|
|
requestedCapabilities?: Partial<IPassportCapabilities>;
|
|
|
|
|
};
|
|
|
|
|
evidence?: {
|
|
|
|
|
signatureFormat?: TPassportSignatureFormat;
|
|
|
|
|
location?: IPassportLocationEvidence;
|
2026-04-20 13:21:28 +00:00
|
|
|
locationEvaluation?: {
|
|
|
|
|
matched: boolean;
|
|
|
|
|
distanceMeters?: number;
|
|
|
|
|
accuracyAccepted?: boolean;
|
|
|
|
|
evaluatedAt: number;
|
|
|
|
|
reason?: string;
|
|
|
|
|
};
|
2026-04-20 10:26:22 +00:00
|
|
|
nfc?: IPassportNfcEvidence;
|
|
|
|
|
};
|
|
|
|
|
notification?: {
|
|
|
|
|
hintId: string;
|
|
|
|
|
status: TPassportChallengeDeliveryStatus;
|
|
|
|
|
attemptCount: number;
|
|
|
|
|
createdAt: number;
|
|
|
|
|
deliveredAt?: number | null;
|
|
|
|
|
seenAt?: number | null;
|
|
|
|
|
lastError?: string | null;
|
|
|
|
|
};
|
|
|
|
|
createdAt: number;
|
|
|
|
|
expiresAt: number;
|
|
|
|
|
completedAt?: number | null;
|
|
|
|
|
};
|
|
|
|
|
}
|