Skip to content

Sandbox Process Creation #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jtd_codebuild/generators/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import subprocess
from typing import Dict, Any, AnyStr, List
from ..utils import safe_mkdir
from security import safe_command


class JTDCodeGenerator:
Expand Down Expand Up @@ -66,8 +67,7 @@ def generate(
target_language = target["language"]
target_path = self.get_target_path(target)
safe_mkdir(target_path)
process = subprocess.Popen(
self._codegen_command(self.schema_path, target_path, target_language),
process = safe_command.run(subprocess.Popen, self._codegen_command(self.schema_path, target_path, target_language),
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand Down
4 changes: 2 additions & 2 deletions jtd_codebuild/generators/typescript_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Dict, Any, AnyStr, List
from ..utils import wait_for_processes
from .generator import JTDCodeGenerator
from security import safe_command


class JTDCodeGeneratorTypescriptTarget(JTDCodeGenerator):
Expand All @@ -19,8 +20,7 @@ def _compile_typescript(self, tsconfig_path: str) -> subprocess.Popen:
Args:
tsconfig_path: The path to the tsconfig.json file.
"""
return subprocess.run(
f"tsc --project {tsconfig_path}",
return safe_command.run(subprocess.run, f"tsc --project {tsconfig_path}",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ python = ">=3.8.1,<4.0"
pyyaml = "^6.0.1"
click = "^8.1.7"
case-converter = "^1.1.0"
security = "==1.3.1"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Python API calls.

License: MITOpen SourceMore facts


[tool.poetry.group.dev.dependencies]
flake8 = "^6.1.0"
Expand Down