cocoonstack-sandbox 0.1.2__tar.gz → 0.1.3__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.
Files changed (25) hide show
  1. {cocoonstack_sandbox-0.1.2/cocoonstack_sandbox.egg-info → cocoonstack_sandbox-0.1.3}/PKG-INFO +1 -1
  2. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/frames.py +4 -6
  3. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/sandbox.py +2 -3
  4. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3/cocoonstack_sandbox.egg-info}/PKG-INFO +1 -1
  5. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/pyproject.toml +1 -1
  6. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/LICENSE +0 -0
  7. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/README.md +0 -0
  8. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/__init__.py +0 -0
  9. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/checkpoint.py +0 -0
  10. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/client.py +0 -0
  11. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/conn.py +0 -0
  12. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/errors.py +0 -0
  13. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/template.py +0 -0
  14. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/SOURCES.txt +0 -0
  15. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/dependency_links.txt +0 -0
  16. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/top_level.txt +0 -0
  17. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/setup.cfg +0 -0
  18. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_client.py +0 -0
  19. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_fault_matrix.py +0 -0
  20. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_fixtures.py +0 -0
  21. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_frames.py +0 -0
  22. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_hardening.py +0 -0
  23. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_proc.py +0 -0
  24. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_proxy.py +0 -0
  25. {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_wire_binding.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoonstack-sandbox
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Python SDK for the cocoon sandbox control plane
5
5
  License: Apache-2.0
6
6
  Requires-Python: >=3.9
@@ -32,12 +32,10 @@ def encode_request(op: str, **fields) -> bytes:
32
32
  def decode_response(line: bytes) -> dict:
33
33
  """Parses one response frame; the returned dict carries its tag under
34
34
  "type" and any binary payload decoded under "data"."""
35
- # Bulk frames (stdout/stderr/data) are the throughput path where json.loads
36
- # of the big base64 string dominates. base64 is JSON-escape-free and these
37
- # frames carry exactly {"type":...,"data":...}, so slice both out and skip
38
- # json — but only for that exact shape; anything else (extra fields,
39
- # trailing bytes, non-alphabet bytes in the segment) gets the full parse
40
- # instead of a silently wrong slice.
35
+ # base64 is JSON-escape-free, so a frame shaped exactly {"type":...,
36
+ # "data":...} can be sliced directly, skipping json.loads; any other
37
+ # shape (extra fields, trailing bytes, non-alphabet bytes) falls through
38
+ # to the full parse instead of risking a silently wrong slice.
41
39
  if line.startswith(b'{"type":"'):
42
40
  te = line.find(b'"', 9)
43
41
  if te > 0 and line[9:te] in (b"stdout", b"stderr", b"data") and line.startswith(b'","data":"', te):
@@ -67,12 +67,11 @@ class Sandbox:
67
67
  return code
68
68
 
69
69
  def spawn(self, *argv: str, cwd: str = "", env: dict | None = None,
70
- user: str = "", session: str = "") -> int:
70
+ user: str = "") -> int:
71
71
  """Starts argv detached, returning its pid immediately; the process
72
72
  keeps a bounded output ring readable later via logs()/attach()."""
73
73
  started = self._call("exec", "started", argv=list(argv), cwd=cwd or None,
74
- env=env, user=user or None, session=session or None,
75
- detach=True)
74
+ env=env, user=user or None, detach=True)
76
75
  return started["pid"]
77
76
 
78
77
  def ps(self) -> list[dict]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoonstack-sandbox
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Python SDK for the cocoon sandbox control plane
5
5
  License: Apache-2.0
6
6
  Requires-Python: >=3.9
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cocoonstack-sandbox"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Python SDK for the cocoon sandbox control plane"
9
9
  requires-python = ">=3.9"
10
10
  license = { text = "Apache-2.0" }