From dd0e1227ae85b36ad8f3ef126c56e1ab380f961f Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Wed, 29 Oct 2025 12:53:22 +0100 Subject: [PATCH] tmp --- .../src/platform/models/domain/domain-base.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/common/src/platform/models/domain/domain-base.ts b/libs/common/src/platform/models/domain/domain-base.ts index a144353f5bc..1d571fd2d9e 100644 --- a/libs/common/src/platform/models/domain/domain-base.ts +++ b/libs/common/src/platform/models/domain/domain-base.ts @@ -2,6 +2,7 @@ import { ConditionalExcept, ConditionalKeys } from "type-fest"; import { EncString } from "../../../key-management/crypto/models/enc-string"; import { View } from "../../../models/view/view"; +import { Utils } from "../../misc/utils"; import { SymmetricCryptoKey } from "./symmetric-crypto-key"; @@ -69,23 +70,22 @@ export default class Domain { } } + /** @deprecated - Domain encryption must be implemented in the SDK */ protected async decryptObj( domain: DomainEncryptableKeys, viewModel: ViewEncryptableKeys, props: EncryptableKeys[], - orgId: string | null, - key: SymmetricCryptoKey | null = null, + orgId: null, + key: SymmetricCryptoKey | null, objectContext: string = "No Domain Context", ): Promise { + const encryptService = Utils.getContainerService().getEncryptService(); for (const prop of props) { - viewModel[prop] = - (await domain[prop]?.decrypt( - orgId, - key, - `Property: ${prop as string}; ObjectContext: ${objectContext}`, - )) ?? null; + if (domain[prop] == null) { + continue; + } + viewModel[prop] = await encryptService.decryptString(domain[prop]!, key!); } - return viewModel as V; } }