Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 5e8c3f3

Browse files
hide values earlier
1 parent b44ccaf commit 5e8c3f3

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/SqlStreamStore.Server/SqlStreamStoreServerConfiguration.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ void Log(string logName, IDictionary<string, string> data)
4444
{
4545
foreach (var (key, value) in data)
4646
{
47-
_values[key] = (logName, value);
47+
_values[key] = (
48+
logName,
49+
s_sensitiveKeys.Contains(key)
50+
? new string('*', 8)
51+
: value);
4852
}
4953
}
5054

@@ -82,18 +86,16 @@ public override string ToString()
8286
}
8387
}
8488
.Concat(
85-
s_allKeys
86-
.Select(key => new[] {delimiter, key, _values[key].value, _values[key].source}))
89+
s_allKeys.Select(key => new[] {delimiter, key, _values[key].value, _values[key].source}))
8790
.Aggregate(
8891
new StringBuilder().AppendLine("SQL Stream Store Configuration:"),
8992
(builder, values) => builder
9093
.Append((values[1] ?? string.Empty).PadRight(column0Width, ' '))
9194
.Append(values[0])
92-
.Append((s_sensitiveKeys.Contains(values[1])
93-
? new string('*', Math.Min(column1Width, 8))
94-
: values[2] ?? string.Empty).PadRight(column1Width, ' '))
95+
.Append((values[2] ?? string.Empty).PadRight(column1Width, ' '))
9596
.Append(values[0])
96-
.AppendLine(values[3])).ToString();
97+
.AppendLine(values[3]))
98+
.ToString();
9799
}
98100

99101
private static string Computerize(string value) =>

0 commit comments

Comments
 (0)