diff --git a/pyproject.toml b/pyproject.toml index 5a24b3e92..b5d68ef27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ classifiers = [ [tool.poetry.dependencies] python = ">=3.11,<3.13" +security = "==1.3.1" [tool.poetry.dev-dependencies] pre-commit = "^3.7.1" diff --git a/spiffworkflow-backend/bin/load_test_message_start_event.py b/spiffworkflow-backend/bin/load_test_message_start_event.py index 37d7d6dcd..e9fb6e3f7 100755 --- a/spiffworkflow-backend/bin/load_test_message_start_event.py +++ b/spiffworkflow-backend/bin/load_test_message_start_event.py @@ -4,6 +4,7 @@ import os import subprocess import sys +from security import safe_command def get_access_token(script_dir, username="admin", password="admin", realm_name="spiffworkflow"): @@ -23,7 +24,7 @@ def run_curl_command(message_identifier, access_token, backend_base_url): try: # Login command login_cmd = f"curl --silent -X POST '{backend_base_url}/v1.0/login_with_access_token?access_token={access_token}' -H 'Authorization: Bearer {access_token}' >/dev/null" - subprocess.run(login_cmd, shell=True, check=True) + safe_command.run(subprocess.run, login_cmd, shell=True, check=True) # Message sending command message_cmd = f"curl --silent -X POST '{backend_base_url}/v1.0/messages/{message_identifier}?execution_mode=asynchronous' -H 'Authorization: Bearer {access_token}' -d '{{\"payload\": {{\"email\": \"HEY@example.com\"}}}}' -H 'Content-type: application/json'"