Explorar o código

Resolved conflicts

maziggy hai 2 meses
pai
achega
428f3f2db1

+ 2 - 2
backend/tests/integration/test_archives_api.py

@@ -1709,7 +1709,7 @@ class TestUploadSourceThreeMF:
         archive = await archive_factory(
             printer.id,
             print_name="Corrupt Path",
-            file_path="/tmp/totally_outside.gcode.3mf",
+            file_path="/tmp/totally_outside.gcode.3mf",  # nosec B108
             filename="totally_outside.gcode.3mf",
         )
 
@@ -1719,4 +1719,4 @@ class TestUploadSourceThreeMF:
         assert response.status_code == 500
         assert "outside the data directory" in response.json()["detail"]
         # Did not write anything under the bogus /tmp/source/ either.
-        assert not (Path("/tmp") / "source").exists() or not (Path("/tmp") / "source" / "totally_outside.3mf").exists()
+        assert not (Path("/tmp") / "source").exists() or not (Path("/tmp") / "source" / "totally_outside.3mf").exists()  # nosec B108

+ 1 - 1
backend/tests/integration/test_queue_start_user_attribution.py

@@ -78,7 +78,7 @@ async def queue_item(db_session):
     archive = PrintArchive(
         filename="Plate_1.gcode.3mf",
         print_name="Plate 1",
-        file_path="/tmp/queue1670_plate.3mf",
+        file_path="/tmp/queue1670_plate.3mf",  # nosec B108
         file_size=1024,
         content_hash="queue1670hash",
         status="completed",

+ 2 - 2
backend/tests/unit/services/test_attach_timelapse_safe_path.py

@@ -78,11 +78,11 @@ async def test_attach_timelapse_rejects_absolute_filename(tmp_path: Path, monkey
     result = await service.attach_timelapse(
         archive_id=1,
         timelapse_data=b"x",
-        filename="/tmp/owned_via_absolute",
+        filename="/tmp/owned_via_absolute",  # nosec B108
     )
 
     assert result is False
-    assert not Path("/tmp/owned_via_absolute").exists()
+    assert not Path("/tmp/owned_via_absolute").exists()  # nosec B108
 
 
 @pytest.mark.asyncio

+ 2 - 2
backend/tests/unit/test_vp_mqtt_bridge.py

@@ -1565,7 +1565,7 @@ class TestBindAddressAutoResolve:
     async def test_rewrite_arms_via_auto_resolved_host_ip(self):
         """When bind_address is 0.0.0.0, fall back to the host interface in
         the target printer's subnet and rewrite to that IP."""
-        server = _make_server(bind_address="0.0.0.0")
+        server = _make_server(bind_address="0.0.0.0")  # nosec B104
         bridge = _make_bridge(server)
         with patch(
             "backend.app.services.virtual_printer.mqtt_bridge._resolve_host_interface_for_target",
@@ -1680,7 +1680,7 @@ class TestNotArmedDiagnosticLogging:
         assert "no ip_address" in not_armed[0].getMessage()
 
     def test_no_matching_host_interface_logs_specific_reason(self, caplog):
-        server = _make_server(bind_address="0.0.0.0")
+        server = _make_server(bind_address="0.0.0.0")  # nosec B104
         bridge = _make_bridge(server)
         with (
             patch(