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()
386
386
var dataOptions = this . DataOptions ;
387
387
return new
388
388
{
389
- connectionStrings . Repository ,
390
- connectionStrings . Security ,
391
- connectionStrings . SignalR ,
389
+ Repository = GetConnectionInfo ( connectionStrings . Repository ) ,
390
+ Security = GetConnectionInfo ( connectionStrings . Security ) ,
391
+ SignalR = GetConnectionInfo ( connectionStrings . SignalR ) ,
392
392
dataOptions . DbCommandTimeout ,
393
393
dataOptions . TransactionTimeout ,
394
394
dataOptions . LongTransactionTimeout
395
395
} ;
396
396
}
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
+ }
397
412
398
413
public override async Task < HealthResult > GetHealthAsync ( CancellationToken cancel )
399
414
{
You can’t perform that action at this time.
0 commit comments