@@ -95,8 +95,10 @@ def get_docker_version() -> str | None:
9595
9696
9797def fetch_json (url : str ) -> dict :
98+ if not url .startswith ("https://" ):
99+ raise ValueError (f"Refusing to open non-HTTPS URL: { url !r} " )
98100 req = Request (url , headers = {"User-Agent" : "arcadedb-bench" })
99- with urlopen (req , timeout = 30 ) as response :
101+ with urlopen (req , timeout = 30 ) as response : # nosec B310 - https-only
100102 payload = json .load (response )
101103 if not isinstance (payload , dict ):
102104 raise RuntimeError (f"Expected JSON object from { url } " )
@@ -962,7 +964,9 @@ def wait_for_qdrant_ready(host: str, port: int, timeout_sec: int = 120) -> None:
962964 while True :
963965 for url in urls :
964966 try :
965- with urlopen (url , timeout = 3 ) as response :
967+ with urlopen (
968+ url , timeout = 3
969+ ) as response : # nosec B310 - localhost health-check URL
966970 if 200 <= int (response .status ) < 500 :
967971 return
968972 except Exception :
@@ -1012,7 +1016,9 @@ def ensure_milvus_compose_file(compose_file: Path, release_tag: str) -> None:
10121016 "https://github.com/milvus-io/milvus/releases/download/"
10131017 f"{ release_tag } /milvus-standalone-docker-compose.yml"
10141018 )
1015- urlretrieve (url , str (compose_file ))
1019+ urlretrieve (
1020+ url , str (compose_file )
1021+ ) # nosec B310 - url is a hardcoded https://github.com URL
10161022 raw = compose_file .read_text (encoding = "utf-8" )
10171023
10181024 sanitized = re .sub (r"(?m)^\s*container_name:\s*.*\n" , "" , raw )
0 commit comments