Table of Contents

Class ConnectionStringMasker

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

Masks the secret values of a connection string, so that it can be written to a log.

public static class ConnectionStringMasker
Inheritance
ConnectionStringMasker
Inherited Members

Fields

UnreadableConnectionString

The text returned instead of a connection string that cannot be parsed.

public const string UnreadableConnectionString = "<unreadable connection string>"

Field Value

string

Methods

Mask(string?)

Replaces the value of every key of the connection string that carries a secret with a fixed-length mask.

public static string Mask(string? connectionString)

Parameters

connectionString string

The connection string.

Returns

string

The connection string with its secret values masked, an empty string when it is empty, or UnreadableConnectionString when it cannot be parsed.