cwl_utils.sandboxjs
Safe execution of CWL Expressions in a NodeJS sandbox.
Attributes
Default number of seconds to wait while running a javascript engine. |
|
Classes
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
Functions
|
|
|
|
|
|
|
|
|
|
|
Run a javascript text. |
|
Module Contents
- cwl_utils.sandboxjs.default_timeout = 20
Default number of seconds to wait while running a javascript engine.
- cwl_utils.sandboxjs.seg_symbol = '\\w+'
- cwl_utils.sandboxjs.seg_single = "\\['([^']|\\\\')+'\\]"
- cwl_utils.sandboxjs.seg_double = '\\["([^"]|\\\\")+"\\]'
- cwl_utils.sandboxjs.seg_index = '\\[[0-9]+\\]'
- cwl_utils.sandboxjs.segments
- cwl_utils.sandboxjs.segment_re
- cwl_utils.sandboxjs.param_str
- cwl_utils.sandboxjs.param_re
- cwl_utils.sandboxjs.code_fragment_to_js(jscript, jslib='')
- class cwl_utils.sandboxjs.JSEngine
Bases:
abc.ABC
Helper class that provides a standard way to create an ABC using inheritance.
- abstract eval(scan, jslib='', **kwargs)
- Parameters:
- Return type:
Union[cwl_utils.types.CWLOutputType, collections.abc.Awaitable[cwl_utils.types.CWLOutputType]]
- abstract regex_eval(parsed_string, remaining_string, current_value, **kwargs)
- Parameters:
- Return type:
Union[cwl_utils.types.CWLOutputType, collections.abc.Awaitable[cwl_utils.types.CWLOutputType]]
- class cwl_utils.sandboxjs.NodeJSEngine(have_node_slim=False, minimum_node_version_str='0.10.26', process_finished_str='r1cepzbhUTxtykz5XTC4\n')
Bases:
JSEngine
Helper class that provides a standard way to create an ABC using inheritance.
- localdata
- processes_to_kill: Deque[subprocess.Popen[str]]
- __del__()
- Return type:
None
- check_js_threshold_version(working_alias)
Check if the nodeJS engine version on the system with the allowed minimum version.
https://github.com/nodejs/node/blob/master/CHANGELOG.md#nodejs-changelog
- exec_js_process(js_text, timeout=default_timeout, js_console=False, context=None, force_docker_pull=False, container_engine='docker')
Run a javascript text.
- new_js_proc(js_text, force_docker_pull=False, container_engine='docker')
Return a subprocess ready to submit javascript to.
- Parameters:
- Return type:
- eval(scan, jslib='', timeout=default_timeout, force_docker_pull=False, debug=False, js_console=False, container_engine='docker', **kwargs)
- cwl_utils.sandboxjs.check_js_threshold_version(*args, **kwargs)
- Parameters:
args (Any)
kwargs (Any)
- Return type:
- cwl_utils.sandboxjs.exec_js_process(*args, **kwargs)
Run a javascript text.
- cwl_utils.sandboxjs.new_js_proc(*args, **kwargs)
- Parameters:
args (Any)
kwargs (Any)
- Return type: