@@ -20,33 +20,33 @@ def __init__(
20
20
self .scan_cycode_client = scan_cycode_client
21
21
self .scan_config = scan_config
22
22
23
- self ._SCAN_CONTROLLER_PATH = 'api/v1/scan'
24
- self ._SCAN_CONTROLLER_PATH_SCA = 'api/v1/cli-scan'
23
+ self ._SCAN_SERVICE_CONTROLLER_PATH = 'api/v1/scan'
24
+ self ._SCAN_SERVICE_CLI_CONTROLLER_PATH = 'api/v1/cli-scan'
25
25
26
26
self ._DETECTIONS_SERVICE_CONTROLLER_PATH = 'api/v1/detections'
27
- self ._DETECTIONS_SERVICE_CONTROLLER_PATH_SCA = 'api/v1/detections/cli'
27
+ self ._DETECTIONS_SERVICE_CLI_CONTROLLER_PATH = 'api/v1/detections/cli'
28
28
29
29
self .POLICIES_SERVICE_CONTROLLER_PATH_V3 = 'api/v3/policies'
30
30
31
31
self ._hide_response_log = hide_response_log
32
32
33
- def get_scan_controller_path (self , scan_type : str , should_use_scan_service : bool = False ) -> str :
34
- if should_use_scan_service :
35
- return self ._SCAN_CONTROLLER_PATH
36
- if scan_type == consts .SCA_SCAN_TYPE :
37
- return self ._SCAN_CONTROLLER_PATH_SCA
33
+ def get_scan_controller_path (self , scan_type : str ) -> str :
34
+ if scan_type == consts .INFRA_CONFIGURATION_SCAN_TYPE :
35
+ # we don't use async flow for IaC scan yet
36
+ return self ._SCAN_SERVICE_CONTROLLER_PATH
38
37
39
- return self ._SCAN_CONTROLLER_PATH
38
+ return self ._SCAN_SERVICE_CLI_CONTROLLER_PATH
40
39
41
40
def get_detections_service_controller_path (self , scan_type : str ) -> str :
42
- if scan_type == consts .SCA_SCAN_TYPE :
43
- return self ._DETECTIONS_SERVICE_CONTROLLER_PATH_SCA
41
+ if scan_type == consts .INFRA_CONFIGURATION_SCAN_TYPE :
42
+ # we don't use async flow for IaC scan yet
43
+ return self ._DETECTIONS_SERVICE_CONTROLLER_PATH
44
44
45
- return self ._DETECTIONS_SERVICE_CONTROLLER_PATH
45
+ return self ._DETECTIONS_SERVICE_CLI_CONTROLLER_PATH
46
46
47
47
def get_scan_service_url_path (self , scan_type : str , should_use_scan_service : bool = False ) -> str :
48
48
service_path = self .scan_config .get_service_name (scan_type , should_use_scan_service )
49
- controller_path = self .get_scan_controller_path (scan_type , should_use_scan_service )
49
+ controller_path = self .get_scan_controller_path (scan_type )
50
50
return f'{ service_path } /{ controller_path } '
51
51
52
52
def content_scan (self , scan_type : str , file_name : str , content : str , is_git_diff : bool = True ) -> models .ScanResult :
@@ -185,12 +185,16 @@ def get_detection_rules(
185
185
def get_scan_detections_path (self , scan_type : str ) -> str :
186
186
return f'{ self .scan_config .get_detections_prefix ()} /{ self .get_detections_service_controller_path (scan_type )} '
187
187
188
- def get_scan_detections_list_path (self , scan_type : str ) -> str :
189
- suffix = ''
190
- if scan_type == consts .SCA_SCAN_TYPE :
191
- suffix = '/detections'
188
+ @staticmethod
189
+ def get_scan_detections_list_path_suffix (scan_type : str ) -> str :
190
+ # we don't use async flow for IaC scan yet
191
+ if scan_type == consts .INFRA_CONFIGURATION_SCAN_TYPE :
192
+ return ''
192
193
193
- return f'{ self .get_scan_detections_path (scan_type )} { suffix } '
194
+ return '/detections'
195
+
196
+ def get_scan_detections_list_path (self , scan_type : str ) -> str :
197
+ return f'{ self .get_scan_detections_path (scan_type )} { self .get_scan_detections_list_path_suffix (scan_type )} '
194
198
195
199
def get_scan_detections (self , scan_type : str , scan_id : str ) -> List [dict ]:
196
200
params = {'scan_id' : scan_id }
0 commit comments