chore: should validate password before deleting vault (#2400)
This commit is contained in:
@@ -164,6 +164,7 @@ import { Logger, isNotUndefined, isDeinitable } from '@standardnotes/utils'
|
||||
import { EncryptionOperators } from '@standardnotes/encryption'
|
||||
import { AsymmetricMessagePayload, AsymmetricMessageSharedVaultInvite } from '@standardnotes/models'
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
import { AuthorizeVaultDeletion } from '@standardnotes/services/src/Domain/Vault/UseCase/AuthorizeVaultDeletion'
|
||||
|
||||
export class Dependencies {
|
||||
private factory = new Map<symbol, () => unknown>()
|
||||
@@ -225,6 +226,15 @@ export class Dependencies {
|
||||
)
|
||||
})
|
||||
|
||||
this.factory.set(TYPES.AuthorizeVaultDeletion, () => {
|
||||
return new AuthorizeVaultDeletion(
|
||||
this.get<VaultLockService>(TYPES.VaultLockService),
|
||||
this.get<ProtectionService>(TYPES.ProtectionService),
|
||||
this.get<ChallengeService>(TYPES.ChallengeService),
|
||||
this.get<ValidateVaultPassword>(TYPES.ValidateVaultPassword),
|
||||
)
|
||||
})
|
||||
|
||||
this.factory.set(TYPES.GenerateUuid, () => {
|
||||
return new GenerateUuid(this.get<PureCryptoInterface>(TYPES.Crypto))
|
||||
})
|
||||
@@ -879,6 +889,7 @@ export class Dependencies {
|
||||
this.get<SendVaultDataChangedMessage>(TYPES.SendVaultDataChangedMessage),
|
||||
this.get<IsVaultOwner>(TYPES.IsVaultOwner),
|
||||
this.get<ValidateVaultPassword>(TYPES.ValidateVaultPassword),
|
||||
this.get<AuthorizeVaultDeletion>(TYPES.AuthorizeVaultDeletion),
|
||||
this.get<InternalEventBus>(TYPES.InternalEventBus),
|
||||
)
|
||||
})
|
||||
|
||||
@@ -163,6 +163,7 @@ export const TYPES = {
|
||||
GenerateUuid: Symbol.for('GenerateUuid'),
|
||||
GetVaultItems: Symbol.for('GetVaultItems'),
|
||||
ValidateVaultPassword: Symbol.for('ValidateVaultPassword'),
|
||||
AuthorizeVaultDeletion: Symbol.for('AuthorizeVaultDeletion'),
|
||||
|
||||
// Mappers
|
||||
SessionStorageMapper: Symbol.for('SessionStorageMapper'),
|
||||
|
||||
Reference in New Issue
Block a user