Skip to content

Commit 5d2184d

Browse files
committed
Fix remaining security test and unit test failures
1 parent b35c9ee commit 5d2184d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/zenml/deployers/server/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ def runtime_error_handler(request: Request, exc: RuntimeError) -> JSONResponse:
343343
help="Pipeline snapshot ID",
344344
)
345345
parser.add_argument(
346-
"--host", default=os.getenv("ZENML_SERVICE_HOST", "0.0.0.0")
346+
"--host",
347+
default=os.getenv("ZENML_SERVICE_HOST", "0.0.0.0"), # nosec
347348
)
348349
parser.add_argument(
349350
"--port",

src/zenml/deployers/server/entrypoint_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def get_entrypoint_arguments(cls, **kwargs: Any) -> List[str]:
9292
f"--{DEPLOYMENT_ID_OPTION}",
9393
str(kwargs.get(DEPLOYMENT_ID_OPTION, "")),
9494
f"--{HOST_OPTION}",
95-
str(kwargs.get(HOST_OPTION, "0.0.0.0")),
95+
str(kwargs.get(HOST_OPTION, "0.0.0.0")), # nosec
9696
f"--{PORT_OPTION}",
9797
str(kwargs.get(PORT_OPTION, 8001)),
9898
f"--{WORKERS_OPTION}",
@@ -140,7 +140,7 @@ def run(self) -> None:
140140

141141
# Extract configuration from entrypoint args
142142
deployment_id = self.entrypoint_args[DEPLOYMENT_ID_OPTION]
143-
host = self.entrypoint_args.get(HOST_OPTION, "0.0.0.0")
143+
host = self.entrypoint_args.get(HOST_OPTION, "0.0.0.0") # nosec
144144
port = int(self.entrypoint_args.get(PORT_OPTION, 8001))
145145
workers = int(self.entrypoint_args.get(WORKERS_OPTION, 1))
146146
log_level = self.entrypoint_args.get(LOG_LEVEL_OPTION, "info")

tests/integration/integrations/aws/deployers/test_app_runner_deployer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
import re
17-
from typing import List, Tuple
17+
from typing import List, Optional, Tuple
1818

1919
import requests
2020
from bs4 import BeautifulSoup
@@ -73,12 +73,12 @@ def _fetch_documented_supported_resource_combinations(
7373
return sorted(set(rows), key=lambda x: (x[0], x[1]))
7474

7575

76-
def _to_vcpu(s: str) -> float | None:
76+
def _to_vcpu(s: str) -> Optional[float]:
7777
m = re.search(r"([\d.]+)\s*v?CPU", s, re.IGNORECASE)
7878
return float(m.group(1)) if m else None
7979

8080

81-
def _to_gb(s: str) -> float | None:
81+
def _to_gb(s: str) -> Optional[float]:
8282
# Accept MB/GB but App Runner uses GB in the table
8383
m = re.search(r"([\d.]+)\s*GB", s, re.IGNORECASE)
8484
if m:

0 commit comments

Comments
 (0)