feat(reception): add passport device authentication flows and alert delivery management
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as data from '../data/index.js';
|
||||
import type { IPassportDeviceSignedRequest } from './passport.js';
|
||||
|
||||
export interface IReq_ListPassportAlerts
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_ListPassportAlerts
|
||||
> {
|
||||
method: 'listPassportAlerts';
|
||||
request: IPassportDeviceSignedRequest;
|
||||
response: {
|
||||
alerts: data.IAlert[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetPassportAlertByHint
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_GetPassportAlertByHint
|
||||
> {
|
||||
method: 'getPassportAlertByHint';
|
||||
request: IPassportDeviceSignedRequest & {
|
||||
hintId: string;
|
||||
};
|
||||
response: {
|
||||
alert?: data.IAlert;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_MarkPassportAlertSeen
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_MarkPassportAlertSeen
|
||||
> {
|
||||
method: 'markPassportAlertSeen';
|
||||
request: IPassportDeviceSignedRequest & {
|
||||
hintId: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpsertAlertRule
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_UpsertAlertRule
|
||||
> {
|
||||
method: 'upsertAlertRule';
|
||||
request: {
|
||||
jwt: string;
|
||||
ruleId?: string;
|
||||
scope: data.TAlertRuleScope;
|
||||
organizationId?: string;
|
||||
eventType: string;
|
||||
minimumSeverity: data.TAlertSeverity;
|
||||
recipientMode: data.TAlertRuleRecipientMode;
|
||||
recipientUserIds?: string[];
|
||||
push: boolean;
|
||||
enabled: boolean;
|
||||
};
|
||||
response: {
|
||||
rule: data.IAlertRule;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetAlertRules
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_GetAlertRules
|
||||
> {
|
||||
method: 'getAlertRules';
|
||||
request: {
|
||||
jwt: string;
|
||||
scope?: data.TAlertRuleScope;
|
||||
organizationId?: string;
|
||||
};
|
||||
response: {
|
||||
rules: data.IAlertRule[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteAlertRule
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteAlertRule
|
||||
> {
|
||||
method: 'deleteAlertRule';
|
||||
request: {
|
||||
jwt: string;
|
||||
ruleId: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
};
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
export * from './admin.js';
|
||||
export * from './apitoken.js';
|
||||
export * from './alert.js';
|
||||
export * from './app.js';
|
||||
export * from './authorization.js';
|
||||
export * from './billingplan.js';
|
||||
export * from './jwt.js';
|
||||
export * from './login.js';
|
||||
export * from './organization.js';
|
||||
export * from './passport.js';
|
||||
export * from './plan.js';
|
||||
export * from './registration.js';
|
||||
export * from './user.js';
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
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;
|
||||
};
|
||||
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_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?: data.IPassportChallenge;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_MarkPassportChallengeSeen
|
||||
extends plugins.typedRequestInterfaces.implementsTR<
|
||||
plugins.typedRequestInterfaces.ITypedRequest,
|
||||
IReq_MarkPassportChallengeSeen
|
||||
> {
|
||||
method: 'markPassportChallengeSeen';
|
||||
request: IPassportDeviceSignedRequest & {
|
||||
hintId: string;
|
||||
};
|
||||
response: {
|
||||
success: boolean;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user