diff --git a/atom_tools/lib/converter.py b/atom_tools/lib/converter.py index 344eaa1..6ab777d 100644 --- a/atom_tools/lib/converter.py +++ b/atom_tools/lib/converter.py @@ -15,9 +15,58 @@ logger = logging.getLogger(__name__) +class RegexCollection: + """ + Collection of regular expressions needed for conversions. + + Attributes: + endpoints (re.compile): Regex to find endpoints + param (re.compile): Regex to find path parameters + py_param (re.compile): Regex to find Python path parameters + py_regex_in_path (re.compile): Regex to find Python path parameters + + Methods: + py_helper(endpoint): Handles Python path parameters + _py_repl(match): Replaces Python path parameters + """ + def __init__(self): + self.endpoints = re.compile(r'[\'"](\S*?)[\'"]', re.IGNORECASE) + self.param = re.compile(r'{(?P[^\s}]+)}', re.IGNORECASE) + self.py_param = re.compile(r'<(?P\w+):(?P\w+)>') + self.py_regex_in_path = re.compile(r'(?<=\?P<)(?P\w+)(?=>)') + + def py_helper(self, endpoint): + """ + Handles Python path parameters. + Args: + endpoint (str): The endpoint string + + Returns: + tuple[str,list]: The modified endpoint and parameters + """ + type_mapping = { + 'int': 'integer', 'string': 'string', + 'float': 'number', 'path': 'string' + } + params = [] + + if matches := self.py_param.findall(endpoint): + endpoint = re.sub(self.py_param, self._py_repl, endpoint) + for m in matches: + p = {'in': 'path', 'name': m[1], 'required': True} + if type_mapping.get(m[0]): + p['schema'] = {'type': type_mapping[m[0]]} + params.append(p) + return endpoint, params + + @staticmethod + def _py_repl(match): + return '{' + match.group('pname') + '}' + + class OpenAPI: """ - Represents an OpenAPI object. + Represents an OpenAPI converter. Args: dest_format (str): The destination format. @@ -28,29 +77,28 @@ class OpenAPI: usages (AtomSlice): The usage slice. origin_type (str): The origin type. openapi_version (str): The OpenAPI version. - endpoints_regex (re.Pattern): The regular expression for endpoints. - param_regex (re.Pattern): The regular expression pattern for params. title (str): The title of the OpenAPI specification. + regex (RegexCollection): collection of regular expressions Methods: - endpoints_to_openapi: Generates an OpenAPI document. + _js_helper: Formats path sections which are parameters correctly. + _process_methods_helper: Utility for process_methods. + _query_calls_helper: A helper function to query calls. + calls_to_params: Transforms a call and endpoint into parameter object. + collect_methods: Collects and combines methods that may be endpoints. convert_usages: Converts usages to OpenAPI. - js_helper: Formats path sections which are parameters correctly. - process_methods: Creates a dictionary of endpoints and methods. - query_calls: Queries calls for the given function name and methods. - query_calls_helper: A helper function to query calls. - process_calls: Processes calls and returns a new method map. - filter_calls: Filters invokedCalls and argToCalls. - methods_to_endpoints: Converts a method map to a map of endpoints. - process_methods_helper: Utility for process_methods. - populate_endpoints: Populates the endpoints based on the method_map. + create_param_object: Creates a parameter object for each parameter. create_paths_item: Creates paths item object. determine_operations: Determines the supported operations. - calls_to_params: Transforms a call and endpoint into parameter object. - create_param_object: Creates a parameter object for each parameter. - collect_methods: Collects and combines methods that may be endpoints. + endpoints_to_openapi: Generates an OpenAPI document. extract_endpoints: Extracts endpoints from the given code. + filter_calls: Filters invokedCalls and argToCalls. filter_matches: Filters a list of matches based on certain criteria. + methods_to_endpoints: Converts a method map to a map of endpoints. + populate_endpoints: Populates the endpoints based on the method_map. + process_calls: Processes calls and returns a new method map. + process_methods: Creates a dictionary of endpoints and methods. + query_calls: Queries calls for the given function name and methods. """ def __init__( @@ -62,10 +110,8 @@ def __init__( self.usages = AtomSlice(usages, origin_type) if usages else None self.origin_type = origin_type self.openapi_version = dest_format.replace('openapi', '') - self.endpoints_regex = re.compile(r'[\'"](\S*?)[\'"]', re.IGNORECASE) - self.param_regex = re.compile(r'{(?P[^\s}]+)}', re.IGNORECASE) self.title = f'OpenAPI Specification for {Path(usages).parent.stem}' - self.py_param_regex = re.compile(r'<(?P\w+):(?P\w+)>') + self.regex = RegexCollection() def endpoints_to_openapi(self, server=None): """ @@ -93,7 +139,7 @@ def convert_usages(self): methods = self.process_calls(methods) return self.populate_endpoints(methods) - def js_helper(self, endpoint): + def _js_helper(self, endpoint): """ Formats path sections which are parameters correctly. @@ -123,58 +169,26 @@ def generic_params_helper(self, endpoint): Returns: list: A list of dictionaries containing the extracted parameters. """ - matches = self.param_regex.findall(endpoint) + matches = self.regex.param.findall(endpoint) return [ {'name': m, 'in': 'path', 'required': True} for m in matches ] if matches else [] - def py_helper(self, endpoint): - """ - Handles Python path parameters. - Args: - endpoint (str): The endpoint string - - Returns: - tuple[str,list]: The modified endpoint and parameters - """ - type_mapping = { - 'int': 'integer', 'string': 'string', - 'float': 'number', 'path': 'string' - } - params = [] - - if matches := self.py_param_regex.findall(endpoint): - endpoint = re.sub(self.py_param_regex, self._py_repl, endpoint) - params = [] - for m in matches: - p = {'in': 'path', 'name': m[1], 'required': True} - if type_mapping.get(m[0]): - p['schema'] = {'type': type_mapping[m[0]]} - params.append(p) - return endpoint, params - - @staticmethod - def _py_repl(match): - return '{' + match.group('pname') + '}' - def process_methods(self): """ Create a dictionary of full names and their corresponding methods. """ - method_map = self.process_methods_helper( + method_map = self._process_methods_helper( 'objectSlices[].{fullName: fullName, resolvedMethods: usages[' - '].*.resolvedMethod[]}' - ) + '].*.resolvedMethod[]}') - calls = self.process_methods_helper( + calls = self._process_methods_helper( 'objectSlices[].{fullName: fullName, resolvedMethods: usages[' - '].invokedCalls[?resolvedMethod].resolvedMethod[]}' - ) + '].invokedCalls[?resolvedMethod].resolvedMethod[]}') - user_defined_types = self.process_methods_helper( + user_defined_types = self._process_methods_helper( 'userDefinedTypes[].{fullName: name, resolvedMethods: fields[' - '].name}' - ) + '].name}') for key, value in calls.items(): if method_map.get(key): method_map[key]['resolved_methods'].extend( @@ -207,20 +221,20 @@ def query_calls(self, full_name, resolved_methods): Returns: list: List of invoked calls and argument to calls. """ - result = self.query_calls_helper(full_name, '].invokedCalls[][]') - invokes = [] + result = self._query_calls_helper(full_name, '].invokedCalls[][]') + calls = [] for call in result: m = call.get('resolvedMethod', '') - if m in resolved_methods: - invokes.append(call) - result = self.query_calls_helper(full_name, '].argToCalls[][]') + if m and m in resolved_methods: + calls.append(call) + result = self._query_calls_helper(full_name, '].argToCalls[][]') for call in result: m = call.get('resolvedMethod', '') - if m in resolved_methods: - invokes.append(call) - return invokes + if m and m in resolved_methods: + calls.append(call) + return calls - def query_calls_helper(self, full_name, call_type_str): + def _query_calls_helper(self, full_name, call_type_str): """ A function to help query calls. @@ -244,45 +258,36 @@ def process_calls(self, method_map): Returns: dict: A new method map containing calls. """ - new_method_map = {} - - for call in method_map.keys(): - resolved_method_obj = method_map[call] - if res := self.query_calls(call, list(resolved_method_obj.keys())): - mmap = self.filter_calls(res, resolved_method_obj) - if new_method_map.get(call): - new_method_map[call]['endpoints'].update(mmap.get( - 'endpoints')) - new_method_map[call]['calls'].extend(mmap.get('calls')) - else: - new_method_map[call] = {'endpoints': mmap.get('endpoints')} + for full_name, resolved_methods in method_map['full_names'].items(): + if res := self.query_calls( + full_name, resolved_methods['resolved_methods'].keys()): + mmap = self.filter_calls(res, resolved_methods) else: - mmap = self.filter_calls([], resolved_method_obj) - if new_method_map.get(call): - new_method_map[call]['endpoints'].update( - mmap.get('endpoints')) - else: - new_method_map[call] = mmap - return new_method_map + mmap = self.filter_calls([], resolved_methods) + method_map['full_names'][full_name]['resolved_methods'] = ( + mmap.get('resolved_methods')) + + return method_map @staticmethod - def filter_calls(invokes, resolved_method_obj): + def filter_calls(queried_calls, resolved_methods): """ Iterate through the invokedCalls and argToCalls and create a relevant dictionary of endpoints and calls. Args: - invokes: list of invokes - resolved_method_obj: dictionary of resolved method objects + queried_calls: list of invokes + resolved_methods: dictionary of resolved method objects Returns: relevant: dictionary of relevant endpoints and calls """ - relevant = { - k: {'endpoints': v, 'calls': []} - for k, v in resolved_method_obj.items() - } - for i in invokes: - relevant[i.get('resolvedMethod')]['calls'].append(i) - return relevant + for method in resolved_methods['resolved_methods'].keys(): + calls = [ + i for i in queried_calls + if i.get('resolvedMethod', '') == method + ] + resolved_methods['resolved_methods'][method].update( + {'calls': calls}) + return resolved_methods def methods_to_endpoints(self, method_map): """ @@ -295,22 +300,42 @@ def methods_to_endpoints(self, method_map): Returns: dict: A new method map containing endpoints. """ - new_method_map = {} + reparsed = {'full_names': {}} + for full_name, resolved_methods in method_map.items(): + reparsed['full_names'] |= {full_name: { + 'resolved_methods': list(set(resolved_methods))} + } + new_method_map = {'full_names': {}} for full_name, resolved_methods in method_map.items(): - endpoints = {} - for method in resolved_methods: - if res := self.extract_endpoints(method): - endpoints[method] = {r: {} for r in res} - if endpoints: - new_method_map = endpoints + if new_resolved := self.process_resolved_methods(resolved_methods): + new_method_map['full_names'][full_name] = { + 'resolved_methods': new_resolved + } + return new_method_map - def process_methods_helper(self, pattern): + def process_resolved_methods(self, resolved_methods): + """ + + Args: + resolved_methods (list): + + Returns: + + """ + resolved_map = {} + for method in resolved_methods: + if endpoint := self.extract_endpoints(method): + resolved_map[method] = {'endpoints': endpoint} + return resolved_map + + def _process_methods_helper(self, pattern): """ Process the given pattern and return the resolved methods. Args: pattern (str): The pattern to be processed and resolved. + Returns: dict: The resolved methods. @@ -339,16 +364,37 @@ def populate_endpoints(self, method_map): """ paths_object = {} - for key in method_map.keys(): - for k in method_map[key].keys(): - to_add = self.create_paths_item(method_map[key][k]) - for x, y in to_add.items(): - if paths_object.get(x): - paths_object[x].update(y) + for resolved_methods in method_map.values(): + for value in resolved_methods.values(): + for m in value['resolved_methods'].items(): + new_path_item = self.create_paths_item(m) + if paths_object: + paths_object = self.merge_path_objects( + paths_object, new_path_item) else: - paths_object[x] = y + paths_object = new_path_item + return paths_object + @staticmethod + def merge_path_objects(p1, p2): + """ + Merge two dictionaries representing path objects. + + Args: + p1 (dict): The first dictionary representing a path object. + p2 (dict): The second dictionary representing a path object. + + Returns: + dict: The merged dictionary representing the path object. + """ + for key, value in p2.items(): + if p1.get(key): + p1[key].update(value) + else: + p1[key] = value + return p1 + def create_paths_item(self, paths_dict): """ Create paths item object based on provided endpoints and calls. @@ -358,30 +404,34 @@ def create_paths_item(self, paths_dict): dict: The paths item object """ - endpoints = paths_dict.get('endpoints', []) - calls = paths_dict.get('calls', []) + endpoints = paths_dict[1].get('endpoints') + calls = paths_dict[1].get('calls') paths_object = {} for ep in endpoints: paths_item_object = {} - for call in calls: - paths_item_object |= self.calls_to_params(ep, call) - if not calls: - paths_item_object = self.calls_to_params(ep) - if ':' in ep or '{' in ep: + if ':' in ep or '{' in ep or '<' in ep: match self.origin_type: case 'js' | 'ts' | 'javascript' | 'typescript': - [ep, tmp_paths_item_object] = self.js_helper(ep) + [ep, tmp_paths_item_object] = self._js_helper(ep) case 'py' | 'python': - [ep, tmp_paths_item_object] = self.py_helper(ep) + [ep, tmp_paths_item_object] = self.regex.py_helper(ep) case _: tmp_paths_item_object = self.generic_params_helper(ep) if tmp_paths_item_object: paths_item_object['parameters'] = tmp_paths_item_object - if paths_item_object and paths_object.get(ep): - paths_object[ep] |= paths_item_object - elif paths_item_object: - paths_object[ep] = paths_item_object + if calls: + for call in calls: + paths_item_object |= self.calls_to_params(ep, call) + else: + paths_item_object |= self.calls_to_params(ep) + if paths_item_object: + if paths_object.get(ep): + paths_object[ep] |= paths_item_object + else: + paths_object |= {ep: paths_item_object} + else: + paths_object[ep] = {} return paths_object @@ -402,8 +452,12 @@ def determine_operations(call, params): if found := [ op for op in ops if op in call.get('resolvedMethod', '').lower() ]: + if params: + return {op: { + 'parameters': params, 'responses': {}} for op in found + } return { - op: {'parameters': params, 'responses': {}} for op in found} + op: {'responses': {}} for op in found} return {'parameters': params} if params else {} def calls_to_params(self, ep, call=None): @@ -423,22 +477,25 @@ def calls_to_params(self, ep, call=None): params = [] if call_name in ops: params = self.create_param_object(ep, call) - return {call_name: {'parameters': params, 'responses': {}}} + result = {call_name: {'responses': {}}} + if params: + result[call_name] |= {'parameters': params} + return result return self.determine_operations(call, params) def create_param_object(self, ep, call=None): """ Create a parameter object for each parameter in the input list. + Args: call (dict): The call object ep (str): The endpoint + Returns: list: The list of parameter objects """ - params = [] - if '{' in ep: - params = self.generic_params_helper(ep) + params = self.generic_params_helper(ep) if '{' in ep else [] if not params and call: params = [ {'name': param, 'in': 'header'} @@ -480,11 +537,10 @@ def extract_endpoints(self, method): endpoints = [] if not method: return endpoints - if not (matches := re.findall(self.endpoints_regex, method)): + if not (matches := re.findall(self.regex.endpoints, method)): return endpoints matches = self.filter_matches(matches, method) - endpoints.extend([v for v in matches if v]) - return endpoints + return [v for v in matches if v] def filter_matches(self, matches, code): """ diff --git a/test/data/py-airflow-abbreviated-usages.json b/test/data/py-airflow-abbreviated-usages.json new file mode 100644 index 0000000..202c411 --- /dev/null +++ b/test/data/py-airflow-abbreviated-usages.json @@ -0,0 +1,3581 @@ +{ + "objectSlices": [ + { + "code": "", + "fullName": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "signature": "", + "fileName": "airflow/providers/celery/executors/celery_kubernetes_executor.py", + "lineNumber": 234, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 234, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 234, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_command", + "signature": "", + "fileName": "airflow/providers/celery/executors/celery_kubernetes_executor.py", + "lineNumber": 119, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "tmp5", + "typeFullName": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log", + "lineNumber": 128, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self.log", + "typeFullName": "ANY", + "resolvedMethod": ".fieldAccess", + "isExternal": null, + "lineNumber": 128, + "columnNumber": 9, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "debug", + "resolvedMethod": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log.debug", + "paramTypes": [ + "ANY", + "ANY", + "ANY", + "LAMBDA" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 128, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_command", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_command", + "isExternal": false, + "lineNumber": 119, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_command", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_command", + "isExternal": false, + "lineNumber": 119, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "priority", + "typeFullName": "__builtin.int", + "position": 3, + "lineNumber": 123, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "priority", + "typeFullName": "__builtin.int", + "position": 3, + "lineNumber": 123, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 3, + "isExternal": null, + "lineNumber": 129, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "command", + "typeFullName": "airflow/executors/base_executor.py:.CommandType", + "position": 2, + "lineNumber": 122, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "command", + "typeFullName": "airflow/executors/base_executor.py:.CommandType", + "position": 2, + "lineNumber": 122, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 2, + "isExternal": null, + "lineNumber": 129, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 121, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 121, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "_router", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance" + ], + "returnType": "ANY", + "position": 1, + "isExternal": null, + "lineNumber": 127, + "columnNumber": 20 + }, + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 1, + "isExternal": null, + "lineNumber": 129, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "queue", + "typeFullName": "ANY", + "position": 4, + "lineNumber": 124, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "queue", + "typeFullName": "ANY", + "position": 4, + "lineNumber": 124, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 4, + "isExternal": null, + "lineNumber": 129, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "executor", + "typeFullName": "ANY", + "lineNumber": 127, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self._router", + "typeFullName": "ANY", + "resolvedMethod": "self._router", + "isExternal": null, + "lineNumber": 127, + "columnNumber": 20, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 129, + "columnNumber": 9 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_task_instance", + "signature": "", + "fileName": "airflow/providers/celery/executors/celery_kubernetes_executor.py", + "lineNumber": 131, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 133, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 133, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "from_ti", + "resolvedMethod": "airflow/models/taskinstance.py:.SimpleTaskInstance.from_ti", + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance" + ], + "returnType": "ANY", + "position": 1, + "isExternal": false, + "lineNumber": 147, + "columnNumber": 33 + }, + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "task_instance", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "tmp6", + "typeFullName": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log", + "lineNumber": 148, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self.log", + "typeFullName": "ANY", + "resolvedMethod": ".fieldAccess", + "isExternal": null, + "lineNumber": 148, + "columnNumber": 9, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "debug", + "resolvedMethod": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log.debug", + "paramTypes": [ + "ANY", + "ANY", + "ANY", + "LAMBDA" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 148, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "pickle_id", + "typeFullName": "ANY", + "position": 3, + "lineNumber": 135, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "pickle_id", + "typeFullName": "ANY", + "position": 3, + "lineNumber": 135, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "pickle_id", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_task_instance", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_task_instance", + "isExternal": false, + "lineNumber": 131, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_task_instance", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor.queue_task_instance", + "isExternal": false, + "lineNumber": 131, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "executor", + "typeFullName": "ANY", + "lineNumber": 147, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self._router", + "typeFullName": "ANY", + "resolvedMethod": "self._router", + "isExternal": null, + "lineNumber": 147, + "columnNumber": 20, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "ignore_depends_on_past", + "typeFullName": "__builtin.bool", + "position": 5, + "lineNumber": 137, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_depends_on_past", + "typeFullName": "__builtin.bool", + "position": 5, + "lineNumber": 137, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_depends_on_past", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "SimpleTaskInstance", + "typeFullName": "airflow/models/taskinstance.py:.SimpleTaskInstance", + "lineNumber": 145, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 145, + "columnNumber": 9, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "from_ti", + "resolvedMethod": "airflow/models/taskinstance.py:.SimpleTaskInstance.from_ti", + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance" + ], + "returnType": "ANY", + "isExternal": false, + "lineNumber": 147, + "columnNumber": 33 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "wait_for_past_depends_before_skipping", + "typeFullName": "__builtin.bool", + "position": 6, + "lineNumber": 138, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "wait_for_past_depends_before_skipping", + "typeFullName": "__builtin.bool", + "position": 6, + "lineNumber": 138, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "wait_for_past_depends_before_skipping", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "cfg_path", + "typeFullName": "ANY", + "position": 10, + "lineNumber": 142, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "cfg_path", + "typeFullName": "ANY", + "position": 10, + "lineNumber": 142, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "cfg_path", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "ignore_ti_state", + "typeFullName": "__builtin.bool", + "position": 8, + "lineNumber": 140, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_ti_state", + "typeFullName": "__builtin.bool", + "position": 8, + "lineNumber": 140, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_ti_state", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "pool", + "typeFullName": "ANY", + "position": 9, + "lineNumber": 141, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "pool", + "typeFullName": "ANY", + "position": 9, + "lineNumber": 141, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "pool", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "mark_success", + "typeFullName": "__builtin.bool", + "position": 2, + "lineNumber": 134, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "mark_success", + "typeFullName": "__builtin.bool", + "position": 2, + "lineNumber": 134, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "mark_success", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "ignore_task_deps", + "typeFullName": "__builtin.bool", + "position": 7, + "lineNumber": 139, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_task_deps", + "typeFullName": "__builtin.bool", + "position": 7, + "lineNumber": 139, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_task_deps", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "ignore_all_deps", + "typeFullName": "__builtin.bool", + "position": 4, + "lineNumber": 136, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_all_deps", + "typeFullName": "__builtin.bool", + "position": 4, + "lineNumber": 136, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_all_deps", + "isExternal": null, + "lineNumber": 151, + "columnNumber": 9 + } + ] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "signature": "", + "fileName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py", + "lineNumber": 217, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 217, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 217, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_command", + "signature": "", + "fileName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py", + "lineNumber": 106, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_command", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_command", + "isExternal": false, + "lineNumber": 106, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_command", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_command", + "isExternal": false, + "lineNumber": 106, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 108, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 108, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "_router", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance" + ], + "returnType": "ANY", + "position": 1, + "isExternal": null, + "lineNumber": 114, + "columnNumber": 20 + }, + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 1, + "isExternal": null, + "lineNumber": 116, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "executor", + "typeFullName": "ANY", + "lineNumber": 114, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self._router", + "typeFullName": "ANY", + "resolvedMethod": "self._router", + "isExternal": null, + "lineNumber": 114, + "columnNumber": 20, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 116, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "command", + "typeFullName": "airflow/executors/base_executor.py:.CommandType", + "position": 2, + "lineNumber": 109, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "command", + "typeFullName": "airflow/executors/base_executor.py:.CommandType", + "position": 2, + "lineNumber": 109, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 2, + "isExternal": null, + "lineNumber": 116, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "tmp6", + "typeFullName": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log", + "lineNumber": 115, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self.log", + "typeFullName": "ANY", + "resolvedMethod": ".fieldAccess", + "isExternal": null, + "lineNumber": 115, + "columnNumber": 9, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "debug", + "resolvedMethod": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log.debug", + "paramTypes": [ + "ANY", + "ANY", + "ANY", + "LAMBDA" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 115, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "priority", + "typeFullName": "__builtin.int", + "position": 3, + "lineNumber": 110, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "priority", + "typeFullName": "__builtin.int", + "position": 3, + "lineNumber": 110, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 3, + "isExternal": null, + "lineNumber": 116, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "queue", + "typeFullName": "ANY", + "position": 4, + "lineNumber": 111, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "queue", + "typeFullName": "ANY", + "position": 4, + "lineNumber": 111, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_command", + "resolvedMethod": null, + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance", + "airflow/executors/base_executor.py:.CommandType", + "__builtin.int", + "ANY" + ], + "returnType": "ANY", + "position": 4, + "isExternal": null, + "lineNumber": 116, + "columnNumber": 9 + } + ] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_task_instance", + "signature": "", + "fileName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py", + "lineNumber": 118, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_task_instance", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_task_instance", + "isExternal": false, + "lineNumber": 118, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_task_instance", + "typeFullName": "ANY", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor.queue_task_instance", + "isExternal": false, + "lineNumber": 118, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "ignore_depends_on_past", + "typeFullName": "__builtin.bool", + "position": 5, + "lineNumber": 124, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_depends_on_past", + "typeFullName": "__builtin.bool", + "position": 5, + "lineNumber": 124, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_depends_on_past", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "wait_for_past_depends_before_skipping", + "typeFullName": "__builtin.bool", + "position": 6, + "lineNumber": 125, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "wait_for_past_depends_before_skipping", + "typeFullName": "__builtin.bool", + "position": 6, + "lineNumber": 125, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "wait_for_past_depends_before_skipping", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "ignore_task_deps", + "typeFullName": "__builtin.bool", + "position": 7, + "lineNumber": 126, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_task_deps", + "typeFullName": "__builtin.bool", + "position": 7, + "lineNumber": 126, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_task_deps", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "executor", + "typeFullName": "ANY", + "lineNumber": 134, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self._router", + "typeFullName": "ANY", + "resolvedMethod": "self._router", + "isExternal": null, + "lineNumber": 134, + "columnNumber": 20, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "cfg_path", + "typeFullName": "ANY", + "position": 10, + "lineNumber": 129, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "cfg_path", + "typeFullName": "ANY", + "position": 10, + "lineNumber": 129, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "cfg_path", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "tmp7", + "typeFullName": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log", + "lineNumber": 135, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "self.log", + "typeFullName": "ANY", + "resolvedMethod": ".fieldAccess", + "isExternal": null, + "lineNumber": 135, + "columnNumber": 9, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "debug", + "resolvedMethod": "airflow/utils/log/logging_mixin.py:.LoggingMixin.log.debug", + "paramTypes": [ + "ANY", + "ANY", + "ANY", + "LAMBDA" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 135, + "columnNumber": 9 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "ignore_all_deps", + "typeFullName": "__builtin.bool", + "position": 4, + "lineNumber": 123, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_all_deps", + "typeFullName": "__builtin.bool", + "position": 4, + "lineNumber": 123, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_all_deps", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "SimpleTaskInstance", + "typeFullName": "airflow/models/taskinstance.py:.SimpleTaskInstance", + "lineNumber": 132, + "columnNumber": 9, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 132, + "columnNumber": 9, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "from_ti", + "resolvedMethod": "airflow/models/taskinstance.py:.SimpleTaskInstance.from_ti", + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance" + ], + "returnType": "ANY", + "isExternal": false, + "lineNumber": 134, + "columnNumber": 33 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "pickle_id", + "typeFullName": "ANY", + "position": 3, + "lineNumber": 122, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "pickle_id", + "typeFullName": "ANY", + "position": 3, + "lineNumber": 122, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "pickle_id", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "mark_success", + "typeFullName": "__builtin.bool", + "position": 2, + "lineNumber": 121, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "mark_success", + "typeFullName": "__builtin.bool", + "position": 2, + "lineNumber": 121, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "mark_success", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "pool", + "typeFullName": "ANY", + "position": 9, + "lineNumber": 128, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "pool", + "typeFullName": "ANY", + "position": 9, + "lineNumber": 128, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "pool", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 120, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "task_instance", + "typeFullName": "airflow/models/taskinstance.py:.TaskInstance", + "position": 1, + "lineNumber": 120, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "from_ti", + "resolvedMethod": "airflow/models/taskinstance.py:.SimpleTaskInstance.from_ti", + "paramTypes": [ + "airflow/models/taskinstance.py:.TaskInstance" + ], + "returnType": "ANY", + "position": 1, + "isExternal": false, + "lineNumber": 134, + "columnNumber": 33 + }, + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "task_instance", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + }, + { + "targetObj": { + "name": "ignore_ti_state", + "typeFullName": "__builtin.bool", + "position": 8, + "lineNumber": 127, + "columnNumber": 9, + "label": "PARAM" + }, + "definedBy": { + "name": "ignore_ti_state", + "typeFullName": "__builtin.bool", + "position": 8, + "lineNumber": 127, + "columnNumber": 9, + "label": "PARAM" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "queue_task_instance", + "resolvedMethod": null, + "paramTypes": [], + "returnType": "ANY", + "position": "ignore_ti_state", + "isExternal": null, + "lineNumber": 138, + "columnNumber": 9 + } + ] + } + ] + }, + { + "code": "", + "fullName": "airflow/utils/serve_logs.py:.create_app", + "signature": "", + "fileName": "airflow/utils/serve_logs.py", + "lineNumber": 44, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "create_app", + "typeFullName": "flask.py:.Flask", + "resolvedMethod": "airflow/utils/serve_logs.py:.create_app", + "isExternal": false, + "lineNumber": 167, + "columnNumber": 16, + "label": "CALL" + }, + "definedBy": { + "name": "create_app", + "typeFullName": "flask.py:.Flask", + "resolvedMethod": "airflow/utils/serve_logs.py:.create_app", + "isExternal": false, + "lineNumber": 167, + "columnNumber": 16, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "flask_app", + "typeFullName": "flask.py:.Flask", + "lineNumber": 45, + "columnNumber": 5, + "label": "LOCAL" + }, + "definedBy": { + "name": "Flask", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Flask.__init__", + "isExternal": null, + "lineNumber": 45, + "columnNumber": 17, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Flask.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 130, + "columnNumber": 6 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "tmp0", + "typeFullName": "airflow/sensors/filesystem.py:.FileSensor.path", + "lineNumber": 47, + "columnNumber": 21, + "label": "LOCAL" + }, + "definedBy": { + "name": "os.path", + "typeFullName": "ANY", + "resolvedMethod": ".fieldAccess", + "isExternal": null, + "lineNumber": 47, + "columnNumber": 21, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "expanduser", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 47, + "columnNumber": 21 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "log_config_class", + "typeFullName": "ANY", + "lineNumber": 48, + "columnNumber": 5, + "label": "LOCAL" + }, + "definedBy": { + "name": "conf.get", + "typeFullName": "ANY", + "resolvedMethod": "airflow/configuration.py:.conf.get", + "isExternal": null, + "lineNumber": 48, + "columnNumber": 24, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY", + "ANY" + ], + "returnType": "ANY", + "position": 2, + "isExternal": null, + "lineNumber": 50, + "columnNumber": 9 + }, + { + "callName": "import_string", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "position": 1, + "isExternal": null, + "lineNumber": 52, + "columnNumber": 30 + } + ] + }, + { + "targetObj": { + "name": "base_log_folder", + "typeFullName": "__builtin.None", + "lineNumber": 54, + "columnNumber": 17, + "label": "LOCAL" + }, + "definedBy": { + "name": "logging_config[\"handlers\"][\"task\"][\"base_log_folder\"]", + "typeFullName": "ANY", + "resolvedMethod": ".indexAccess", + "isExternal": null, + "lineNumber": 54, + "columnNumber": 35, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "warning", + "resolvedMethod": null, + "paramTypes": [ + "ANY", + "__builtin.None" + ], + "returnType": "ANY", + "position": 2, + "isExternal": null, + "lineNumber": 64, + "columnNumber": 17 + } + ] + }, + { + "targetObj": { + "name": "expiration_time_in_seconds", + "typeFullName": "ANY", + "lineNumber": 46, + "columnNumber": 5, + "label": "LOCAL" + }, + "definedBy": { + "name": "conf.getint", + "typeFullName": "ANY", + "resolvedMethod": "airflow/configuration.py:.conf.getint", + "isExternal": null, + "lineNumber": 46, + "columnNumber": 34, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "JWTSigner", + "resolvedMethod": "airflow/utils/jwt_signer.py:.JWTSigner.__init__", + "paramTypes": [], + "returnType": "ANY", + "position": "expiration_time_in_seconds", + "isExternal": false, + "lineNumber": 71, + "columnNumber": 14 + } + ] + }, + { + "targetObj": { + "name": "route", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Flask.route", + "isExternal": true, + "lineNumber": 130, + "columnNumber": 6, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Flask.route", + "isExternal": true, + "lineNumber": 130, + "columnNumber": 6, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "signer", + "typeFullName": "airflow/utils/jwt_signer.py:.JWTSigner", + "lineNumber": 71, + "columnNumber": 5, + "label": "LOCAL" + }, + "definedBy": { + "name": "JWTSigner", + "typeFullName": "ANY", + "resolvedMethod": "airflow/utils/jwt_signer.py:.JWTSigner.__init__", + "isExternal": null, + "lineNumber": 71, + "columnNumber": 14, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "verify_token", + "resolvedMethod": "airflow/utils/jwt_signer.py:.JWTSigner.verify_token", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": false, + "lineNumber": 85, + "columnNumber": 23 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "", + "typeFullName": "ANY", + "lineNumber": 18, + "columnNumber": 1, + "label": "UNKNOWN" + }, + "definedBy": { + "name": "", + "typeFullName": "ANY", + "lineNumber": 18, + "columnNumber": 1, + "label": "UNKNOWN" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "request", + "typeFullName": "flask.py:.request", + "lineNumber": 24, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 24, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "get_json", + "resolvedMethod": "flask.py:.request.get_json", + "paramTypes": [], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 88, + "columnNumber": 12 + }, + { + "callName": "get_json", + "resolvedMethod": "flask.py:.request.get_json", + "paramTypes": [], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 380, + "columnNumber": 14 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "pool_api", + "typeFullName": "airflow/api/common/experimental.py:.pool", + "lineNumber": 27, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 27, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "get_pool", + "resolvedMethod": "airflow/api/common/experimental.py:.pool.get_pool", + "paramTypes": [], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 351, + "columnNumber": 16 + }, + { + "callName": "get_pools", + "resolvedMethod": "airflow/api/common/experimental.py:.pool.get_pools", + "paramTypes": [], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 366, + "columnNumber": 17 + }, + { + "callName": "create_pool", + "resolvedMethod": "airflow/api/common/experimental.py:.pool.create_pool", + "paramTypes": [], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 382, + "columnNumber": 16 + }, + { + "callName": "delete_pool", + "resolvedMethod": "airflow/api/common/experimental.py:.pool.delete_pool", + "paramTypes": [], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 397, + "columnNumber": 16 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "Blueprint", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.__init__", + "isExternal": true, + "lineNumber": 331, + "columnNumber": 14, + "label": "CALL" + }, + "definedBy": { + "name": "Blueprint", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.__init__", + "isExternal": true, + "lineNumber": 331, + "columnNumber": 14, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "g", + "typeFullName": "flask.py:.g", + "lineNumber": 24, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 24, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "getattr", + "resolvedMethod": "__builtin.getattr", + "paramTypes": [ + "flask.py:.g", + "ANY", + "ANY" + ], + "returnType": "ANY", + "position": 1, + "isExternal": true, + "lineNumber": 134, + "columnNumber": 8 + } + ] + }, + { + "targetObj": { + "name": "trigger", + "typeFullName": "airflow/api/common/experimental.py:.trigger_dag", + "lineNumber": 27, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 27, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "trigger_dag", + "resolvedMethod": "airflow/api/common/experimental.py:.trigger_dag.trigger_dag", + "paramTypes": [ + "__builtin.str", + "__builtin.None", + "__builtin.None", + "ANY", + "__builtin.bool" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 127, + "columnNumber": 14 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "getLogger", + "typeFullName": "ANY", + "resolvedMethod": "airflow/www/api/experimental/logging.py:.getLogger", + "isExternal": true, + "lineNumber": 43, + "columnNumber": 7, + "label": "CALL" + }, + "definedBy": { + "name": "getLogger", + "typeFullName": "ANY", + "resolvedMethod": "airflow/www/api/experimental/logging.py:.getLogger", + "isExternal": true, + "lineNumber": 43, + "columnNumber": 7, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "after_request", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.after_request", + "isExternal": true, + "lineNumber": 81, + "columnNumber": 1, + "label": "CALL" + }, + "definedBy": { + "name": "after_request", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.after_request", + "isExternal": true, + "lineNumber": 81, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "route", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": 25, + "columnNumber": 2, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": 25, + "columnNumber": 2, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [] + }, + { + "targetObj": { + "name": "api_experimental", + "typeFullName": "flask.py:.Blueprint", + "lineNumber": 59, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "Blueprint", + "typeFullName": "ANY", + "resolvedMethod": "flask.py:.Blueprint.__init__", + "isExternal": null, + "lineNumber": 59, + "columnNumber": 20, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "after_request", + "resolvedMethod": "flask.py:.Blueprint.after_request", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 81, + "columnNumber": 1 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 84, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 143, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 157, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 182, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 189, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 196, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 209, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 227, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 240, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 249, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 288, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 323, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 346, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 361, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 376, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 392, + "columnNumber": 2 + }, + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 407, + "columnNumber": 2 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "delete", + "typeFullName": "airflow/api/common/experimental.py:.delete_dag", + "lineNumber": 27, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 27, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "delete_dag", + "resolvedMethod": "airflow/api/common/experimental.py:.delete_dag.delete_dag", + "paramTypes": [ + "__builtin.str" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 148, + "columnNumber": 17 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "version", + "typeFullName": "airflow/version.py:.version", + "lineNumber": 38, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 38, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "jsonify", + "resolvedMethod": "flask.py:.jsonify", + "paramTypes": [], + "returnType": "ANY", + "position": "version", + "isExternal": true, + "lineNumber": 193, + "columnNumber": 12 + } + ] + }, + { + "targetObj": { + "name": "timezone", + "typeFullName": "airflow/utils.py:.timezone", + "lineNumber": 35, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 35, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "parse", + "resolvedMethod": "airflow/utils.py:.timezone.parse", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 110, + "columnNumber": 30 + }, + { + "callName": "parse", + "resolvedMethod": "airflow/utils.py:.timezone.parse", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 263, + "columnNumber": 26 + }, + { + "callName": "parse", + "resolvedMethod": "airflow/utils.py:.timezone.parse", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 300, + "columnNumber": 26 + }, + { + "callName": "parse", + "resolvedMethod": "airflow/utils.py:.timezone.parse", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 413, + "columnNumber": 24 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "T", + "typeFullName": "typing.py:.TypeVar", + "lineNumber": 45, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "TypeVar", + "typeFullName": "ANY", + "resolvedMethod": "typing.py:.TypeVar.__init__", + "isExternal": null, + "lineNumber": 45, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "cast", + "resolvedMethod": "typing.py:.cast", + "paramTypes": [ + "typing.py:.TypeVar", + "airflow/www/api/experimental/endpoints.py:.requires_authentication.decorated", + "LAMBDA" + ], + "returnType": "ANY", + "position": 1, + "isExternal": true, + "lineNumber": 56, + "columnNumber": 12 + } + ] + }, + { + "targetObj": { + "name": "Callable", + "typeFullName": "typing.py:.Callable", + "lineNumber": 22, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 22, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [], + "argToCalls": [ + { + "callName": "TypeVar", + "resolvedMethod": "typing.py:.TypeVar.__init__", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "position": "bound", + "isExternal": true, + "lineNumber": 45, + "columnNumber": 5 + } + ] + }, + { + "targetObj": { + "name": "logging", + "typeFullName": "airflow/www/api/experimental/logging.py:", + "lineNumber": 20, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "import", + "typeFullName": "ANY", + "resolvedMethod": "import", + "isExternal": null, + "lineNumber": 20, + "columnNumber": 1, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "getLogger", + "resolvedMethod": "airflow/www/api/experimental/logging.py:.getLogger", + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": true, + "lineNumber": 43, + "columnNumber": 7 + } + ], + "argToCalls": [] + }, + { + "targetObj": { + "name": "log", + "typeFullName": "ANY", + "lineNumber": 43, + "columnNumber": 1, + "label": "LOCAL" + }, + "definedBy": { + "name": "logging.getLogger", + "typeFullName": "ANY", + "resolvedMethod": "airflow/www/api/experimental/logging.py:.getLogger", + "isExternal": null, + "lineNumber": 43, + "columnNumber": 7, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "__builtin.str" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 99, + "columnNumber": 13 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 112, + "columnNumber": 13 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 129, + "columnNumber": 9 + }, + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY", + "ANY", + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 135, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 150, + "columnNumber": 9 + }, + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 174, + "columnNumber": 9 + }, + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 203, + "columnNumber": 9 + }, + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 216, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 265, + "columnNumber": 9 + }, + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 278, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 302, + "columnNumber": 9 + }, + { + "callName": "info", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 315, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 353, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 368, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 384, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 399, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 415, + "columnNumber": 9 + }, + { + "callName": "error", + "resolvedMethod": null, + "paramTypes": [ + "ANY" + ], + "returnType": "ANY", + "isExternal": null, + "lineNumber": 428, + "columnNumber": 9 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "signature": "", + "fileName": "airflow/providers/celery/executors/celery_kubernetes_executor.py", + "lineNumber": 234, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "_router", + "typeFullName": "", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 234, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "_router", + "typeFullName": "", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 234, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "resolvedMethod": "airflow/providers/celery/executors/celery_kubernetes_executor.py:.CeleryKubernetesExecutor._router", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 234, + "columnNumber": 5 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "signature": "", + "fileName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py", + "lineNumber": 217, + "columnNumber": 5, + "usages": [ + { + "targetObj": { + "name": "_router", + "typeFullName": "", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 217, + "columnNumber": 5, + "label": "CALL" + }, + "definedBy": { + "name": "_router", + "typeFullName": "", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "isExternal": false, + "lineNumber": 217, + "columnNumber": 5, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "resolvedMethod": "airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py:.LocalKubernetesExecutor._router", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 217, + "columnNumber": 5 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/utils/serve_logs.py:.create_app", + "signature": "", + "fileName": "airflow/utils/serve_logs.py", + "lineNumber": 44, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Flask.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Flask.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Flask.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 130, + "columnNumber": 6 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 84, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 143, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 157, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 182, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 189, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 196, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 209, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 227, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 240, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 249, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 288, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 323, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 346, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 361, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 376, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 392, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/api/experimental/endpoints.py:", + "signature": "", + "fileName": "airflow/www/api/experimental/endpoints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 407, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + }, + { + "code": "", + "fullName": "airflow/www/blueprints.py:", + "signature": "", + "fileName": "airflow/www/blueprints.py", + "lineNumber": 18, + "columnNumber": 1, + "usages": [ + { + "targetObj": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "definedBy": { + "name": "route", + "typeFullName": "", + "resolvedMethod": "flask.py:.Blueprint.route", + "isExternal": true, + "lineNumber": null, + "columnNumber": null, + "label": "CALL" + }, + "invokedCalls": [ + { + "callName": "route", + "resolvedMethod": "flask.py:.Blueprint.route", + "paramTypes": [], + "returnType": "", + "isExternal": true, + "lineNumber": 25, + "columnNumber": 2 + } + ], + "argToCalls": [] + } + ] + } + ], + "userDefinedTypes": [] +} \ No newline at end of file diff --git a/test/test_converter.py b/test/test_converter.py index c42b230..34fcd5a 100644 --- a/test/test_converter.py +++ b/test/test_converter.py @@ -28,7 +28,7 @@ def js_usages_2(): @pytest.fixture def py_usages_1(): - return OpenAPI('openapi3.0.1', 'python', 'test/data/py-depscan-usages.json') + return OpenAPI('openapi3.0.1', 'python', 'test/data/py-airflow-abbreviated-usages.json') @pytest.fixture @@ -36,870 +36,973 @@ def py_usages_2(): return OpenAPI('openapi3.0.1', 'py', 'test/data/py-tornado-usages.json') -def test_populate_endpoints(java_usages_1, java_usages_2, js_usages_1, - js_usages_2, py_usages_1, py_usages_2): - methods = java_usages_1.process_methods() - methods = java_usages_1.methods_to_endpoints(methods) - methods = java_usages_1.process_calls(methods) - assert java_usages_1.populate_endpoints(methods) == { - '/': {'post': {'parameters': [], 'responses': {}}}, - '/accounts/{accountName}': {'get': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}}, - '/current': {'get': {'parameters': [], 'responses': {}}, - 'put': {'parameters': [], 'responses': {}}}, - '/latest': {'get': {'parameters': [], 'responses': {}}}, - '/statistics/{accountName}': {'put': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}}, - '/uaa/users': {'post': {'parameters': [], 'responses': {}}}, - '/{accountName}': {'get': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}, 'put': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}}, '/{name}': {'get': { - 'parameters': [{'in': 'path', 'name': 'name', 'required': True}], - 'responses': {}}}} - - methods = java_usages_2.process_methods() - methods = java_usages_2.methods_to_endpoints(methods) - methods = java_usages_2.process_calls(methods) - assert java_usages_2.populate_endpoints(methods) == { - '/': {'get': {'parameters': [], 'responses': {}}}, - '/Digester/sec': {'post': {'parameters': [], 'responses': {}}}, - '/Digester/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/Sec': {'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/xinclude/sec': { - 'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/xinclude/vuln': { - 'post': {'parameters': [], 'responses': {}}}, - '/DocumentHelper/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/HttpSyncClients/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/HttpURLConnection/sec': {'get': {'parameters': [], 'responses': {}}}, - '/HttpURLConnection/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/IOUtils/sec': {'get': {'parameters': [], 'responses': {}}}, - '/ImageIO/sec': {'get': {'parameters': [], 'responses': {}}}, - '/Jsoup/sec': {'get': {'parameters': [], 'responses': {}}}, - '/ProcessBuilder': {'get': {'parameters': [], 'responses': {}}}, - '/SAXBuilder/sec': {'post': {'parameters': [], 'responses': {}}}, - '/SAXBuilder/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/SAXParser/sec': {'post': {'parameters': [], 'responses': {}}}, - '/SAXParser/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/SAXReader/sec': {'post': {'parameters': [], 'responses': {}}}, - '/SAXReader/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/XMLReader/sec': {'post': {'parameters': [], 'responses': {}}}, - '/XMLReader/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/any': {'get': {'parameters': [], 'responses': {}}}, - '/application/javascript': {'get': {'parameters': [], 'responses': {}}}, - '/codeinject': {'get': {'parameters': [], 'responses': {}}}, - '/codeinject/host': {'get': {'parameters': [], 'responses': {}}}, - '/codeinject/sec': {'get': {'parameters': [], 'responses': {}}}, - '/commonsHttpClient/sec': {'get': {'parameters': [], 'responses': {}}}, - '/createToken': {'get': {'parameters': [], 'responses': {}}}, - '/deserialize': {'post': {'parameters': [], 'responses': {}}}, - '/dnsrebind/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/exclued/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/fastjsonp/getToken': {'get': {'parameters': [], 'responses': {}}}, - '/getName': {'get': {'parameters': [], 'responses': {}}}, - '/getToken': {'get': {'parameters': [], 'responses': {}}}, - '/httpclient/sec': {'get': {'parameters': [], 'responses': {}}}, - '/hutool/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/jscmd': {'get': {'parameters': [], 'responses': {}}}, - '/log4j': {'get': {'parameters': [], 'responses': {}}}, - '/logout': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/orderby/sec04': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/orderby/vuln03': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/sec01': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/sec02': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/sec03': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/vuln01': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/vuln02': {'get': {'parameters': [], 'responses': {}}}, - '/okhttp/sec': {'get': {'parameters': [], 'responses': {}}}, - '/openStream': {'get': {'parameters': [], 'responses': {}}}, - '/path_traversal/sec': {'get': {'parameters': [], 'responses': {}}}, - '/path_traversal/vul': {'get': {'parameters': [], 'responses': {}}}, - '/pic': {'get': {'parameters': [], 'responses': {}}}, - '/post': {'post': {'parameters': [], 'responses': {}}}, - '/postgresql': {'post': {'parameters': [], 'responses': {}}}, - '/readxlsx': {'post': {'parameters': [], 'responses': {}}}, - '/redirect': {'get': {'parameters': [], 'responses': {}}}, - '/request/sec': {'get': {'parameters': [], 'responses': {}}}, - '/restTemplate/vuln1': {'get': {'parameters': [], 'responses': {}}}, - '/restTemplate/vuln2': {'get': {'parameters': [], 'responses': {}}}, - '/runtime/exec': {'get': {'parameters': [], 'responses': {}}}, - '/sec': {'get': {'parameters': [], 'responses': {}}}, - '/sec/array_indexOf': {'get': {'parameters': [], 'responses': {}}}, - '/sec/checkOrigin': {'get': {'parameters': [], 'responses': {}}}, - '/sec/crossOrigin': {'get': {'parameters': [], 'responses': {}}}, - '/sec/httpCors': {'get': {'parameters': [], 'responses': {}}}, - '/sec/originFilter': {'get': {'parameters': [], 'responses': {}}}, - '/sec/webMvcConfigurer': {'get': {'parameters': [], 'responses': {}}}, - '/sec/yarm': {'get': {'parameters': [], 'responses': {}}}, - '/setHeader': {'head': {'parameters': [], 'responses': {}}}, - '/spel/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/status': {'get': {'parameters': [], 'responses': {}}}, - '/upload': {'get': {'parameters': [], 'responses': {}}, - 'post': {'parameters': [], 'responses': {}}}, - '/upload/picture': {'post': {'parameters': [], 'responses': {}}}, - '/urlConnection/sec': {'get': {'parameters': [], 'responses': {}}}, - '/urlConnection/vuln': {'get': {'parameters': [], 'responses': {}}, - 'post': {'parameters': [], 'responses': {}}}, - '/velocity': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/contains': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/endsWith': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/origin': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/regex': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/setHeader': {'get': {'parameters': [], 'responses': {}}, - 'head': {'parameters': [], 'responses': {}}}, - '/vuln/url_bypass': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/yarm': {'get': {'parameters': [], 'responses': {}}}, - '/vuln01': {'get': {'parameters': [], 'responses': {}}}, - '/vuln02': {'get': {'parameters': [], 'responses': {}}}, - '/vuln03': {'get': {'parameters': [], 'responses': {}}}, - '/vuln04': {'get': {'parameters': [], 'responses': {}}}, - '/vuln05': {'get': {'parameters': [], 'responses': {}}}, - '/vuln06': {'get': {'parameters': [], 'responses': {}}}, - '/xmlReader/sec': {'post': {'parameters': [], 'responses': {}}}, - '/xmlReader/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/xmlbeam/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/xstream': {'post': {'parameters': [], 'responses': {}}}} - - methods = js_usages_1.process_calls({'routes\\dataErasure.ts::program': { - "router.post('/',async(req:Request," - "Record,DataErasureRequestParams>,res:Response," - "next:NextFunction):Promise=>{" - "\rconstloggedInUser=insecurity.authenticatedUsers.get(" - "req.cookies.token)\rif(!loggedInUser){\rnext(newError(" - "'Blockedillegalactivityby'+req.socket.remoteAddress))\rreturn\r}\r" - "\rtry{\rawaitPrivacyRequestModel.create({" - "\rUserId:loggedInUser.data.id," - "\rdeletionRequested:true\r})\r\rres.clearCookie('token')\rif(" - "req.body.layout){\rconstfilePath:string=path.resolve(" - "req.body.layout).toLowerCase()\rconstisForbiddenFile:boolean=(" - "filePath.includes('ftp')||filePath.includes(" - "'ctf.key')||filePath.includes('encryptionkeys'))\rif(" - "!isForbiddenFile){\rres.render('dataErasureResult'," - "{\r...req.body\r},(error,html)=>{\rif(!html||error){\rnext(newError(" - "error.message))\r}else{\r...": { - '/': {}}, - "router.get('/',async(req:Request,res:Response," - "next:NextFunction):Promise=>{" - "\rconstloggedInUser=insecurity.authenticatedUsers.get(" - "req.cookies.token)\rif(!loggedInUser){\rnext(newError(" - "'Blockedillegalactivityby'+req.socket.remoteAddress))\rreturn\r" - "}\rconstemail=loggedInUser.data.email\r\rtry{" - "\rconstanswer=awaitSecurityAnswerModel.findOne({\rinclude:[{" - "\rmodel:UserModel,\rwhere:{email}\r}]\r})\rif(answer==null){" - "\rthrownewError(" - "'Noanswerfound!')\r}\rconstquestion=awaitSecurityQuestionModel" - ".findByPk(answer.SecurityQuestionId)\rif(question==null){" - "\rthrownewError('Noquestionfound!')\r}\r\rres.render(" - "'dataErasureForm',{userEmail:email," - "securityQuestion:question.question})\r}catch(error){\rnext(" - "error)\r}\r})": { - '/': {}}}, 'server.ts::program': { - "app.use('/assets/public/images/padding'," - "verify.accessControlChallenges())": { - '/assets/public/images/padding': {}}, - "app.get('/rest/admin/application-version',appVersion())": { - '/rest/admin/application-version': {}}, - "app.use('/ftp',serveIndexMiddleware,serveIndex('ftp',{icons:true}))": { - '/ftp': {}}, - "app.post('/api/SecurityQuestions',security.denyAll())": { - '/api/SecurityQuestions': {}}, - "app.use(robots({UserAgent:'*',Disallow:'/ftp'}))": {'/ftp': {}}, - "app.delete('/api/Cards/:id',security.appendUserId()," - "payment.delPaymentMethodById())": { - '/api/Cards/{id}': {}}, - "app.get('/rest/image-captcha',imageCaptcha())": { - '/rest/image-captcha': {}}, - "app.get('/promotion',videoHandler.promotionVideo())": { - '/promotion': {}}, - "app.get('/snippets/:challenge',vulnCodeSnippet.serveCodeSnippet())": { - '/snippets/{challenge}': {}}, - "app.put('/rest/continue-code-findIt/apply/:continueCode'," - "restoreProgress.restoreProgressFindIt())": { - '/rest/continue-code-findIt/apply/{continueCode}': {}}}}) +def test_populate_endpoints(js_usages_1, js_usages_2): + # The populate_endpoints method is the final operation in convert_usages. + # However, it's difficult to test the output when the order of params can + # differ. + methods = js_usages_1.process_methods() + methods = js_usages_1.methods_to_endpoints(methods) + assert methods == { + 'full_names': {'routes\\dataErasure.ts::program': { + 'resolved_methods': { + "router.get('/',async(req:Request,res:Response," + "next:NextFunction):Promise=>{" + "\rconstloggedInUser=insecurity.authenticatedUsers.get(" + "req.cookies.token)\rif(!loggedInUser){\rnext(newError(" + "'Blockedillegalactivityby'+req.socket.remoteAddress))\rreturn\r" + "}\rconstemail=loggedInUser.data.email\r\rtry{" + "\rconstanswer=awaitSecurityAnswerModel.findOne({\rinclude:[{" + "\rmodel:UserModel,\rwhere:{email}\r}]\r})\rif(answer==null){" + "\rthrownewError(" + "'Noanswerfound!')\r}\rconstquestion=awaitSecurityQuestionModel" + ".findByPk(answer.SecurityQuestionId)\rif(question==null){" + "\rthrownewError('Noquestionfound!')\r}\r\rres.render(" + "'dataErasureForm',{userEmail:email," + "securityQuestion:question.question})\r}catch(error){\rnext(" + "error)\r}\r})": { + 'endpoints': ['/']}, + "router.post('/',async(req:Request," + "Record,DataErasureRequestParams>,res:Response," + "next:NextFunction):Promise=>{" + "\rconstloggedInUser=insecurity.authenticatedUsers.get(" + "req.cookies.token)\rif(!loggedInUser){\rnext(newError(" + "'Blockedillegalactivityby'+req.socket.remoteAddress))\rreturn\r" + "}\r\rtry{\rawaitPrivacyRequestModel.create({" + "\rUserId:loggedInUser.data.id," + "\rdeletionRequested:true\r})\r\rres.clearCookie('token')\rif(" + "req.body.layout){\rconstfilePath:string=path.resolve(" + "req.body.layout).toLowerCase()\rconstisForbiddenFile:boolean=(" + "filePath.includes('ftp')||filePath.includes(" + "'ctf.key')||filePath.includes('encryptionkeys'))\rif(" + "!isForbiddenFile){\rres.render('dataErasureResult'," + "{\r...req.body\r},(error,html)=>{\rif(!html||error){\rnext(" + "newError(error.message))\r}else{\r...": { + 'endpoints': ['/']}}}, 'server.ts::program': { + 'resolved_methods': { + "app.delete('/api/Addresss/:id',security.appendUserId()," + "address.delAddressById())": { + 'endpoints': ['/api/Addresss/:id']}, + "app.delete('/api/Cards/:id',security.appendUserId()," + "payment.delPaymentMethodById())": { + 'endpoints': ['/api/Cards/:id']}, + "app.delete('/api/Products/:id',security.denyAll())": { + 'endpoints': ['/api/Products/:id']}, + "app.delete('/api/Quantitys/:id',security.denyAll())": { + 'endpoints': ['/api/Quantitys/:id']}, + "app.delete('/api/Recycles/:id',security.denyAll())": { + 'endpoints': ['/api/Recycles/:id']}, + "app.get('/api/Addresss',security.appendUserId()," + "address.getAddress())": { + 'endpoints': ['/api/Addresss']}, + "app.get('/api/Addresss/:id',security.appendUserId()," + "address.getAddressById())": { + 'endpoints': ['/api/Addresss/:id']}, + "app.get('/api/Cards',security.appendUserId()," + "payment.getPaymentMethods())": { + 'endpoints': ['/api/Cards']}, + "app.get('/api/Cards/:id',security.appendUserId()," + "payment.getPaymentMethodById())": { + 'endpoints': ['/api/Cards/:id']}, + "app.get('/api/Complaints',security.isAuthorized())": { + 'endpoints': ['/api/Complaints']}, + "app.get('/api/Deliverys',delivery.getDeliveryMethods())": { + 'endpoints': ['/api/Deliverys']}, + "app.get('/api/Deliverys/:id',delivery.getDeliveryMethod())": { + 'endpoints': ['/api/Deliverys/:id']}, + "app.get('/api/PrivacyRequests',security.denyAll())": { + 'endpoints': ['/api/PrivacyRequests']}, + "app.get('/api/Recycles',recycles.blockRecycleItems())": { + 'endpoints': ['/api/Recycles']}, + "app.get('/api/Recycles/:id',recycles.getRecycleItem())": { + 'endpoints': ['/api/Recycles/:id']}, + "app.get('/api/SecurityAnswers',security.denyAll())": { + 'endpoints': ['/api/SecurityAnswers']}, + "app.get('/api/Users',security.isAuthorized())": { + 'endpoints': ['/api/Users']}, + "app.get('/metrics',metrics.serveMetrics())": { + 'endpoints': ['/metrics']}, + "app.get('/profile',security.updateAuthenticatedUsers()," + "userProfile())": { + 'endpoints': ['/profile']}, + "app.get('/promotion',videoHandler.promotionVideo())": { + 'endpoints': ['/promotion']}, + "app.get('/redirect',redirect())": {'endpoints': ['/redirect']}, + "app.get('/rest/2fa/status',security.isAuthorized()," + "twoFactorAuth.status())": { + 'endpoints': ['/rest/2fa/status']}, + "app.get('/rest/admin/application-configuration'," + "appConfiguration())": { + 'endpoints': ['/rest/admin/application-configuration']}, + "app.get('/rest/admin/application-version',appVersion())": { + 'endpoints': ['/rest/admin/application-version']}, + "app.get('/rest/basket/:id',basket())": { + 'endpoints': ['/rest/basket/:id']}, + "app.get('/rest/captcha',captcha())": { + 'endpoints': ['/rest/captcha']}, + "app.get('/rest/chatbot/status',chatbot.status())": { + 'endpoints': ['/rest/chatbot/status']}, + "app.get('/rest/continue-code',continueCode.continueCode())": { + 'endpoints': ['/rest/continue-code']}, + "app.get('/rest/continue-code-findIt'," + "continueCode.continueCodeFindIt())": { + 'endpoints': ['/rest/continue-code-findIt']}, + "app.get('/rest/continue-code-fixIt'," + "continueCode.continueCodeFixIt())": { + 'endpoints': ['/rest/continue-code-fixIt']}, + "app.get('/rest/country-mapping',countryMapping())": { + 'endpoints': ['/rest/country-mapping']}, + "app.get('/rest/deluxe-membership',deluxe.deluxeMembershipStatus(" + "))": { + 'endpoints': ['/rest/deluxe-membership']}, + "app.get('/rest/image-captcha',imageCaptcha())": { + 'endpoints': ['/rest/image-captcha']}, + "app.get('/rest/languages',languageList())": { + 'endpoints': ['/rest/languages']}, + "app.get('/rest/memories',memory.getMemories())": { + 'endpoints': ['/rest/memories']}, + "app.get('/rest/order-history',orderHistory.orderHistory())": { + 'endpoints': ['/rest/order-history']}, + "app.get('/rest/order-history/orders',security.isAccounting()," + "orderHistory.allOrders())": { + 'endpoints': ['/rest/order-history/orders']}, + "app.get('/rest/products/:id/reviews',showProductReviews())": { + 'endpoints': ['/rest/products/:id/reviews']}, + "app.get('/rest/products/search',search())": { + 'endpoints': ['/rest/products/search']}, + "app.get('/rest/repeat-notification',repeatNotification())": { + 'endpoints': ['/rest/repeat-notification']}, + "app.get('/rest/saveLoginIp',saveLoginIp())": { + 'endpoints': ['/rest/saveLoginIp']}, + "app.get('/rest/track-order/:id',trackOrder())": { + 'endpoints': ['/rest/track-order/:id']}, + "app.get('/rest/user/authentication-details',authenticatedUsers(" + "))": { + 'endpoints': ['/rest/user/authentication-details']}, + "app.get('/rest/user/change-password',changePassword())": { + 'endpoints': ['/rest/user/change-password']}, + "app.get('/rest/user/security-question',securityQuestion())": { + 'endpoints': ['/rest/user/security-question']}, + "app.get('/rest/user/whoami',security.updateAuthenticatedUsers()," + "currentUser())": { + 'endpoints': ['/rest/user/whoami']}, + "app.get('/rest/wallet/balance',security.appendUserId()," + "wallet.getWalletBalance())": { + 'endpoints': ['/rest/wallet/balance']}, + "app.get('/rest/web3/nftMintListen',nftMint.nftMintListener())": { + 'endpoints': ['/rest/web3/nftMintListen']}, + "app.get('/rest/web3/nftUnlocked',checkKeys.nftUnlocked())": { + 'endpoints': ['/rest/web3/nftUnlocked']}, + "app.get('/snippets'," + "vulnCodeSnippet.serveChallengesWithCodeSnippet())": { + 'endpoints': ['/snippets']}, + "app.get('/snippets/:challenge',vulnCodeSnippet.serveCodeSnippet(" + "))": { + 'endpoints': ['/snippets/:challenge']}, + "app.get('/snippets/fixes/:key',vulnCodeFixes.serveCodeFixes())": { + 'endpoints': ['/snippets/fixes/:key']}, + "app.get('/the/devs/are/so/funny/they/hid/an/easter/egg/within" + "/the/easter/egg',easterEgg())": { + 'endpoints': [ + '/the/devs/are/so/funny/they/hid/an/easter/egg/within/the' + '/easter/egg']}, + "app.get('/this/page/is/hidden/behind/an/incredibly/high/paywall" + "/that/could/only/be/unlocked/by/sending/1btc/to/us'," + "premiumReward())": { + 'endpoints': [ + '/this/page/is/hidden/behind/an/incredibly/high/paywall' + '/that/could/only/be/unlocked/by/sending/1btc/to/us']}, + "app.get('/video',videoHandler.getVideo())": { + 'endpoints': ['/video']}, + "app.get('/we/may/also/instruct/you/to/refuse/all/reasonably" + "/necessary/responsibility',privacyPolicyProof())": { + 'endpoints': [ + '/we/may/also/instruct/you/to/refuse/all/reasonably' + '/necessary/responsibility']}, + "app.get(['/.well-known/security.txt','/security.txt']," + "verify.accessControlChallenges())": { + 'endpoints': ['/.well-known/security.txt', '/security.txt']}, + "app.patch('/rest/products/reviews',security.isAuthorized()," + "updateProductReviews())": { + 'endpoints': ['/rest/products/reviews']}, + "app.post('/api/Addresss',security.appendUserId())": { + 'endpoints': ['/api/Addresss']}, + "app.post('/api/BasketItems',security.appendUserId()," + "basketItems.quantityCheckBeforeBasketItemAddition()," + "basketItems.addBasketItem())": { + 'endpoints': ['/api/BasketItems']}, + "app.post('/api/Cards',security.appendUserId())": { + 'endpoints': ['/api/Cards']}, + "app.post('/api/Challenges',security.denyAll())": { + 'endpoints': ['/api/Challenges']}, + "app.post('/api/Complaints',security.isAuthorized())": { + 'endpoints': ['/api/Complaints']}, + "app.post('/api/Feedbacks',captcha.verifyCaptcha())": { + 'endpoints': ['/api/Feedbacks']}, + "app.post('/api/Feedbacks',verify.captchaBypassChallenge())": { + 'endpoints': ['/api/Feedbacks']}, + "app.post('/api/Feedbacks',verify.forgedFeedbackChallenge())": { + 'endpoints': ['/api/Feedbacks']}, + "app.post('/api/PrivacyRequests',security.isAuthorized())": { + 'endpoints': ['/api/PrivacyRequests']}, + "app.post('/api/Products',security.isAuthorized())": { + 'endpoints': ['/api/Products']}, + "app.post('/api/Quantitys',security.denyAll())": { + 'endpoints': ['/api/Quantitys']}, + "app.post('/api/Recycles',security.isAuthorized())": { + 'endpoints': ['/api/Recycles']}, + "app.post('/api/SecurityQuestions',security.denyAll())": { + 'endpoints': ['/api/SecurityQuestions']}, + "app.post('/api/Users',(req:Request,res:Response," + "next:NextFunction)=>{\rif(" + "req.body.email!==undefined&&req.body.password!==undefined&&req" + ".body.passwordRepeat!==undefined){\rif(" + "req.body.email.length!==0&&req.body.password.length!==0){" + "\rreq.body.email=req.body.email.trim(" + ")\rreq.body.password=req.body.password.trim(" + ")\rreq.body.passwordRepeat=req.body.passwordRepeat.trim(" + ")\r}else{\rres.status(400).send(res.__(" + "'Invalidemail/passwordcannotbeempty'))\r}\r}\rnext()\r})": { + 'endpoints': ['/api/Users', + '/Invalidemail/passwordcannotbeempty']}, + "app.post('/api/Users',verify.emptyUserRegistration())": { + 'endpoints': ['/api/Users']}, + "app.post('/api/Users',verify.passwordRepeatChallenge())": { + 'endpoints': ['/api/Users']}, + "app.post('/api/Users',verify.registerAdminChallenge())": { + 'endpoints': ['/api/Users']}, + "app.post('/b2b/v2/orders',b2bOrder())": { + 'endpoints': ['/b2b/v2/orders']}, + "app.post('/file-upload',uploadToMemory.single('file')," + "ensureFileIsPassed,metrics.observeFileUploadMetricsMiddleware()," + "handleZipFileUpload,checkUploadSize,checkFileType," + "handleXmlUpload)": { + 'endpoints': ['/file-upload']}, + "app.post('/profile',updateUserProfile())": { + 'endpoints': ['/profile']}, + "app.post('/profile/image/file',uploadToMemory.single('file')," + "ensureFileIsPassed,metrics.observeFileUploadMetricsMiddleware()," + "profileImageFileUpload())": { + 'endpoints': ['/profile/image/file']}, + "app.post('/profile/image/url',uploadToMemory.single('file')," + "profileImageUrlUpload())": { + 'endpoints': ['/profile/image/url']}, + "app.post('/rest/2fa/disable',\rnewRateLimit({windowMs:5*60*1000," + "max:100}),\rsecurity.isAuthorized(),\rtwoFactorAuth.disable(" + ")\r)": { + 'endpoints': ['/rest/2fa/disable']}, + "app.post('/rest/2fa/setup',\rnewRateLimit({windowMs:5*60*1000," + "max:100}),\rsecurity.isAuthorized(),\rtwoFactorAuth.setup()\r)": { + 'endpoints': ['/rest/2fa/setup']}, + "app.post('/rest/2fa/verify',\rnewRateLimit({windowMs:5*60*1000," + "max:100}),\rtwoFactorAuth.verify()\r)": { + 'endpoints': ['/rest/2fa/verify']}, + "app.post('/rest/basket/:id/checkout',order())": { + 'endpoints': ['/rest/basket/:id/checkout']}, + "app.post('/rest/chatbot/respond',chatbot.process())": { + 'endpoints': ['/rest/chatbot/respond']}, + "app.post('/rest/deluxe-membership',security.appendUserId()," + "deluxe.upgradeToDeluxe())": { + 'endpoints': ['/rest/deluxe-membership']}, + "app.post('/rest/memories',uploadToDisk.single('image')," + "ensureFileIsPassed,security.appendUserId()," + "metrics.observeFileUploadMetricsMiddleware(),memory.addMemory(" + "))": { + 'endpoints': ['/rest/memories']}, + "app.post('/rest/products/reviews',security.isAuthorized()," + "likeProductReviews())": { + 'endpoints': ['/rest/products/reviews']}, + "app.post('/rest/user/data-export',security.appendUserId()," + "dataExport())": { + 'endpoints': ['/rest/user/data-export']}, + "app.post('/rest/user/data-export',security.appendUserId()," + "imageCaptcha.verifyCaptcha())": { + 'endpoints': ['/rest/user/data-export']}, + "app.post('/rest/user/login',login())": { + 'endpoints': ['/rest/user/login']}, + "app.post('/rest/user/reset-password',resetPassword())": { + 'endpoints': ['/rest/user/reset-password']}, + "app.post('/rest/web3/submitKey',checkKeys.checkKeys())": { + 'endpoints': ['/rest/web3/submitKey']}, + "app.post('/rest/web3/walletExploitAddress'," + "web3Wallet.contractExploitListener())": { + 'endpoints': ['/rest/web3/walletExploitAddress']}, + "app.post('/rest/web3/walletNFTVerify',nftMint.walletNFTVerify(" + "))": { + 'endpoints': ['/rest/web3/walletNFTVerify']}, + "app.post('/snippets/fixes',vulnCodeFixes.checkCorrectFix())": { + 'endpoints': ['/snippets/fixes']}, + "app.post('/snippets/verdict',vulnCodeSnippet.checkVulnLines())": { + 'endpoints': ['/snippets/verdict']}, + "app.put('/api/Addresss/:id',security.appendUserId())": { + 'endpoints': ['/api/Addresss/:id']}, + "app.put('/api/BasketItems/:id',security.appendUserId()," + "basketItems.quantityCheckBeforeBasketItemUpdate())": { + 'endpoints': ['/api/BasketItems/:id']}, + "app.put('/api/Cards/:id',security.denyAll())": { + 'endpoints': ['/api/Cards/:id']}, + "app.put('/api/Feedbacks/:id',security.denyAll())": { + 'endpoints': ['/api/Feedbacks/:id']}, + "app.put('/api/Recycles/:id',security.denyAll())": { + 'endpoints': ['/api/Recycles/:id']}, + "app.put('/rest/basket/:id/coupon/:coupon',coupon())": { + 'endpoints': ['/rest/basket/:id/coupon/:coupon']}, + "app.put('/rest/continue-code-findIt/apply/:continueCode'," + "restoreProgress.restoreProgressFindIt())": { + 'endpoints': [ + '/rest/continue-code-findIt/apply/:continueCode']}, + "app.put('/rest/continue-code-fixIt/apply/:continueCode'," + "restoreProgress.restoreProgressFixIt())": { + 'endpoints': ['/rest/continue-code-fixIt/apply/:continueCode']}, + "app.put('/rest/continue-code/apply/:continueCode'," + "restoreProgress.restoreProgress())": { + 'endpoints': ['/rest/continue-code/apply/:continueCode']}, + "app.put('/rest/order-history/:id/delivery-status'," + "security.isAccounting(),orderHistory.toggleDeliveryStatus())": { + 'endpoints': ['/rest/order-history/:id/delivery-status']}, + "app.put('/rest/products/:id/reviews',createProductReviews())": { + 'endpoints': ['/rest/products/:id/reviews']}, + "app.put('/rest/wallet/balance',security.appendUserId()," + "wallet.addWalletBalance())": { + 'endpoints': ['/rest/wallet/balance']}, + "app.route('/api/Users/:id')": {'endpoints': ['/api/Users/:id']}, + "app.use('/api-docs',swaggerUi.serve,swaggerUi.setup(" + "swaggerDocument))": { + 'endpoints': ['/api-docs']}, + "app.use('/api/BasketItems',security.isAuthorized())": { + 'endpoints': ['/api/BasketItems']}, + "app.use('/api/BasketItems/:id',security.isAuthorized())": { + 'endpoints': ['/api/BasketItems/:id']}, + "app.use('/api/Challenges/:id',security.denyAll())": { + 'endpoints': ['/api/Challenges/:id']}, + "app.use('/api/Complaints/:id',security.denyAll())": { + 'endpoints': ['/api/Complaints/:id']}, + "app.use('/api/Feedbacks/:id',security.isAuthorized())": { + 'endpoints': ['/api/Feedbacks/:id']}, + "app.use('/api/PrivacyRequests',security.isAuthorized())": { + 'endpoints': ['/api/PrivacyRequests']}, + "app.use('/api/PrivacyRequests/:id',security.denyAll())": { + 'endpoints': ['/api/PrivacyRequests/:id']}, + "app.use('/api/PrivacyRequests/:id',security.isAuthorized())": { + 'endpoints': ['/api/PrivacyRequests/:id']}, + "app.use('/api/Quantitys/:id',security.isAccounting(),ipfilter([" + "'123.456.789'],{mode:'allow'}))": { + 'endpoints': ['/api/Quantitys/:id']}, + "app.use('/api/SecurityAnswers/:id',security.denyAll())": { + 'endpoints': ['/api/SecurityAnswers/:id']}, + "app.use('/api/SecurityQuestions/:id',security.denyAll())": { + 'endpoints': ['/api/SecurityQuestions/:id']}, + "app.use('/assets/i18n',verify.accessControlChallenges())": { + 'endpoints': ['/assets/i18n']}, + "app.use('/assets/public/images/padding'," + "verify.accessControlChallenges())": { + 'endpoints': ['/assets/public/images/padding']}, + "app.use('/assets/public/images/products'," + "verify.accessControlChallenges())": { + 'endpoints': ['/assets/public/images/products']}, + "app.use('/assets/public/images/uploads'," + "verify.accessControlChallenges())": { + 'endpoints': ['/assets/public/images/uploads']}, + "app.use('/b2b/v2',security.isAuthorized())": { + 'endpoints': ['/b2b/v2']}, + "app.use('/dataerasure',dataErasure)": { + 'endpoints': ['/dataerasure']}, + "app.use('/encryptionkeys',serveIndexMiddleware,serveIndex(" + "'encryptionkeys',{icons:true,view:'details'}))": { + 'endpoints': ['/encryptionkeys']}, + "app.use('/encryptionkeys/:file',keyServer())": { + 'endpoints': ['/encryptionkeys/:file']}, + "app.use('/ftp',serveIndexMiddleware,serveIndex('ftp'," + "{icons:true}))": { + 'endpoints': ['/ftp']}, + "app.use('/ftp(?!/quarantine)/:file',fileServer())": { + 'endpoints': ['/ftp(?!/quarantine)/:file']}, + "app.use('/ftp/quarantine/:file',quarantineServer())": { + 'endpoints': ['/ftp/quarantine/:file']}, + "app.use('/rest/basket',security.isAuthorized()," + "security.appendUserId())": { + 'endpoints': ['/rest/basket']}, + "app.use('/rest/basket/:id',security.isAuthorized())": { + 'endpoints': ['/rest/basket/:id']}, + "app.use('/rest/basket/:id/order',security.isAuthorized())": { + 'endpoints': ['/rest/basket/:id/order']}, + "app.use('/rest/user/authentication-details'," + "security.isAuthorized())": { + 'endpoints': ['/rest/user/authentication-details']}, + "app.use('/rest/user/reset-password',newRateLimit({" + "\rwindowMs:5*60*1000,\rmax:100,\rkeyGenerator({headers," + "ip}:{headers:any,ip:any}){returnheaders[" + "'X-Forwarded-For']||ip}//vuln-code-snippetvuln" + "-lineresetPasswordMortyChallenge\r}))": { + 'endpoints': ['/rest/user/reset-password']}, + "app.use('/solve/challenges/server-side'," + "verify.serverSideChallenges())": { + 'endpoints': ['/solve/challenges/server-side']}, + "app.use('/support/logs',serveIndexMiddleware,serveIndex('logs'," + "{icons:true,view:'details'}))": { + 'endpoints': ['/support/logs']}, + "app.use('/support/logs',verify.accessControlChallenges())": { + 'endpoints': ['/support/logs']}, + "app.use('/support/logs/:file',logFileServer())": { + 'endpoints': ['/support/logs/:file']}, + "app.use((req:Request,res:Response,next:NextFunction)=>{" + "\rreq.url=req.url.replace(/[/]+/g,'/')\rnext()\r})": { + 'endpoints': ['/']}, + "app.use(['/.well-known/security.txt','/security.txt']," + "securityTxt({\rcontact:config.get(" + "'application.securityTxt.contact'),\rencryption:config.get(" + "'application.securityTxt.encryption')," + "\racknowledgements:config.get(" + "'application.securityTxt.acknowledgements')," + "\r'Preferred-Languages':[...newSet(locales.map((locale:{" + "key:string})=>locale.key.substr(0,2)))].join(',')," + "\rhiring:config.get('application.securityTxt.hiring')," + "\rexpires:securityTxtExpiration.toUTCString()\r}))": { + 'endpoints': ['/.well-known/security.txt', '/security.txt']}, + "app.use(bodyParser.text({type:'*/*'}))": {'endpoints': ['/*/*']}, + "app.use(express.static(path.resolve('frontend/dist/frontend')))": { + 'endpoints': ['/frontend/dist/frontend']}, + "app.use(functionjsonParser(req:Request,res:Response," + "next:NextFunction){" + "\r//@ts-expect-errorFIXMEintentionallysavingoriginalrequestinthisproperty\rreq.rawBody=req.body\rif(req.headers['content-type']?.includes('application/json')){\rif(!req.body){\rreq.body={}\r}\rif(req.body!==Object(req.body)){//Expensiveworkaroundfor500errorsduringFrisbytestrun(see#640)\rreq.body=JSON.parse(req.body)\r}\r}\rnext()\r})": { + 'endpoints': ['/application/json']}, + "app.use(robots({UserAgent:'*',Disallow:'/ftp'}))": { + 'endpoints': ['/ftp']}}}}} + methods = js_usages_1.process_calls(methods) result = js_usages_1.populate_endpoints(methods) - assert list(result.keys()) == ['/', '/rest/admin/application-version', - '/api/SecurityQuestions', '/api/Cards/{id}', - '/rest/image-captcha', '/promotion', - '/snippets/{challenge}', - '/rest/continue-code-findIt/apply/{' - 'continueCode}'] + result_keys = list(result.keys()) + result_keys.sort() + assert result_keys == ['/', '/*/*', '/.well-known/security.txt', + '/Invalidemail/passwordcannotbeempty', '/api-docs', + '/api/Addresss', '/api/Addresss/{id}', + '/api/BasketItems', '/api/BasketItems/{id}', + '/api/Cards', '/api/Cards/{id}', '/api/Challenges', + '/api/Challenges/{id}', '/api/Complaints', + '/api/Complaints/{id}', '/api/Deliverys', + '/api/Deliverys/{id}', '/api/Feedbacks', + '/api/Feedbacks/{id}', '/api/PrivacyRequests', + '/api/PrivacyRequests/{id}', '/api/Products', + '/api/Products/{id}', '/api/Quantitys', + '/api/Quantitys/{id}', '/api/Recycles', + '/api/Recycles/{id}', '/api/SecurityAnswers', + '/api/SecurityAnswers/{id}', + '/api/SecurityQuestions', + '/api/SecurityQuestions/{id}', '/api/Users', + '/api/Users/{id}', '/application/json', + '/assets/i18n', '/assets/public/images/padding', + '/assets/public/images/products', + '/assets/public/images/uploads', '/b2b/v2', + '/b2b/v2/orders', '/dataerasure', '/encryptionkeys', + '/encryptionkeys/{file}', '/file-upload', + '/frontend/dist/frontend', '/ftp', + '/ftp(?!/quarantine)/{file}', + '/ftp/quarantine/{file}', '/metrics', '/profile', + '/profile/image/file', '/profile/image/url', + '/promotion', '/redirect', '/rest/2fa/disable', + '/rest/2fa/setup', '/rest/2fa/status', + '/rest/2fa/verify', + '/rest/admin/application-configuration', + '/rest/admin/application-version', '/rest/basket', + '/rest/basket/{id}', '/rest/basket/{id}/checkout', + '/rest/basket/{id}/coupon/{coupon}', + '/rest/basket/{id}/order', '/rest/captcha', + '/rest/chatbot/respond', '/rest/chatbot/status', + '/rest/continue-code', '/rest/continue-code-findIt', + '/rest/continue-code-findIt/apply/{continueCode}', + '/rest/continue-code-fixIt', + '/rest/continue-code-fixIt/apply/{continueCode}', + '/rest/continue-code/apply/{continueCode}', + '/rest/country-mapping', '/rest/deluxe-membership', + '/rest/image-captcha', '/rest/languages', + '/rest/memories', '/rest/order-history', + '/rest/order-history/orders', + '/rest/order-history/{id}/delivery-status', + '/rest/products/reviews', '/rest/products/search', + '/rest/products/{id}/reviews', + '/rest/repeat-notification', '/rest/saveLoginIp', + '/rest/track-order/{id}', + '/rest/user/authentication-details', + '/rest/user/change-password', + '/rest/user/data-export', '/rest/user/login', + '/rest/user/reset-password', + '/rest/user/security-question', '/rest/user/whoami', + '/rest/wallet/balance', '/rest/web3/nftMintListen', + '/rest/web3/nftUnlocked', '/rest/web3/submitKey', + '/rest/web3/walletExploitAddress', + '/rest/web3/walletNFTVerify', '/security.txt', + '/snippets', '/snippets/fixes', + '/snippets/fixes/{key}', '/snippets/verdict', + '/snippets/{challenge}', + '/solve/challenges/server-side', '/support/logs', + '/support/logs/{file}', + '/the/devs/are/so/funny/they/hid/an/easter/egg' + '/within/the/easter/egg', + '/this/page/is/hidden/behind/an/incredibly/high' + '/paywall/that/could/only/be/unlocked/by/sending' + '/1btc/to/us', + '/video', + '/we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility'] assert list( - result['/rest/continue-code-findIt/apply/{continueCode}'].keys()) == [ - 'put'] + result['/rest/continue-code-findIt/apply/{continueCode}'].keys()) == ['parameters', 'put'] methods = js_usages_2.process_methods() methods = js_usages_2.methods_to_endpoints(methods) - assert methods == {'app\\routes\\index.js::program:index': { - 'app.get("/",sessionHandler.displayWelcomePage)': {'/': {}}, - 'app.get("/allocations/:userId",isLoggedIn,' - 'allocationsHandler.displayAllocations)': { - '/allocations/{userId}': {}}, - 'app.get("/benefits",isLoggedIn,benefitsHandler.displayBenefits)': { - '/benefits': {}}, - 'app.get("/contributions",isLoggedIn,' - 'contributionsHandler.displayContributions)': { - '/contributions': {}}, - 'app.get("/dashboard",isLoggedIn,sessionHandler.displayWelcomePage)': { - '/dashboard': {}}, - 'app.get("/learn",isLoggedIn,(req,res)=>{' - '//Insecurewaytohandleredirectsbytakingredirecturlfromquerystringreturnres.redirect(req.query.url);})': { - '/learn': {}}, - 'app.get("/login",sessionHandler.displayLoginPage)': {'/login': {}}, - 'app.get("/logout",sessionHandler.displayLogoutPage)': {'/logout': {}}, - 'app.get("/memos",isLoggedIn,memosHandler.displayMemos)': { - '/memos': {}}, - 'app.get("/profile",isLoggedIn,profileHandler.displayProfile)': { - '/profile': {}}, - 'app.get("/research",isLoggedIn,researchHandler.displayResearch)': { - '/research': {}}, - 'app.get("/signup",sessionHandler.displaySignupPage)': {'/signup': {}}, - 'app.post("/benefits",isLoggedIn,benefitsHandler.updateBenefits)': { - '/benefits': {}}, - 'app.post("/contributions",isLoggedIn,' - 'contributionsHandler.handleContributionsUpdate)': { - '/contributions': {}}, - 'app.post("/login",sessionHandler.handleLoginRequest)': {'/login': {}}, - 'app.post("/memos",isLoggedIn,memosHandler.addMemos)': {'/memos': {}}, - 'app.post("/profile",isLoggedIn,profileHandler.handleProfileUpdate)': { - '/profile': {}}, - 'app.post("/signup",sessionHandler.handleSignup)': {'/signup': {}}, - 'app.use("/tutorial",tutorialRouter)': {'/tutorial': {}}}, - 'app\\routes\\tutorial.js::program': { - 'router.get("/",(req,res)=>{' - '"usestrict";returnres.render("tutorial/a1",' - '{environmentalScripts});})': { - '/': {}, '/tutorial/a1': {}}}, - 'server.js::program': { - 'app.use(favicon(' - '__dirname+"/app/assets/favicon.ico"))': { - '/app/assets/favicon.ico': {}}}} + assert methods == { + 'full_names': {'app\\routes\\index.js::program:index': { + 'resolved_methods': {'app.get("/",sessionHandler.displayWelcomePage)': { + 'endpoints': ['/']}, + 'app.get("/allocations/:userId",isLoggedIn,' + 'allocationsHandler.displayAllocations)': { + 'endpoints': ['/allocations/:userId']}, + 'app.get("/benefits",isLoggedIn,' + 'benefitsHandler.displayBenefits)': { + 'endpoints': ['/benefits']}, + 'app.get("/contributions",isLoggedIn,' + 'contributionsHandler.displayContributions)': { + 'endpoints': ['/contributions']}, + 'app.get("/dashboard",isLoggedIn,' + 'sessionHandler.displayWelcomePage)': { + 'endpoints': ['/dashboard']}, + 'app.get("/learn",isLoggedIn,(req,res)=>{' + '//Insecurewaytohandleredirectsbytakingredirecturlfromquerystringreturnres.redirect(req.query.url);})': { + 'endpoints': ['/learn']}, + 'app.get("/login",' + 'sessionHandler.displayLoginPage)': { + 'endpoints': ['/login']}, + 'app.get("/logout",' + 'sessionHandler.displayLogoutPage)': { + 'endpoints': ['/logout']}, + 'app.get("/memos",isLoggedIn,' + 'memosHandler.displayMemos)': { + 'endpoints': ['/memos']}, + 'app.get("/profile",isLoggedIn,' + 'profileHandler.displayProfile)': { + 'endpoints': ['/profile']}, + 'app.get("/research",isLoggedIn,' + 'researchHandler.displayResearch)': { + 'endpoints': ['/research']}, + 'app.get("/signup",' + 'sessionHandler.displaySignupPage)': { + 'endpoints': ['/signup']}, + 'app.post("/benefits",isLoggedIn,' + 'benefitsHandler.updateBenefits)': { + 'endpoints': ['/benefits']}, + 'app.post("/contributions",isLoggedIn,' + 'contributionsHandler.handleContributionsUpdate' + ')': { + 'endpoints': ['/contributions']}, + 'app.post("/login",' + 'sessionHandler.handleLoginRequest)': { + 'endpoints': ['/login']}, + 'app.post("/memos",isLoggedIn,' + 'memosHandler.addMemos)': { + 'endpoints': ['/memos']}, + 'app.post("/profile",isLoggedIn,' + 'profileHandler.handleProfileUpdate)': { + 'endpoints': ['/profile']}, + 'app.post("/signup",' + 'sessionHandler.handleSignup)': { + 'endpoints': ['/signup']}, + 'app.use("/tutorial",tutorialRouter)': { + 'endpoints': ['/tutorial']}}}, + 'app\\routes\\tutorial.js::program': { + 'resolved_methods': { + 'router.get("/",(req,res)=>{' + '"usestrict";returnres.render(' + '"tutorial/a1",' + '{environmentalScripts});})': { + 'endpoints': ['/', + '/tutorial/a1']}}}, + 'server.js::program': { + 'resolved_methods': { + 'app.use(favicon(' + '__dirname+"/app/assets/favicon.ico"))': { + 'endpoints': [ + '/app/assets/favicon.ico']}}}}} methods = js_usages_2.process_calls(methods) result = js_usages_2.populate_endpoints(methods) assert len(list(result['/login'].keys())) == 2 result = list(result.keys()) result.sort() - assert result == ['/', '/allocations/{userId}', '/benefits', - '/contributions', '/dashboard', '/learn', '/login', '/logout', '/memos', - '/profile', '/research', '/signup', '/tutorial/a1'] + assert result == ['/', '/allocations/{userId}', '/app/assets/favicon.ico', + '/benefits', '/contributions', '/dashboard', '/learn', + '/login', '/logout', '/memos', '/profile', '/research', + '/signup', '/tutorial', '/tutorial/a1'] def test_usages_class(java_usages_1): assert java_usages_1.title == 'OpenAPI Specification for data' -def test_convert_usages(java_usages_1, java_usages_2, js_usages_2): - assert java_usages_1.convert_usages() == { - '/': {'post': {'parameters': [], 'responses': {}}}, - '/accounts/{accountName}': {'get': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}}, - '/current': {'get': {'parameters': [], 'responses': {}}, - 'put': {'parameters': [], 'responses': {}}}, - '/latest': {'get': {'parameters': [], 'responses': {}}}, - '/statistics/{accountName}': {'put': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}}, - '/uaa/users': {'post': {'parameters': [], 'responses': {}}}, - '/{accountName}': {'get': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}, 'put': {'parameters': [ - {'in': 'path', 'name': 'accountName', 'required': True}], - 'responses': {}}}, '/{name}': {'get': { - 'parameters': [{'in': 'path', 'name': 'name', 'required': True}], - 'responses': {}}}} - assert java_usages_2.convert_usages() == { - '/': {'get': {'parameters': [], 'responses': {}}}, - '/Digester/sec': {'post': {'parameters': [], 'responses': {}}}, - '/Digester/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/Sec': {'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/xinclude/sec': { - 'post': {'parameters': [], 'responses': {}}}, - '/DocumentBuilder/xinclude/vuln': { - 'post': {'parameters': [], 'responses': {}}}, - '/DocumentHelper/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/HttpSyncClients/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/HttpURLConnection/sec': {'get': {'parameters': [], 'responses': {}}}, - '/HttpURLConnection/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/IOUtils/sec': {'get': {'parameters': [], 'responses': {}}}, - '/ImageIO/sec': {'get': {'parameters': [], 'responses': {}}}, - '/Jsoup/sec': {'get': {'parameters': [], 'responses': {}}}, - '/ProcessBuilder': {'get': {'parameters': [], 'responses': {}}}, - '/SAXBuilder/sec': {'post': {'parameters': [], 'responses': {}}}, - '/SAXBuilder/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/SAXParser/sec': {'post': {'parameters': [], 'responses': {}}}, - '/SAXParser/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/SAXReader/sec': {'post': {'parameters': [], 'responses': {}}}, - '/SAXReader/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/XMLReader/sec': {'post': {'parameters': [], 'responses': {}}}, - '/XMLReader/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/any': {'get': {'parameters': [], 'responses': {}}}, - '/application/javascript': {'get': {'parameters': [], 'responses': {}}}, - '/codeinject': {'get': {'parameters': [], 'responses': {}}}, - '/codeinject/host': {'get': {'parameters': [], 'responses': {}}}, - '/codeinject/sec': {'get': {'parameters': [], 'responses': {}}}, - '/commonsHttpClient/sec': {'get': {'parameters': [], 'responses': {}}}, - '/createToken': {'get': {'parameters': [], 'responses': {}}}, - '/deserialize': {'post': {'parameters': [], 'responses': {}}}, - '/dnsrebind/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/exclued/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/fastjsonp/getToken': {'get': {'parameters': [], 'responses': {}}}, - '/getName': {'get': {'parameters': [], 'responses': {}}}, - '/getToken': {'get': {'parameters': [], 'responses': {}}}, - '/httpclient/sec': {'get': {'parameters': [], 'responses': {}}}, - '/hutool/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/jscmd': {'get': {'parameters': [], 'responses': {}}}, - '/log4j': {'get': {'parameters': [], 'responses': {}}}, - '/logout': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/orderby/sec04': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/orderby/vuln03': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/sec01': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/sec02': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/sec03': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/vuln01': {'get': {'parameters': [], 'responses': {}}}, - '/mybatis/vuln02': {'get': {'parameters': [], 'responses': {}}}, - '/okhttp/sec': {'get': {'parameters': [], 'responses': {}}}, - '/openStream': {'get': {'parameters': [], 'responses': {}}}, - '/path_traversal/sec': {'get': {'parameters': [], 'responses': {}}}, - '/path_traversal/vul': {'get': {'parameters': [], 'responses': {}}}, - '/pic': {'get': {'parameters': [], 'responses': {}}}, - '/post': {'post': {'parameters': [], 'responses': {}}}, - '/postgresql': {'post': {'parameters': [], 'responses': {}}}, - '/readxlsx': {'post': {'parameters': [], 'responses': {}}}, - '/redirect': {'get': {'parameters': [], 'responses': {}}}, - '/request/sec': {'get': {'parameters': [], 'responses': {}}}, - '/restTemplate/vuln1': {'get': {'parameters': [], 'responses': {}}}, - '/restTemplate/vuln2': {'get': {'parameters': [], 'responses': {}}}, - '/runtime/exec': {'get': {'parameters': [], 'responses': {}}}, - '/sec': {'get': {'parameters': [], 'responses': {}}}, - '/sec/array_indexOf': {'get': {'parameters': [], 'responses': {}}}, - '/sec/checkOrigin': {'get': {'parameters': [], 'responses': {}}}, - '/sec/crossOrigin': {'get': {'parameters': [], 'responses': {}}}, - '/sec/httpCors': {'get': {'parameters': [], 'responses': {}}}, - '/sec/originFilter': {'get': {'parameters': [], 'responses': {}}}, - '/sec/webMvcConfigurer': {'get': {'parameters': [], 'responses': {}}}, - '/sec/yarm': {'get': {'parameters': [], 'responses': {}}}, - '/setHeader': {'head': {'parameters': [], 'responses': {}}}, - '/spel/vuln': {'get': {'parameters': [], 'responses': {}}}, - '/status': {'get': {'parameters': [], 'responses': {}}}, - '/upload': {'get': {'parameters': [], 'responses': {}}, - 'post': {'parameters': [], 'responses': {}}}, - '/upload/picture': {'post': {'parameters': [], 'responses': {}}}, - '/urlConnection/sec': {'get': {'parameters': [], 'responses': {}}}, - '/urlConnection/vuln': {'get': {'parameters': [], 'responses': {}}, - 'post': {'parameters': [], 'responses': {}}}, - '/velocity': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/contains': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/endsWith': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/origin': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/regex': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/setHeader': {'get': {'parameters': [], 'responses': {}}, - 'head': {'parameters': [], 'responses': {}}}, - '/vuln/url_bypass': {'get': {'parameters': [], 'responses': {}}}, - '/vuln/yarm': {'get': {'parameters': [], 'responses': {}}}, - '/vuln01': {'get': {'parameters': [], 'responses': {}}}, - '/vuln02': {'get': {'parameters': [], 'responses': {}}}, - '/vuln03': {'get': {'parameters': [], 'responses': {}}}, - '/vuln04': {'get': {'parameters': [], 'responses': {}}}, - '/vuln05': {'get': {'parameters': [], 'responses': {}}}, - '/vuln06': {'get': {'parameters': [], 'responses': {}}}, - '/xmlReader/sec': {'post': {'parameters': [], 'responses': {}}}, - '/xmlReader/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/xmlbeam/vuln': {'post': {'parameters': [], 'responses': {}}}, - '/xstream': {'post': {'parameters': [], 'responses': {}}}} - -# def test_endpoints_to_openapi(java_usages_1, js_usages_1): -# assert java_usages_1.endpoints_to_openapi() == { -# 'info': {'title': 'OpenAPI Specification for data', 'version': '1.0.0'}, -# 'openapi': '3.1.0', -# 'paths': {'/': {'post': {'parameters': [], 'responses': {}}}, -# '/accounts/{accountName}': {'get': {'parameters': [ -# {'in': 'path', 'name': 'accountName', 'required': True}], -# 'responses': {}}}, -# '/current': {'get': {'parameters': [], 'responses': {}}, -# 'put': {'parameters': [], 'responses': {}}}, -# '/latest': {'get': {'parameters': [], 'responses': {}}}, -# '/statistics/{accountName}': {'put': {'parameters': [ -# {'in': 'path', 'name': 'accountName', 'required': True}], -# 'responses': {}}}, -# '/uaa/users': {'post': {'parameters': [], 'responses': {}}}, -# '/{accountName}': {'get': {'parameters': [ -# {'in': 'path', 'name': 'accountName', 'required': True}], -# 'responses': {}}, 'put': { -# 'parameters': [{'in': 'path', 'name': 'accountName', -# 'required': True}], 'responses': {}}}, -# '/{name}': {'get': {'parameters': [ -# {'in': 'path', 'name': 'name', 'required': True}], -# 'responses': {}}}}} -# assert js_usages_1.endpoints_to_openapi() == { -# 'info': {'title': 'OpenAPI Specification for data', 'version': '1.0.0'}, -# 'openapi': '3.0.1', 'paths': {'/': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', 'name': 'LAMBDA'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', 'name': 'LAMBDA'}], -# 'responses': {}}}, '/.well-known/security.txt': { -# 'get': {'parameters': [], 'responses': {}}}, -# '/Invalidemail/passwordcannotbeempty': { -# 'post': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': 'LAMBDA'}], -# 'responses': {}}}, -# '/api/Addresss': {'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': -# {}}, -# 'post': {'parameters': [ -# {'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': -# {}}}, -# '/api/Addresss/{id}': {'delete': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}, 'get': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}, 'put': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}}, -# '/api/BasketItems': {'post': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/api/BasketItems/{id}': {'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], 'put': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}}, '/api/Cards': { -# 'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/api/Cards/{id}': {'delete': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}, 'get': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}, 'put': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}}, '/api/Challenges': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, '/api/Challenges/{id}': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}]}, -# '/api/Complaints': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, -# '/api/Complaints/{id}': {'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}]}, -# '/api/Deliverys': {'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': -# {}}}, -# '/api/Deliverys/{id}': {'get': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}}, '/api/Feedbacks': { -# 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/api/Feedbacks/{id}': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'put': {'parameters': [ -# {'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}}, '/api/PrivacyRequests': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, '/api/PrivacyRequests/{id}': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}]}, -# '/api/Products': {'post': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': -# {}}}, -# '/api/Products/{id}': {'delete': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}}, '/api/Quantitys': { -# 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, '/api/Quantitys/{id}': {'delete': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}, 'parameters': [ -# {'in': 'path', 'name': 'id', 'required': True}]}, -# '/api/Recycles': {'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': -# {}}, -# 'post': {'parameters': [ -# {'in': 'header', -# 'name': -# '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': -# {}}}, -# '/api/Recycles/{id}': {'delete': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}, 'get': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}, 'put': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}}, -# '/api/SecurityAnswers': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, -# '/api/SecurityAnswers/{id}': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}]}, -# '/api/SecurityQuestions': {'post': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, -# '/api/SecurityQuestions/{id}': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}]}, -# '/api/Users': {'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}, -# 'post': {'parameters': [ -# {'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/api/Users/{id}': {'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}]}, -# '/application/json': { -# 'head': {'parameters': [], -# 'responses': {}}}, -# '/b2b/v2/orders': {'post': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/encryptionkeys/{file}': {'parameters': [ -# {'in': 'path', 'name': 'file', -# 'required': True}]}, -# '/file-upload': {'post': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': -# {}}}, -# '/ftp(?!/quarantine)/{file}': { -# 'parameters': [ -# {'in': 'path', 'name': 'file', -# 'required': True}]}, -# '/ftp/quarantine/{file}': {'parameters': [ -# {'in': 'path', 'name': 'file', -# 'required': True}]}, '/metrics': { -# 'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/profile': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/profile/image/file': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/profile/image/url': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/promotion': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/redirect': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/2fa/disable': { -# 'post': {'parameters': [], 'responses': {}}}, -# '/rest/2fa/setup': { -# 'post': {'parameters': [], -# 'responses': {}}}, -# '/rest/2fa/status': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# 'routes\\2fa.ts::program:status'}, -# {'in': 'header', -# 'name': -# '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, -# '/rest/2fa/verify': { -# 'post': {'parameters': [], -# 'responses': {}}}, -# '/rest/admin/application-configuration': { -# 'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': {}}}, -# '/rest/admin/application-version': { -# 'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': {}}}, -# '/rest/basket/{id}': {'get': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}, 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}]}, -# '/rest/basket/{id}/checkout': {'post': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}], -# 'responses': {}}}, -# '/rest/basket/{id}/coupon/{coupon}': { -# 'put': {'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}, -# {'in': 'path', 'name': 'coupon', -# 'required': True}], -# 'responses': {}}}, -# '/rest/basket/{id}/order': { -# 'parameters': [ -# {'in': 'path', 'name': 'id', -# 'required': True}]}, -# '/rest/captcha': {'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': -# {}}}, -# '/rest/chatbot/respond': {'post': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/chatbot/status': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/continue-code': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/continue-code-findIt': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/continue-code-findIt/apply/{' -# 'continueCode}': { -# 'put': {'parameters': [{'in': 'path', -# 'name': -# 'continueCode', -# 'required': -# True}], -# 'responses': {}}}, -# '/rest/continue-code-fixIt': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/continue-code-fixIt/apply/{' -# 'continueCode}': { -# 'put': {'parameters': [{'in': 'path', -# 'name': -# 'continueCode', -# 'required': -# True}], -# 'responses': {}}}, -# '/rest/continue-code/apply/{' -# 'continueCode}': { -# 'put': {'parameters': [{'in': 'path', -# 'name': -# 'continueCode', -# 'required': -# True}], -# 'responses': {}}}, -# '/rest/country-mapping': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/deluxe-membership': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/image-captcha': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, -# '/rest/languages': {'get': { -# 'parameters': [{'in': 'header', -# 'name': -# '__ecma.String'}], -# 'responses': {}}}, '/rest/memories': { -# 'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/order-history': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/order-history/orders': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/order-history/{id}/delivery-status': { -# 'put': {'parameters': [ -# {'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}}, '/rest/products/reviews': {'patch': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}, -# {'in': 'header', -# 'name': -# 'express-jwt:expressJwt:'}], -# 'responses': {}}}, '/rest/products/search': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/products/{id}/reviews': {'get': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}, 'put': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}}, '/rest/repeat-notification': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/saveLoginIp': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/track-order/{id}': {'get': { -# 'parameters': [{'in': 'path', 'name': 'id', 'required': True}], -# 'responses': {}}}, '/rest/user/authentication-details': { -# 'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/user/change-password': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/user/data-export': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/user/login': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/user/reset-password': { -# 'head': {'parameters': [], 'responses': {}}, 'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/user/security-question': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/user/whoami': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/wallet/balance': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}, 'put': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/web3/nftMintListen': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/web3/nftUnlocked': {'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/web3/submitKey': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/web3/walletExploitAddress': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/rest/web3/walletNFTVerify': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/security.txt': { -# 'get': {'parameters': [], 'responses': {}}}, '/snippets': { -# 'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/snippets/fixes': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/snippets/fixes/{key}': {'get': { -# 'parameters': [{'in': 'path', 'name': 'key', 'required': True}], -# 'responses': {}}}, '/snippets/verdict': {'post': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, '/snippets/{challenge}': {'get': { -# 'parameters': [ -# {'in': 'path', 'name': 'challenge', 'required': True}], -# 'responses': {}}}, '/support/logs/{file}': {'parameters': [ -# {'in': 'path', 'name': 'file', 'required': True}]}, -# '/the/devs/are/so/funny/they/hid/an/easter/egg/within/the/easter/egg': { -# 'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': {}}}, -# '/this/page/is/hidden/behind/an/incredibly/high/paywall/that/could/only/be/unlocked/by/sending/1btc/to/us': { -# 'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': {}}}, '/video': { -# 'get': { -# 'parameters': [{'in': 'header', 'name': '__ecma.String'}], -# 'responses': {}}}, -# '/we/may/also/instruct/you/to/refuse/all/reasonably/necessary/responsibility': { -# 'get': {'parameters': [ -# {'in': 'header', -# 'name': '__ecma.String'}], -# 'responses': {}}}}} +def test_convert_usages(java_usages_1, java_usages_2, js_usages_1, js_usages_2, py_usages_1, py_usages_2): + assert java_usages_1.convert_usages() == {'/': {'post': {'responses': {}}}, + '/accounts/{accountName}': { + 'get': {'responses': {}}, + 'parameters': [{'in': 'path', + 'name': + 'accountName', + 'required': + True}]}, + '/current': { + 'get': {'responses': {}}, + 'put': {'responses': {}}}, + '/latest': { + 'get': {'responses': {}}}, + '/statistics/{accountName}': { + 'parameters': [{'in': 'path', + 'name': + 'accountName', + 'required': + True}], + 'put': {'responses': {}}}, + '/uaa/users': { + 'post': {'responses': {}}}, + '/{accountName}': { + 'get': {'responses': {}}, + 'parameters': [{'in': 'path', + 'name': + 'accountName', + 'required': + True}], + 'put': {'responses': {}}}, + '/{name}': { + 'get': {'responses': {}}, + 'parameters': [{'in': 'path', + 'name': + 'name', + 'required': + True}]}} + assert java_usages_2.convert_usages() == {'/': {'get': {'responses': {}}}, + '/Digester/sec': { + 'post': {'responses': {}}}, + '/Digester/vuln': { + 'post': {'responses': {}}}, + '/DocumentBuilder/Sec': { + 'post': {'responses': {}}}, + '/DocumentBuilder/vuln': { + 'post': {'responses': {}}}, + '/DocumentBuilder/xinclude/sec': { + 'post': {'responses': {}}}, + '/DocumentBuilder/xinclude/vuln': { + 'post': {'responses': {}}}, + '/DocumentHelper/vuln': { + 'post': {'responses': {}}}, + '/HttpSyncClients/vuln': { + 'get': {'responses': {}}}, + '/HttpURLConnection/sec': { + 'get': {'responses': {}}}, + '/HttpURLConnection/vuln': { + 'get': {'responses': {}}}, + '/IOUtils/sec': { + 'get': {'responses': {}}}, + '/ImageIO/sec': { + 'get': {'responses': {}}}, + '/Jsoup/sec': { + 'get': {'responses': {}}}, + '/ProcessBuilder': { + 'get': {'responses': {}}}, + '/SAXBuilder/sec': { + 'post': {'responses': {}}}, + '/SAXBuilder/vuln': { + 'post': {'responses': {}}}, + '/SAXParser/sec': { + 'post': {'responses': {}}}, + '/SAXParser/vuln': { + 'post': {'responses': {}}}, + '/SAXReader/sec': { + 'post': {'responses': {}}}, + '/SAXReader/vuln': { + 'post': {'responses': {}}}, + '/XMLReader/sec': { + 'post': {'responses': {}}}, + '/XMLReader/vuln': { + 'post': {'responses': {}}}, + '/aa': {}, '/any': { + 'get': {'responses': {}}}, '/appInfo': {}, + '/application/javascript': { + 'get': {'responses': {}}}, + '/classloader': {}, + '/codeinject': { + 'get': {'responses': {}}}, + '/codeinject/host': { + 'get': {'responses': {}}}, + '/codeinject/sec': { + 'get': {'responses': {}}}, + '/commonsHttpClient/sec': { + 'get': {'responses': {}}}, + '/createToken': { + 'get': {'responses': {}}}, + '/deserialize': { + 'post': {'responses': {}}}, + '/dnsrebind/vuln': { + 'get': {'responses': {}}}, + '/exclued/vuln': { + 'get': {'responses': {}}}, + '/fastjsonp/getToken': { + 'get': {'responses': {}}}, + '/forward': {}, '/getName': { + 'get': {'responses': {}}}, '/getToken': {'get': {'responses': {}}}, + '/httpclient/sec': { + 'get': {'responses': {}}}, + '/hutool/vuln': { + 'get': {'responses': {}}}, + '/index': {}, '/jdbc/ps/vuln': {}, + '/jdbc/sec': {}, '/jdbc/vuln': {}, + '/jscmd': { + 'get': {'responses': {}}}, + '/log4j': { + 'get': {'responses': {}}}, + '/login': {}, '/logout': { + 'get': {'responses': {}}}, '/mybatis/orderby/sec04': { + 'get': {'responses': {}}}, '/mybatis/orderby/vuln03': { + 'get': {'responses': {}}}, '/mybatis/sec01': { + 'get': {'responses': {}}}, '/mybatis/sec02': { + 'get': {'responses': {}}}, '/mybatis/sec03': { + 'get': {'responses': {}}}, '/mybatis/vuln01': { + 'get': {'responses': {}}}, '/mybatis/vuln02': { + 'get': {'responses': {}}}, '/noproxy': {}, '/object2jsonp': {}, + '/okhttp/sec': { + 'get': {'responses': {}}}, + '/openStream': { + 'get': {'responses': {}}}, + '/path_traversal/sec': { + 'get': {'responses': {}}}, + '/path_traversal/vul': { + 'get': {'responses': {}}}, + '/pic': { + 'get': {'responses': {}}}, + '/post': { + 'post': {'responses': {}}}, + '/postgresql': { + 'post': {'responses': {}}}, + '/proxy': {}, '/readxlsx': { + 'post': {'responses': {}}}, '/redirect': {'get': {'responses': {}}}, + '/reflect': {}, + '/rememberMe/security': {}, + '/rememberMe/vuln': {}, + '/request/sec': { + 'get': {'responses': {}}}, + '/restTemplate/vuln1': { + 'get': {'responses': {}}}, + '/restTemplate/vuln2': { + 'get': {'responses': {}}}, + '/runtime/exec': { + 'get': {'responses': {}}}, + '/safe': {}, '/safecode': {}, + '/sec': { + 'get': {'responses': {}}}, + '/sec/array_indexOf': { + 'get': {'responses': {}}}, + '/sec/checkOrigin': { + 'get': {'responses': {}}}, + '/sec/checkReferer': {}, + '/sec/corsFilter': {}, + '/sec/crossOrigin': { + 'get': {'responses': {}}}, + '/sec/httpCors': { + 'get': {'responses': {}}}, + '/sec/originFilter': { + 'get': {'responses': {}}}, + '/sec/webMvcConfigurer': { + 'get': {'responses': {}}}, + '/sec/yarm': { + 'get': {'responses': {}}}, + '/sendRedirect': {}, + '/sendRedirect/sec': {}, + '/setHeader': { + 'head': {'responses': {}}}, + '/spel/vuln': { + 'get': {'responses': {}}}, + '/status': { + 'get': {'responses': {}}}, + '/stored/show': {}, + '/stored/store': {}, '/upload': { + 'get': {'responses': {}}, 'post': {'responses': {}}}, + '/upload/picture': { + 'post': {'responses': {}}}, + '/urlConnection/sec': { + 'get': {'responses': {}}}, + '/urlConnection/vuln': { + 'get': {'responses': {}}, + 'post': {'responses': {}}}, + '/velocity': { + 'get': {'responses': {}}}, + '/vuln/contains': { + 'get': {'responses': {}}}, + '/vuln/crossOrigin': {}, + '/vuln/emptyReferer': {}, + '/vuln/endsWith': { + 'get': {'responses': {}}}, + '/vuln/mappingJackson2JsonView': {}, + '/vuln/origin': { + 'get': {'responses': {}}}, + '/vuln/referer': {}, + '/vuln/regex': { + 'get': {'responses': {}}}, + '/vuln/setHeader': { + 'get': {'responses': {}}, + 'head': {'responses': {}}}, + '/vuln/url_bypass': { + 'get': {'responses': {}}}, + '/vuln/yarm': { + 'get': {'responses': {}}}, + '/vuln01': { + 'get': {'responses': {}}}, + '/vuln02': { + 'get': {'responses': {}}}, + '/vuln03': { + 'get': {'responses': {}}}, + '/vuln04': { + 'get': {'responses': {}}}, + '/vuln05': { + 'get': {'responses': {}}}, + '/vuln06': { + 'get': {'responses': {}}}, + '/websocket/cmd': {}, + '/websocket/proxy': {}, + '/xmlReader/sec': { + 'post': {'responses': {}}}, + '/xmlReader/vuln': { + 'post': {'responses': {}}}, + '/xmlbeam/vuln': { + 'post': {'responses': {}}}, + '/xstream': { + 'post': {'responses': {}}}} + assert len(js_usages_1.convert_usages()) == 114 + assert len(js_usages_2.convert_usages()) == 15 + assert py_usages_1.convert_usages() == { + '/': {}, '/dags/{dag_id}': { + 'parameters': [{'in': 'path', 'name': 'dag_id', 'required': True, + 'schema': {'type': 'string'}}]}, + '/dags/{dag_id}/code': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/dags/{dag_id}/dag_runs': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/dags/{dag_id}/dag_runs/{' + 'execution_date}': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}, + {'in': 'path', + 'name': + 'execution_date', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/dags/{dag_id}/dag_runs/{' + 'execution_date}/tasks/{task_id}': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}, + {'in': 'path', + 'name': + 'execution_date', + 'required': + True, + 'schema': { + 'type': + 'string'}}, + {'in': 'path', + 'name': + 'task_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/dags/{dag_id}/paused': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/dags/{dag_id}/paused/{paused}': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}, + {'in': 'path', + 'name': + 'paused', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/dags/{dag_id}/tasks/{task_id}': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}, + {'in': 'path', + 'name': + 'task_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/info': {}, '/latest_runs': {}, + '/lineage/{dag_id}/{' + 'execution_date}': { + 'parameters': [{'in': 'path', + 'name': + 'dag_id', + 'required': + True, + 'schema': { + 'type': + 'string'}}, + {'in': 'path', + 'name': + 'execution_date', + 'required': + True, + 'schema': { + 'type': + 'string'}}]}, + '/log/{filename}': {'parameters': [ + {'in': 'path', + 'name': 'filename', + 'required': True, 'schema': { + 'type': 'string'}}]}, + '/pools': {}, '/pools/{name}': { + 'parameters': [{'in': 'path', 'name': 'name', 'required': True, + 'schema': {'type': 'string'}}]}, '/test': {}} + assert py_usages_2.convert_usages() == {'/': {}, '/auth/google': {}, '/logout': {}}