Skip to content

Commit

Permalink
Run quoted hylang expressions from within conditional operations
Browse files Browse the repository at this point in the history
  • Loading branch information
danielonsecurity committed Mar 1, 2023
1 parent f8e93d3 commit f311b38
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions raider/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import re
import sys
import hy
from functools import partial
from typing import Any, Callable, List, Optional, Union

Expand Down Expand Up @@ -56,9 +57,12 @@ def execute_actions(

if isinstance(operations, list):
for item in operations:
output = item.run(pconfig, response)
if output or isinstance(output, bool):
return output
if isinstance(item, hy.models.Expression):
hy.eval(item)
else:
output = item.run(pconfig, response)
if output or isinstance(output, bool):
return output
return None


Expand Down

0 comments on commit f311b38

Please sign in to comment.