@@ -171,6 +171,13 @@ def get_detection_rules(
171
171
def get_scan_detections_path (self , scan_type : str ) -> str :
172
172
return f'{ self .scan_config .get_detections_prefix ()} /{ self .get_detections_service_controller_path (scan_type )} '
173
173
174
+ def get_scan_detections_list_path (self , scan_type : str ) -> str :
175
+ suffix = ''
176
+ if scan_type == consts .SCA_SCAN_TYPE :
177
+ suffix = '/detections'
178
+
179
+ return f'{ self .get_scan_detections_path (scan_type )} { suffix } '
180
+
174
181
def get_scan_detections (self , scan_type : str , scan_id : str ) -> List [dict ]:
175
182
params = {'scan_id' : scan_id }
176
183
@@ -184,9 +191,8 @@ def get_scan_detections(self, scan_type: str, scan_id: str) -> List[dict]:
184
191
params ['page_size' ] = page_size
185
192
params ['page_number' ] = page_number
186
193
187
- path = f'{ self .get_scan_detections_path (scan_type )} /detections'
188
194
response = self .scan_cycode_client .get (
189
- url_path = path ,
195
+ url_path = self . get_scan_detections_list_path ( scan_type ) ,
190
196
params = params ,
191
197
hide_response_content_log = self ._hide_response_log ,
192
198
).json ()
@@ -197,12 +203,12 @@ def get_scan_detections(self, scan_type: str, scan_id: str) -> List[dict]:
197
203
198
204
return detections
199
205
200
- def get_get_scan_detections_count_path (self , scan_type : str ) -> str :
206
+ def get_scan_detections_count_path (self , scan_type : str ) -> str :
201
207
return f'{ self .get_scan_detections_path (scan_type )} /count'
202
208
203
209
def get_scan_detections_count (self , scan_type : str , scan_id : str ) -> int :
204
210
response = self .scan_cycode_client .get (
205
- url_path = self .get_get_scan_detections_count_path (scan_type ), params = {'scan_id' : scan_id }
211
+ url_path = self .get_scan_detections_count_path (scan_type ), params = {'scan_id' : scan_id }
206
212
)
207
213
return response .json ().get ('count' , 0 )
208
214
0 commit comments