fca978de07
Sweep of 203 source files resolving CommentChecker findings: add <summary>/<param>/<returns>/<inheritdoc> where missing, and remove resolved task/issue tracking markers (Tests-NNN, Worker-NNN, Server-NNN, Task N) from code comments. Comment/doc-only — no logic changes. Server+Tests build clean under TreatWarningsAsErrors.
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Microsoft.Data.SqlClient;
|
|
|
|
namespace ZB.MOM.WW.MxGateway.Server.Dashboard;
|
|
|
|
public static class DashboardConnectionStringDisplay
|
|
{
|
|
/// <summary>Returns a sanitized Galaxy Repository connection string for display.</summary>
|
|
/// <param name="connectionString">The connection string to sanitize.</param>
|
|
/// <returns>A connection string with only display-safe fields, or a placeholder if it cannot be parsed.</returns>
|
|
public static string GalaxyRepositoryConnectionString(string connectionString)
|
|
{
|
|
try
|
|
{
|
|
SqlConnectionStringBuilder builder = new(connectionString);
|
|
SqlConnectionStringBuilder display = new()
|
|
{
|
|
DataSource = builder.DataSource,
|
|
InitialCatalog = builder.InitialCatalog,
|
|
IntegratedSecurity = builder.IntegratedSecurity,
|
|
Encrypt = builder.Encrypt,
|
|
TrustServerCertificate = builder.TrustServerCertificate,
|
|
};
|
|
|
|
return display.ConnectionString;
|
|
}
|
|
catch (ArgumentException)
|
|
{
|
|
return "[invalid connection string]";
|
|
}
|
|
}
|
|
}
|