Zum Hauptinhalt springen

RtEntityToDtoMapper

Namespace: Meshmakers.Octo.Communication.Contracts.DataTransferObjects

Converts RtEntity to RtEntityDto

public class RtEntityToDtoMapper : IRtEntityToDtoMapper

Inheritance Object → RtEntityToDtoMapper
Implements IRtEntityToDtoMapper

Remarks:

Secret attributes (AB#5528) are mapped to RtEntityAttributeDto.Value = null plus their read state (, AB#5534 round 2): this applies to record sub-attributes as well.

RtEntityAttributeDto.SecretSetAt: when the value was set (null for legacy / not set).

Without key-ring knowledge (no protector, or a protector without configured keys): RtEntityAttributeDto.SecretIsSet counts every protected value as set and RtEntityAttributeDto.SecretKeyMissing is null (unknown).

With a configured : a protected value whose key id is not in the key ring - or a legacy enc:v1 string while is false - maps to SecretIsSet = false, SecretKeyMissing = true; otherwise SecretKeyMissing = false.

Constructors​

RtEntityToDtoMapper(ICkCacheService, ISecretAttributeProtector)​

Converts RtEntity to RtEntityDto

public RtEntityToDtoMapper(ICkCacheService ckCacheService, ISecretAttributeProtector secretAttributeProtector)

Parameters​

ckCacheService ICkCacheService
Construction Kit Cache Service

secretAttributeProtector ISecretAttributeProtector
Optional key ring of the host (resolved from DI when registered); only used when

  • it never decrypts.

Remarks:

Secret attributes (AB#5528) are mapped to RtEntityAttributeDto.Value = null plus their read state (, AB#5534 round 2): this applies to record sub-attributes as well.

RtEntityAttributeDto.SecretSetAt: when the value was set (null for legacy / not set).

Without key-ring knowledge (no protector, or a protector without configured keys): RtEntityAttributeDto.SecretIsSet counts every protected value as set and RtEntityAttributeDto.SecretKeyMissing is null (unknown).

With a configured : a protected value whose key id is not in the key ring - or a legacy enc:v1 string while is false - maps to SecretIsSet = false, SecretKeyMissing = true; otherwise SecretKeyMissing = false.

Methods​

ConvertToDto(String, RtEntity, AttributeValueResolveFlags)​

public RtEntityDto ConvertToDto(string tenantId, RtEntity rtEntity, AttributeValueResolveFlags attributeValueResolveFlags)

Parameters​

tenantId String

rtEntity RtEntity

attributeValueResolveFlags AttributeValueResolveFlags

Returns​

RtEntityDto