615b487a77
Adds missing <summary>/<param> XML docs across 99 server, worker, and test files so CommentChecker reports zero issues (TreatWarningsAsErrors needs the analyzer clean). Bundles in WIP dashboard work: NavSection extraction, MainLayout/site.css/js styling alignment, and DashboardOptions/Auth tweaks.
31 lines
1.0 KiB
C#
31 lines
1.0 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>
|
|
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]";
|
|
}
|
|
}
|
|
}
|