e9eb9b4172
Enforce geofenced location evidence for passport challenges and extend admin alerting so mobile devices can review, dismiss, and act on real org and security events.
228 lines
5.8 KiB
TypeScript
228 lines
5.8 KiB
TypeScript
import * as plugins from '../plugins.js';
|
|
import * as data from '../data/index.js';
|
|
|
|
export interface IPassportDeviceSignedRequest {
|
|
deviceId: string;
|
|
timestamp: number;
|
|
nonce: string;
|
|
signatureBase64: string;
|
|
signatureFormat?: data.TPassportSignatureFormat;
|
|
}
|
|
|
|
export interface IReq_CreatePassportEnrollmentChallenge
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_CreatePassportEnrollmentChallenge
|
|
> {
|
|
method: 'createPassportEnrollmentChallenge';
|
|
request: {
|
|
jwt: string;
|
|
deviceLabel: string;
|
|
platform: data.TPassportDevicePlatform;
|
|
appVersion?: string;
|
|
capabilities?: Partial<data.IPassportCapabilities>;
|
|
};
|
|
response: {
|
|
challengeId: string;
|
|
pairingToken: string;
|
|
pairingPayload: string;
|
|
signingPayload: string;
|
|
expiresAt: number;
|
|
};
|
|
}
|
|
|
|
export interface IReq_CompletePassportEnrollment
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_CompletePassportEnrollment
|
|
> {
|
|
method: 'completePassportEnrollment';
|
|
request: {
|
|
pairingToken: string;
|
|
deviceLabel: string;
|
|
platform: data.TPassportDevicePlatform;
|
|
publicKeyX963Base64: string;
|
|
signatureBase64: string;
|
|
signatureFormat?: data.TPassportSignatureFormat;
|
|
appVersion?: string;
|
|
capabilities?: Partial<data.IPassportCapabilities>;
|
|
};
|
|
response: {
|
|
device: data.IPassportDevice;
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetPassportDevices
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_GetPassportDevices
|
|
> {
|
|
method: 'getPassportDevices';
|
|
request: {
|
|
jwt: string;
|
|
};
|
|
response: {
|
|
devices: data.IPassportDevice[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_RevokePassportDevice
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_RevokePassportDevice
|
|
> {
|
|
method: 'revokePassportDevice';
|
|
request: {
|
|
jwt: string;
|
|
deviceId: string;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
};
|
|
}
|
|
|
|
export interface IReq_CreatePassportChallenge
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_CreatePassportChallenge
|
|
> {
|
|
method: 'createPassportChallenge';
|
|
request: {
|
|
jwt: string;
|
|
type?: Exclude<data.TPassportChallengeType, 'device_enrollment'>;
|
|
preferredDeviceId?: string;
|
|
audience?: string;
|
|
notificationTitle?: string;
|
|
requireLocation?: boolean;
|
|
requireNfc?: boolean;
|
|
locationPolicy?: data.IPassportLocationPolicy;
|
|
};
|
|
response: {
|
|
challengeId: string;
|
|
challenge: string;
|
|
signingPayload: string;
|
|
deviceId: string;
|
|
expiresAt: number;
|
|
};
|
|
}
|
|
|
|
export interface IReq_ApprovePassportChallenge
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_ApprovePassportChallenge
|
|
> {
|
|
method: 'approvePassportChallenge';
|
|
request: {
|
|
challengeId: string;
|
|
deviceId: string;
|
|
signatureBase64: string;
|
|
signatureFormat?: data.TPassportSignatureFormat;
|
|
location?: data.IPassportLocationEvidence;
|
|
nfc?: data.IPassportNfcEvidence;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
challenge: data.IPassportChallenge;
|
|
};
|
|
}
|
|
|
|
export interface IReq_RejectPassportChallenge
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_RejectPassportChallenge
|
|
> {
|
|
method: 'rejectPassportChallenge';
|
|
request: IPassportDeviceSignedRequest & {
|
|
challengeId: string;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
challenge: data.IPassportChallenge;
|
|
};
|
|
}
|
|
|
|
export interface IReq_RegisterPassportPushToken
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_RegisterPassportPushToken
|
|
> {
|
|
method: 'registerPassportPushToken';
|
|
request: IPassportDeviceSignedRequest & {
|
|
provider: data.TPassportPushProvider;
|
|
token: string;
|
|
topic: string;
|
|
environment: data.TPassportPushEnvironment;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
};
|
|
}
|
|
|
|
export interface IReq_ListPendingPassportChallenges
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_ListPendingPassportChallenges
|
|
> {
|
|
method: 'listPendingPassportChallenges';
|
|
request: IPassportDeviceSignedRequest;
|
|
response: {
|
|
challenges: data.IPassportChallenge[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetPassportChallengeByHint
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_GetPassportChallengeByHint
|
|
> {
|
|
method: 'getPassportChallengeByHint';
|
|
request: IPassportDeviceSignedRequest & {
|
|
hintId: string;
|
|
};
|
|
response: {
|
|
challenge?: {
|
|
challenge: data.IPassportChallenge;
|
|
signingPayload: string;
|
|
};
|
|
};
|
|
}
|
|
|
|
export interface IReq_MarkPassportChallengeSeen
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_MarkPassportChallengeSeen
|
|
> {
|
|
method: 'markPassportChallengeSeen';
|
|
request: IPassportDeviceSignedRequest & {
|
|
hintId: string;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetPassportDashboard
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_GetPassportDashboard
|
|
> {
|
|
method: 'getPassportDashboard';
|
|
request: IPassportDeviceSignedRequest;
|
|
response: {
|
|
profile: {
|
|
userId: string;
|
|
name: string;
|
|
handle: string;
|
|
organizations: Array<{ id: string; name: string }>;
|
|
deviceCount: number;
|
|
recoverySummary: string;
|
|
};
|
|
devices: data.IPassportDevice[];
|
|
challenges: Array<{
|
|
challenge: data.IPassportChallenge;
|
|
signingPayload: string;
|
|
}>;
|
|
alerts: data.IAlert[];
|
|
};
|
|
}
|