@@ -38,23 +38,6 @@ public async Task OnInspectionRecordCreated(InspectionRecordCreatedEvent created
3838 return ;
3939 }
4040
41- inspectionRecord . InspectionId = Sanitize . SanitizeUserInput ( inspectionRecord . InspectionId ) ;
42- if ( createdEvent . AnalysisGroup is not null )
43- {
44- createdEvent . AnalysisGroup . AnalysisGroupId = Sanitize . SanitizeUserInput (
45- createdEvent . AnalysisGroup . AnalysisGroupId
46- ) ;
47- createdEvent . AnalysisGroup . AnalysisGroupAnalyses = createdEvent
48- . AnalysisGroup . AnalysisGroupAnalyses . Select ( Sanitize . SanitizeUserInput )
49- . ToList ( ) ;
50- }
51- if ( createdEvent . RequiredAnalysis is not null )
52- {
53- createdEvent . RequiredAnalysis = createdEvent
54- . RequiredAnalysis . Select ( Sanitize . SanitizeUserInput )
55- . ToList ( ) ;
56- }
57-
5841 var analysisNames = GetAnalysesToRun ( createdEvent , inspectionRecord ) ;
5942 if ( analysisNames . Count == 0 )
6043 {
@@ -87,9 +70,9 @@ public async Task OnInspectionRecordCreated(InspectionRecordCreatedEvent created
8770 {
8871 logger . LogInformation (
8972 "Deferring analysis '{AnalysisName}' for InspectionId: {InspectionId} — waiting for group {GroupId}" ,
90- analysisName ,
91- inspectionRecord . InspectionId ,
92- group ! . GroupId
73+ Sanitize . SanitizeUserInput ( analysisName ) ,
74+ Sanitize . SanitizeUserInput ( inspectionRecord . InspectionId ) ,
75+ Sanitize . SanitizeUserInput ( group ! . GroupId )
9376 ) ;
9477 }
9578 else
@@ -137,7 +120,7 @@ extension is not null
137120 {
138121 logger . LogInformation (
139122 "No analyses to run for InspectionId: {InspectionId}" ,
140- inspectionRecord . InspectionId
123+ Sanitize . SanitizeUserInput ( inspectionRecord . InspectionId )
141124 ) ;
142125 return [ ] ;
143126 }
@@ -150,8 +133,8 @@ extension is not null
150133 logger . LogError (
151134 "Unknown analyses [{UnknownAnalyses}] for InspectionId: {InspectionId} — "
152135 + "not found in configuration. These will be skipped." ,
153- string . Join ( ", " , unknownNames ) ,
154- inspectionRecord . InspectionId
136+ Sanitize . SanitizeUserInput ( string . Join ( ", " , unknownNames ) ) ,
137+ Sanitize . SanitizeUserInput ( inspectionRecord . InspectionId )
155138 ) ;
156139 }
157140
@@ -161,15 +144,15 @@ extension is not null
161144 {
162145 logger . LogInformation (
163146 "No known analyses to run for InspectionId: {InspectionId}" ,
164- inspectionRecord . InspectionId
147+ Sanitize . SanitizeUserInput ( inspectionRecord . InspectionId )
165148 ) ;
166149 return [ ] ;
167150 }
168151
169152 logger . LogInformation (
170153 "Resolved analyses for InspectionId: {InspectionId}: {Analyses}" ,
171- inspectionRecord . InspectionId ,
172- string . Join ( ", " , knownNames )
154+ Sanitize . SanitizeUserInput ( inspectionRecord . InspectionId ) ,
155+ Sanitize . SanitizeUserInput ( string . Join ( ", " , knownNames ) )
173156 ) ;
174157
175158 return knownNames ;
@@ -185,7 +168,6 @@ IsarAnalysisGroupMessage groupMessage
185168
186169 if ( existing is not null )
187170 {
188- existing . GroupId = Sanitize . SanitizeUserInput ( existing . GroupId ) ;
189171 return existing ;
190172 }
191173
@@ -202,7 +184,7 @@ IsarAnalysisGroupMessage groupMessage
202184
203185 logger . LogInformation (
204186 "Created analysis group {GroupId} expecting {ExpectedSize} records, timeout at {TimeoutAt}" ,
205- group . GroupId ,
187+ Sanitize . SanitizeUserInput ( group . GroupId ) ,
206188 group . ExpectedSize ,
207189 group . TimeoutAt
208190 ) ;
@@ -255,7 +237,7 @@ IReadOnlyList<InspectionRecord> inspectionRecords
255237 {
256238 logger . LogWarning (
257239 "Analysis '{AnalysisName}' has an empty workflow chain" ,
258- analysis . Name
240+ Sanitize . SanitizeUserInput ( analysis . Name )
259241 ) ;
260242 return ;
261243 }
@@ -264,7 +246,7 @@ IReadOnlyList<InspectionRecord> inspectionRecords
264246 {
265247 logger . LogWarning (
266248 "TriggerAnalysis called for analysis '{AnalysisName}' with no InspectionRecords — skipping" ,
267- analysis . Name
249+ Sanitize . SanitizeUserInput ( analysis . Name )
268250 ) ;
269251 return ;
270252 }
@@ -368,7 +350,7 @@ private async Task CheckAndCompleteGroup(AnalysisGroup group, List<string> group
368350 {
369351 logger . LogInformation (
370352 "Group {GroupId}: {RecordCount}/{ExpectedSize} records received" ,
371- group . GroupId ,
353+ Sanitize . SanitizeUserInput ( group . GroupId ) ,
372354 recordCount ,
373355 group . ExpectedSize
374356 ) ;
@@ -380,8 +362,8 @@ private async Task CheckAndCompleteGroup(AnalysisGroup group, List<string> group
380362
381363 logger . LogInformation (
382364 "Group {GroupId} is complete. Triggering grouped analyses: {Analyses}" ,
383- group . GroupId ,
384- string . Join ( ", " , groupedAnalyses )
365+ Sanitize . SanitizeUserInput ( group . GroupId ) ,
366+ Sanitize . SanitizeUserInput ( string . Join ( ", " , groupedAnalyses ) )
385367 ) ;
386368
387369 // Resolve all records in the group up-front so we can pass them to TriggerAnalysis
@@ -425,12 +407,6 @@ public async Task RerunAnalysis(Guid analysisId)
425407 throw new KeyNotFoundException ( $ "Analysis with id { analysisId } not found") ;
426408 }
427409
428- analysis . Name = Sanitize . SanitizeUserInput ( analysis . Name ) ;
429- foreach ( var record in analysis . InspectionRecords )
430- {
431- record . InspectionId = Sanitize . SanitizeUserInput ( record . InspectionId ) ;
432- }
433-
434410 if ( ! _options . Analyses . ContainsKey ( analysis . Name ) )
435411 {
436412 throw new InvalidOperationException (
0 commit comments