b86c6bb47f
Resolve all CommentChecker findings across the gateway server, worker, tests, and .NET client (314 -> 0 real issues): add missing <returns>/<summary>/<param> on public and test members, convert Stream/interface overrides to <inheritdoc/>, and remove internal task/issue tracking IDs (SEC-*, IPC-*, WRK-*, GWC-*, TST-*, Client.Dotnet-*) from shipped code documentation while preserving the design rationale prose. Shipped comments should not carry internal bookkeeping, and complete XML docs keep the analyzer/TreatWarningsAsErrors gate and generated API docs clean. The 6 remaining flags are heuristic false positives (MD5, UTC-4, capacity-1, near-1601) left intact so real documentation is not corrupted. Claude-Session: https://claude.ai/code/session_01DMXXvNuPekkkrTEyPNxEkW
20 lines
838 B
C#
20 lines
838 B
C#
namespace ZB.MOM.WW.MxGateway.Client.Cli;
|
|
|
|
/// <summary>Utility to redact API keys from error messages for safe output.</summary>
|
|
internal static class MxGatewayCliSecretRedactor
|
|
{
|
|
/// <summary>Replaces occurrences of the API key in the value with a redacted placeholder.</summary>
|
|
/// <param name="value">The message text to redact.</param>
|
|
/// <param name="apiKey">The API key to remove; no redaction if null or empty.</param>
|
|
/// <returns>The value with any occurrences of <paramref name="apiKey"/> replaced by a redacted placeholder.</returns>
|
|
public static string Redact(string value, string? apiKey)
|
|
{
|
|
if (string.IsNullOrEmpty(value) || string.IsNullOrEmpty(apiKey))
|
|
{
|
|
return value;
|
|
}
|
|
|
|
return value.Replace(apiKey, "[redacted]", StringComparison.Ordinal);
|
|
}
|
|
}
|