internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20321 additions and 4813 deletions

View File

@@ -32,16 +32,13 @@ describe('backup service', () => {
beforeEach(() => {
apiService = {} as jest.Mocked<ApiServiceInterface>
apiService.addEventObserver = jest.fn()
apiService.createFileValetToken = jest.fn()
apiService.createUserFileValetToken = jest.fn()
apiService.downloadFile = jest.fn()
apiService.deleteFile = jest.fn().mockReturnValue({})
itemManager = {} as jest.Mocked<ItemManagerInterface>
itemManager.createItem = jest.fn()
itemManager.createTemplateItem = jest.fn().mockReturnValue({})
itemManager.setItemToBeDeleted = jest.fn()
itemManager.addObserver = jest.fn()
itemManager.changeItem = jest.fn()
status = {} as jest.Mocked<StatusServiceInterface>

View File

@@ -515,7 +515,7 @@ export class FilesBackupService extends AbstractService implements BackupService
},
})
const token = await this.api.createFileValetToken(file.remoteIdentifier, 'read')
const token = await this.api.createUserFileValetToken(file.remoteIdentifier, 'read')
if (token instanceof ClientDisplayableError) {
this.status.removeMessage(messageId)
@@ -536,9 +536,11 @@ export class FilesBackupService extends AbstractService implements BackupService
const metaFileAsString = JSON.stringify(metaFile, null, 2)
const downloadType = !file.user_uuid || file.user_uuid === this.session.getSureUser().uuid ? 'user' : 'shared-vault'
const result = await this.device.saveFilesBackupsFile(location, file.uuid, metaFileAsString, {
chunkSizes: file.encryptedChunkSizes,
url: this.api.getFilesDownloadUrl(),
url: this.api.getFilesDownloadUrl(downloadType),
valetToken: token,
})