File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11<a id = " camel.toolkits.terminal_toolkit.utils" ></a >
22
3- <a id = " camel.toolkits.terminal_toolkit.utils.contains_command_chaining " ></a >
3+ <a id = " camel.toolkits.terminal_toolkit.utils.check_command_safety " ></a >
44
5- ## contains_command_chaining
5+ ## check_command_safety
66
77``` python
8- def contains_command_chaining (command : str ):
8+ def check_command_safety (command : str , allowed_commands : Optional[Set[ str ]] = None ):
99```
1010
11- Check if command contains chaining operators that could be used to
12- bypass security.
11+ Check if a command (potentially with chaining) is safe to execute.
12+
13+ ** Parameters:**
14+
15+ - ** command** (str): The command string to check
16+ - ** allowed_commands** (Optional[ Set[ str]] ): Set of allowed commands (whitelist mode)
17+
18+ ** Returns:**
19+
20+ Tuple[ bool, str] : (is_safe, reason)
1321
1422<a id = " camel.toolkits.terminal_toolkit.utils.sanitize_command" ></a >
1523
You can’t perform that action at this time.
0 commit comments