Skip to content

Commit

Permalink
Switch from the Nashorn engine to Graal.js for executing the the expo…
Browse files Browse the repository at this point in the history
…rt-site-tree script (#234)

Switch from the Nashorn engine to Graal.js for executing the export-site-tree script
  • Loading branch information
ccronca authored Nov 4, 2024
1 parent edee2e9 commit 3a5206c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions scanners/zap/zap.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,6 @@ def _setup_export_site_tree(self):
"action": "add",
"type": "standalone",
"name": "export-site-tree-filename-global-var",
# Setting the engine to Oracle Nashorn causes the script to fail because
# the engine can't be found when using inline scripts. Not sure why this happens
"engine": "ECMAScript : Graal.js",
"inline": f"""
org.zaproxy.zap.extension.script.ScriptVars.setGlobalVar('siteTreeFileName','{self.SITE_TREE_FILENAME}')
Expand All @@ -414,7 +412,7 @@ def _setup_export_site_tree(self):
"parameters": {
"action": "add",
"type": "standalone",
"engine": "ECMAScript : Oracle Nashorn",
"engine": "ECMAScript : Graal.js",
"name": "export-site-tree",
"file": f"{scripts_dir}/export-site-tree.js",
},
Expand Down
2 changes: 1 addition & 1 deletion tests/scanners/zap/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def test_setup_export_site_tree(test_config, pytestconfig):

assert add_script["parameters"]["name"] == run_script["parameters"]["name"]
assert add_script["parameters"]["file"] == f"{pytestconfig.rootpath}/scanners/zap/scripts/export-site-tree.js"
assert add_script["parameters"]["engine"] == "ECMAScript : Oracle Nashorn"
assert add_script["parameters"]["engine"] == "ECMAScript : Graal.js"

assert add_variable_script["parameters"]["name"] == run_variable_script["parameters"]["name"]
assert add_variable_script["parameters"]["inline"]
Expand Down

0 comments on commit 3a5206c

Please sign in to comment.