chore: add handling shared vault invites via websockets (#2475)
This commit is contained in:
@@ -211,7 +211,7 @@ export class AsymmetricMessageService
|
||||
|
||||
const result = this._getUntrustedPayload.execute({
|
||||
privateKey: keys.getValue().encryption.privateKey,
|
||||
message,
|
||||
payload: message,
|
||||
})
|
||||
|
||||
if (result.isFailed()) {
|
||||
@@ -236,7 +236,7 @@ export class AsymmetricMessageService
|
||||
privateKey: keys.getValue().encryption.privateKey,
|
||||
sender: contact.getValue(),
|
||||
ownUserUuid: this.sessions.userUuid,
|
||||
message,
|
||||
payload: message,
|
||||
})
|
||||
|
||||
if (result.isFailed()) {
|
||||
|
||||
@@ -18,7 +18,7 @@ describe('GetTrustedPayload', () => {
|
||||
describe('execute', () => {
|
||||
const mockDto = {
|
||||
privateKey: 'test-private-key',
|
||||
message: {} as AsymmetricMessageServerHash,
|
||||
payload: {} as AsymmetricMessageServerHash,
|
||||
sender: {} as TrustedContactInterface,
|
||||
ownUserUuid: 'test-user-uuid',
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AsymmetricMessageServerHash } from '@standardnotes/responses'
|
||||
import { AsymmetricMessageServerHash, SharedVaultInviteServerHash } from '@standardnotes/responses'
|
||||
import { AsymmetricMessagePayload, TrustedContactInterface } from '@standardnotes/models'
|
||||
import { DecryptMessage } from '../../Encryption/UseCase/Asymmetric/DecryptMessage'
|
||||
import { Result, SyncUseCaseInterface } from '@standardnotes/domain-core'
|
||||
@@ -8,12 +8,12 @@ export class GetTrustedPayload implements SyncUseCaseInterface<AsymmetricMessage
|
||||
|
||||
execute<M extends AsymmetricMessagePayload>(dto: {
|
||||
privateKey: string
|
||||
message: AsymmetricMessageServerHash
|
||||
payload: AsymmetricMessageServerHash | SharedVaultInviteServerHash
|
||||
sender: TrustedContactInterface
|
||||
ownUserUuid: string
|
||||
}): Result<M> {
|
||||
const result = this.decryptMessage.execute<M>({
|
||||
message: dto.message.encrypted_message,
|
||||
message: dto.payload.encrypted_message,
|
||||
sender: dto.sender,
|
||||
privateKey: dto.privateKey,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AsymmetricMessageServerHash } from '@standardnotes/responses'
|
||||
import { AsymmetricMessageServerHash, SharedVaultInviteServerHash } from '@standardnotes/responses'
|
||||
import { AsymmetricMessagePayload } from '@standardnotes/models'
|
||||
import { DecryptMessage } from '../../Encryption/UseCase/Asymmetric/DecryptMessage'
|
||||
import { Result, SyncUseCaseInterface } from '@standardnotes/domain-core'
|
||||
@@ -8,10 +8,10 @@ export class GetUntrustedPayload implements SyncUseCaseInterface<AsymmetricMessa
|
||||
|
||||
execute<M extends AsymmetricMessagePayload>(dto: {
|
||||
privateKey: string
|
||||
message: AsymmetricMessageServerHash
|
||||
payload: AsymmetricMessageServerHash | SharedVaultInviteServerHash
|
||||
}): Result<M> {
|
||||
const result = this.decryptMessage.execute<M>({
|
||||
message: dto.message.encrypted_message,
|
||||
message: dto.payload.encrypted_message,
|
||||
sender: undefined,
|
||||
privateKey: dto.privateKey,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user