66using AuditThroughput ;
77using Contracts ;
88using MonitoringThroughput ;
9+ using Particular . LicensingComponent . Report . Utility ;
910using Persistence ;
1011using Report ;
1112using ServiceControl . Transports . BrokerThroughput ;
@@ -112,9 +113,8 @@ async Task<ReportGenerationState> GetReportGenerationStateForNonBroker(Cancellat
112113
113114 public async Task < SignedReport > GenerateThroughputReport ( string spVersion , DateTime ? reportEndDate , CancellationToken cancellationToken )
114115 {
115- ( string Mask , string Replacement ) [ ] masks = [ ] ;
116116 var reportMasks = await dataStore . GetReportMasks ( cancellationToken ) ;
117- CreateMasks ( reportMasks . ToArray ( ) ) ;
117+ var masker = new Masker ( [ .. reportMasks ] ) ;
118118
119119 var queueThroughputs = new List < QueueThroughput > ( ) ;
120120 List < string > ignoredQueueNames = [ ] ;
@@ -126,7 +126,8 @@ public async Task<SignedReport> GenerateThroughputReport(string spVersion, DateT
126126 //get all data that we have, including daily values
127127 var queueThroughput = new QueueThroughput
128128 {
129- QueueName = Mask ( endpointData . Name ) ,
129+ NameHash = OneWayHasher . CalculateOneWayHash ( endpointData . Name ) ,
130+ QueueName = masker . Mask ( endpointData . Name ) ,
130131 UserIndicator = endpointData . UserIndicator ,
131132 EndpointIndicators = endpointData . EndpointIndicators ?? [ ] ,
132133 NoDataOrSendOnly = endpointData . ThroughputData . Sum ( ) == 0 ,
@@ -189,28 +190,6 @@ public async Task<SignedReport> GenerateThroughputReport(string spVersion, DateT
189190
190191 var throughputReport = new SignedReport { ReportData = report , Signature = Signature . SignReport ( report ) } ;
191192 return throughputReport ;
192-
193- void CreateMasks ( string [ ] wordsToMask )
194- {
195- var number = 0 ;
196- masks = wordsToMask
197- . Select ( mask =>
198- {
199- number ++ ;
200- return ( mask , $ "REDACTED{ number } ") ;
201- } )
202- . ToArray ( ) ;
203- }
204-
205- string Mask ( string stringToMask )
206- {
207- foreach ( var ( mask , replacement ) in masks )
208- {
209- stringToMask = stringToMask . Replace ( mask , replacement , StringComparison . OrdinalIgnoreCase ) ;
210- }
211-
212- return stringToMask ;
213- }
214193 }
215194
216195 async IAsyncEnumerable < EndpointData > GetDistinctEndpointData ( [ EnumeratorCancellation ] CancellationToken cancellationToken )
0 commit comments