Backup Server APIs

This commit is contained in:
Fedor Indutny 2024-04-22 16:11:36 +02:00 committed by GitHub
parent 77aea40a63
commit 3eb0e30a23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 991 additions and 201 deletions

View file

@ -18,6 +18,7 @@ import type {
SessionResetsType,
StorageServiceCredentials,
} from '../textsecure/Types.d';
import type { BackupCredentialType } from './backups';
import type { ServiceIdString } from './ServiceId';
import type { RegisteredChallengeType } from '../challenge';
@ -134,6 +135,9 @@ export type StorageAccessType = {
unidentifiedDeliveryIndicators: boolean;
groupCredentials: ReadonlyArray<GroupCredentialType>;
callLinkAuthCredentials: ReadonlyArray<GroupCredentialType>;
backupCredentials: ReadonlyArray<BackupCredentialType>;
backupCredentialsLastRequestTime: number;
setBackupSignatureKey: boolean;
lastReceivedAtCounter: number;
preferredReactionEmoji: ReadonlyArray<string>;
skinTone: number;

20
ts/types/backups.ts Normal file
View file

@ -0,0 +1,20 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { BackupLevel } from '@signalapp/libsignal-client/zkgroup';
export type BackupCredentialType = Readonly<{
credential: string;
level: BackupLevel;
redemptionTimeMs: number;
}>;
export type BackupPresentationHeadersType = Readonly<{
'X-Signal-ZK-Auth': string;
'X-Signal-ZK-Auth-Signature': string;
}>;
export type BackupSignedPresentationType = Readonly<{
headers: BackupPresentationHeadersType;
level: BackupLevel;
}>;