vaultrun-sdk 0.4.12__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vaultrun-sdk
3
- Version: 0.4.12
3
+ Version: 0.5.2
4
4
  Summary: Python SDK for VaultRun — self-hosted secure AI agent sandbox runtime (Docker, MCP, audit trail)
5
5
  License: Apache-2.0
6
6
  Project-URL: Homepage, https://vaultrun.dev
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "vaultrun-sdk"
7
- version = "0.4.12"
7
+ version = "0.5.2"
8
8
  description = "Python SDK for VaultRun — self-hosted secure AI agent sandbox runtime (Docker, MCP, audit trail)"
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
@@ -273,6 +273,20 @@ def test_download_file_success(client: Client) -> None:
273
273
  assert result == file_bytes
274
274
 
275
275
 
276
+ @rsps.activate
277
+ def test_export_evidence(client: Client) -> None:
278
+ pack = b'{"pack":"e30=","signature":{"alg":"ed25519"}}'
279
+ rsps.add(
280
+ rsps.GET,
281
+ f"{BASE_URL}/api/v1/sessions/{SESSION_ID}/evidence",
282
+ body=pack,
283
+ status=200,
284
+ content_type="application/json",
285
+ )
286
+
287
+ assert client.export_evidence(SESSION_ID) == pack
288
+
289
+
276
290
  # ---------------------------------------------------------------------------
277
291
  # test_delete_session
278
292
  # ---------------------------------------------------------------------------
@@ -580,6 +594,23 @@ def test_download_workspace(client: Client) -> None:
580
594
  assert len(rsps.calls) == 1
581
595
 
582
596
 
597
+ def test_download_workspace_timeout_is_none(client: Client, monkeypatch: pytest.MonkeyPatch) -> None:
598
+ """urllib3 rejects timeout <= 0. None means no timeout."""
599
+ seen: dict[str, object] = {}
600
+
601
+ class Resp:
602
+ content = b"PK"
603
+ status_code = 200
604
+
605
+ def fake_get(url: str, timeout: object = None, **kwargs: object) -> Resp:
606
+ seen["timeout"] = timeout
607
+ return Resp()
608
+
609
+ monkeypatch.setattr(client._session, "get", fake_get)
610
+ assert client.download_workspace(SESSION_ID) == b"PK"
611
+ assert seen["timeout"] is None
612
+
613
+
583
614
  # ---------------------------------------------------------------------------
584
615
  # test_verify_webhook_signature_valid
585
616
  # ---------------------------------------------------------------------------
@@ -459,11 +459,25 @@ class Client:
459
459
  self._raise_for_status(resp)
460
460
  return resp.content
461
461
 
462
+ def export_evidence(self, session_id: str) -> bytes:
463
+ """Download the session's signed evidence pack.
464
+
465
+ Write the bytes to a file and verify it offline with
466
+ ``vaultrun evidence verify pack.json --key vaultrun-evidence.pub``.
467
+ The server needs ``EVIDENCE_SIGNING_KEY``.
468
+ """
469
+ resp = self._session.get(
470
+ self.base_url + f"/api/v1/sessions/{session_id}/evidence",
471
+ timeout=self._timeout,
472
+ )
473
+ self._raise_for_status(resp)
474
+ return resp.content
475
+
462
476
  def download_workspace(self, session_id: str) -> bytes:
463
477
  """Download the entire session workspace as a ZIP archive."""
464
478
  resp = self._session.get(
465
479
  self.base_url + f"/api/v1/sessions/{session_id}/workspace.zip",
466
- timeout=0, # no timeout — workspace may be large
480
+ timeout=None, # no timeout — a large workspace must not be cut off. 0 makes urllib3 raise.
467
481
  )
468
482
  self._raise_for_status(resp)
469
483
  return resp.content
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vaultrun-sdk
3
- Version: 0.4.12
3
+ Version: 0.5.2
4
4
  Summary: Python SDK for VaultRun — self-hosted secure AI agent sandbox runtime (Docker, MCP, audit trail)
5
5
  License: Apache-2.0
6
6
  Project-URL: Homepage, https://vaultrun.dev
File without changes
File without changes