Skip to content

Commit bd3f159

Browse files
Sandbox Process Creation
1 parent 1cb6204 commit bd3f159

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

jtd_codebuild/generators/generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import subprocess
33
from typing import Dict, Any, AnyStr, List
44
from ..utils import safe_mkdir
5+
from security import safe_command
56

67

78
class JTDCodeGenerator:
@@ -66,8 +67,7 @@ def generate(
6667
target_language = target["language"]
6768
target_path = self.get_target_path(target)
6869
safe_mkdir(target_path)
69-
process = subprocess.Popen(
70-
self._codegen_command(self.schema_path, target_path, target_language),
70+
process = safe_command.run(subprocess.Popen, self._codegen_command(self.schema_path, target_path, target_language),
7171
shell=True,
7272
stdout=subprocess.PIPE,
7373
stderr=subprocess.PIPE,

jtd_codebuild/generators/typescript_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Dict, Any, AnyStr, List
44
from ..utils import wait_for_processes
55
from .generator import JTDCodeGenerator
6+
from security import safe_command
67

78

89
class JTDCodeGeneratorTypescriptTarget(JTDCodeGenerator):
@@ -19,8 +20,7 @@ def _compile_typescript(self, tsconfig_path: str) -> subprocess.Popen:
1920
Args:
2021
tsconfig_path: The path to the tsconfig.json file.
2122
"""
22-
return subprocess.run(
23-
f"tsc --project {tsconfig_path}",
23+
return safe_command.run(subprocess.run, f"tsc --project {tsconfig_path}",
2424
shell=True,
2525
stdout=subprocess.PIPE,
2626
stderr=subprocess.PIPE,

0 commit comments

Comments
 (0)