fix(vault): исправил шифрование, meta Yandex и enc-meta при первом открытии
Remember key после encrypt, мягкий auto-open в UnlockManager, StorageMetaLoadState без затирания meta на сетевых ошибках, фильтр storages в YandexVault и создание .enc-meta при FileNotFound.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.github.nullptroma.wallenc.domain.datatypes
|
||||
|
||||
enum class StorageMetaLoadState {
|
||||
Loading,
|
||||
Ready,
|
||||
Unavailable,
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.github.nullptroma.wallenc.domain.interfaces
|
||||
|
||||
import com.github.nullptroma.wallenc.domain.datatypes.StorageEncryptionInfo
|
||||
import com.github.nullptroma.wallenc.domain.datatypes.StorageMetaLoadState
|
||||
import com.github.nullptroma.wallenc.domain.tasks.TaskProgress
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
@@ -14,6 +15,7 @@ sealed interface IStorageInfo {
|
||||
val numberOfFiles: StateFlow<Int?>
|
||||
val isEmpty: Flow<Boolean?>
|
||||
val metaInfo: StateFlow<IStorageMetaInfo>
|
||||
val metaLoadState: StateFlow<StorageMetaLoadState>
|
||||
val isVirtualStorage: Boolean
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ interface IUnlockManager {
|
||||
fun getOpenedStorageKey(uuid: UUID): EncryptKey?
|
||||
|
||||
suspend fun open(storage: IStorage, key: EncryptKey, rememberPassword: Boolean = true): IStorage
|
||||
/** Сохранить ключ для auto-open без открытия виртуального storage. */
|
||||
suspend fun rememberKey(storage: IStorage, key: EncryptKey)
|
||||
suspend fun close(storage: IStorage)
|
||||
suspend fun close(uuid: UUID)
|
||||
}
|
||||
Reference in New Issue
Block a user