Table of Contents

Class MaskedPropertyAttribute

Namespace
GroupeIsa.Neos.Shared.Masking
Assembly
GroupeIsa.Neos.Shared.dll

Marks a generated property whose value is masked before it leaves the server, unless the user is explicitly allowed to see it in clear.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class MaskedPropertyAttribute : Attribute
Inheritance
MaskedPropertyAttribute
Inherited Members

Remarks

The generator puts this attribute on every serialized form of a masked property: entity view class and interface, API models and lookup labels. It carries the effective mask, so that the masker can be built from the property itself.

Constructors

MaskedPropertyAttribute(string, MaskingType)

Initializes a new instance of the MaskedPropertyAttribute class.

public MaskedPropertyAttribute(string name, MaskingType type)

Parameters

name string

The name of the masked data, used as unmasking resource: Entity.Property for a property bound to an entity property, EntityView.Property otherwise.

type MaskingType

The masking type.

Properties

MaskCharacter

Gets or sets the character that replaces each masked character.

public char MaskCharacter { get; set; }

Property Value

char

Name

Gets the name of the masked data, used as unmasking resource.

public string Name { get; }

Property Value

string

RegularExpression

Gets or sets the regular expression that designates the visible parts of the value (Regex only).

public string? RegularExpression { get; set; }

Property Value

string

Type

Gets the masking type.

public MaskingType Type { get; }

Property Value

MaskingType

VisiblePrefixLength

Gets or sets the number of characters left visible at the start of the value (Partial only).

public int VisiblePrefixLength { get; set; }

Property Value

int

VisibleSuffixLength

Gets or sets the number of characters left visible at the end of the value (Partial only).

public int VisibleSuffixLength { get; set; }

Property Value

int

Methods

GetMasker(ICustomAttributeProvider?)

Gets the masker of a property marked with MaskedPropertyAttribute.

public static ValueMasker? GetMasker(ICustomAttributeProvider? property)

Parameters

property ICustomAttributeProvider

The property.

Returns

ValueMasker

The masker, or null when the property is not masked.

ToSpecification()

Gets the masking specification described by the attribute.

public MaskingSpecification ToSpecification()

Returns

MaskingSpecification

The masking specification.