Method RedactSecrets(string?)
Redacts key=value secret assignments inside arbitrary text — connection strings
(...;Password=p;...), query fragments, and driver exception messages that may embed
either. Only the value of a key considered sensitive by is
replaced, and the password of a URI quoted in the text (amqp://user:password);
everything else is preserved verbatim. Never throws.
Use this as the backstop for text that is not a parseable endpoint URI. Note that logging an
object itself cannot be scrubbed in-process (the formatter renders
ToString()); wire this into a logging-sink filter for that case.
public static string RedactSecrets(string? text)