-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
79 lines (73 loc) · 1.74 KB
/
Copy pathtypes.ts
File metadata and controls
79 lines (73 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
export enum HipPurpose {
CONCERT = 'concert',
EXAM = 'exam',
AIRPORT = 'airport-demo',
VOTING = 'voting-sim',
METAVERSE = 'metaverse',
UNIVERSAL_ACCESS = 'universal_access'
}
export enum EventCategory {
CONCERT = 'CONCERT',
CONFERENCE = 'CONFERENCE',
RESTRICTED = 'RESTRICTED_AREA',
TRANSPORT = 'PUBLIC_TRANSPORT',
SOCIAL = 'SOCIAL_GATHERING'
}
export interface HipEvent {
id: string;
name: string;
category: EventCategory;
createdAt: number;
status: 'OPEN' | 'CLOSED';
}
export interface HipTokenPayload {
hipId: string;
maskedHash: string; // The public-facing ID
purpose: HipPurpose;
issuedAt: number;
exp: number;
issuer: string;
nonce: string;
scope: string[];
meta: {
displayName: string;
avatarPreview: string; // Data URI for the photo
ip?: string;
location?: string;
audioData?: string; // Base64 audio string for voice auth
};
}
export interface SignedHipToken {
payload: HipTokenPayload;
signature: string; // Hex string of the signature
publicKey: JsonWebKey; // Public key to verify against (simulated PKI)
}
export interface LedgerEntry {
hipId: string;
identityHash: string; // Internal irreversible hash
maskedHash: string; // Public hash
issuer: string;
issuedAt: number;
exp: number;
revoked: boolean;
biometricVector?: number[]; // Simulation of stored vector (mock)
ip?: string;
location?: string;
audioData?: string; // Voice sample
avatarImage?: string; // High-res avatar for admin view
}
export interface VerificationResult {
isValid: boolean;
score: number;
checks: {
signature: boolean;
ledger: boolean;
expiry: boolean;
biometricMatch: boolean;
};
message: string;
meta?: {
location?: string;
ip?: string;
}
}