Device dehydration v2

- add support for device dehydration v2 i.e. `org.matrix.msc3814`
- run dehydration flows after successfully recovering or creating secrets
- enable said flows based on .well-known `org.matrix.msc3814` config key
- delete previous implementation and helper methods
This commit is contained in:
Stefan Ceriu
2023-07-27 16:03:13 +03:00
parent 29324382ba
commit 6ad39f6fcb
16 changed files with 72 additions and 160 deletions
@@ -104,8 +104,21 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
return introViewController
}
private var dehydrationService: DehydrationService? {
if self.session.vc_homeserverConfiguration().encryption.deviceDehydrationEnabled {
return self.session.crypto.dehydrationService
}
return nil
}
private func showSetupKey(passphraseOnly: Bool, passphrase: String? = nil) {
let coordinator = SecretsSetupRecoveryKeyCoordinator(recoveryService: self.recoveryService, passphrase: passphrase, passphraseOnly: passphraseOnly, allowOverwrite: allowOverwrite, cancellable: self.cancellable)
let coordinator = SecretsSetupRecoveryKeyCoordinator(recoveryService: self.recoveryService,
passphrase: passphrase,
passphraseOnly: passphraseOnly,
allowOverwrite: allowOverwrite,
cancellable: self.cancellable,
dehydrationService: dehydrationService)
coordinator.delegate = self
coordinator.start()