File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
src/ContentRepository.MsSql Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -386,14 +386,29 @@ public override object GetConfigurationForHealthDashboard()
386386 var dataOptions = this . DataOptions ;
387387 return new
388388 {
389- connectionStrings . Repository ,
390- connectionStrings . Security ,
391- connectionStrings . SignalR ,
389+ Repository = GetConnectionInfo ( connectionStrings . Repository ) ,
390+ Security = GetConnectionInfo ( connectionStrings . Security ) ,
391+ SignalR = GetConnectionInfo ( connectionStrings . SignalR ) ,
392392 dataOptions . DbCommandTimeout ,
393393 dataOptions . TransactionTimeout ,
394394 dataOptions . LongTransactionTimeout
395395 } ;
396396 }
397+ private object GetConnectionInfo ( string connectionString )
398+ {
399+ void EncryptValue ( string key , DbConnectionStringBuilder b )
400+ {
401+ if ( b . ContainsKey ( key ) )
402+ if ( b [ key ] != null )
403+ b [ key ] = "***" ;
404+ }
405+
406+ var builder = new DbConnectionStringBuilder { ConnectionString = connectionString } ;
407+ EncryptValue ( "User ID" , builder ) ;
408+ EncryptValue ( "Password" , builder ) ;
409+ EncryptValue ( "Pwd" , builder ) ;
410+ return builder . ConnectionString ;
411+ }
397412
398413 public override async Task < HealthResult > GetHealthAsync ( CancellationToken cancel )
399414 {
You can’t perform that action at this time.
0 commit comments