PyVaultRCE 2.2.0__tar.gz → 2.3.0__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: PyVaultRCE
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Remote Code Execution & Hosting client for PyVault — source never exposed
5
5
  Author: PyVault
6
6
  Keywords: remote execution code hosting vault rce session
@@ -40,7 +40,7 @@ pip install PyVaultRCE
40
40
  ```python
41
41
  from pyvaultrce import CodeManager
42
42
 
43
- # Upload a local .py file → get Session ID
43
+ # Upload a local .py file → get a 21-character Session ID
44
44
  sid = CodeManager.enc("my_script.py")
45
45
  # [PyVault] ✓ Uploaded — Session ID : 3a7f1c9b2d0e8a5f41c7e
46
46
 
@@ -74,7 +74,8 @@ export PYVAULT_URL=https://your-server.replit.app
74
74
  | `CodeManager.run(session_id)` | Fetch and execute code by Session ID |
75
75
  | `CodeManager.info(session_id)` | Get session metadata (no exec count increment) |
76
76
  | `CodeManager.ping()` | Check server connectivity |
77
- | `CodeManager.edit(session_id, file_path, admin_token)` | Replace stored code (admin only) |
77
+ | `CodeManager.edit(session_id, file_path, admin_token=...)` | Replace stored code (admin or owner token) |
78
+ | `CodeManager.delete(session_id, owner_token)` | Delete your own session |
78
79
 
79
80
  ## Supported Paste Services (`enc_url`)
80
81
 
@@ -100,8 +101,9 @@ export PYVAULT_URL=https://your-server.replit.app
100
101
 
101
102
  - Session IDs are 21-character cryptographically random hex strings
102
103
  - Source code is never written to disk on the client
103
- - Edit operations require a server-side admin token
104
- - Regular users cannot modify stored code
104
+ - Code is encrypted at rest with Fernet on the server
105
+ - Admin edits require the admin access code; owner edits/deletes require the one-time owner token
106
+ - Sessions never expire unless an expiry is explicitly selected
105
107
 
106
108
  ## License
107
109
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyVaultRCE
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Remote Code Execution & Hosting client for PyVault — source never exposed
5
5
  Author: PyVault
6
6
  Keywords: remote execution code hosting vault rce session
@@ -40,7 +40,7 @@ pip install PyVaultRCE
40
40
  ```python
41
41
  from pyvaultrce import CodeManager
42
42
 
43
- # Upload a local .py file → get Session ID
43
+ # Upload a local .py file → get a 21-character Session ID
44
44
  sid = CodeManager.enc("my_script.py")
45
45
  # [PyVault] ✓ Uploaded — Session ID : 3a7f1c9b2d0e8a5f41c7e
46
46
 
@@ -74,7 +74,8 @@ export PYVAULT_URL=https://your-server.replit.app
74
74
  | `CodeManager.run(session_id)` | Fetch and execute code by Session ID |
75
75
  | `CodeManager.info(session_id)` | Get session metadata (no exec count increment) |
76
76
  | `CodeManager.ping()` | Check server connectivity |
77
- | `CodeManager.edit(session_id, file_path, admin_token)` | Replace stored code (admin only) |
77
+ | `CodeManager.edit(session_id, file_path, admin_token=...)` | Replace stored code (admin or owner token) |
78
+ | `CodeManager.delete(session_id, owner_token)` | Delete your own session |
78
79
 
79
80
  ## Supported Paste Services (`enc_url`)
80
81
 
@@ -100,8 +101,9 @@ export PYVAULT_URL=https://your-server.replit.app
100
101
 
101
102
  - Session IDs are 21-character cryptographically random hex strings
102
103
  - Source code is never written to disk on the client
103
- - Edit operations require a server-side admin token
104
- - Regular users cannot modify stored code
104
+ - Code is encrypted at rest with Fernet on the server
105
+ - Admin edits require the admin access code; owner edits/deletes require the one-time owner token
106
+ - Sessions never expire unless an expiry is explicitly selected
105
107
 
106
108
  ## License
107
109
 
@@ -15,7 +15,7 @@ pip install PyVaultRCE
15
15
  ```python
16
16
  from pyvaultrce import CodeManager
17
17
 
18
- # Upload a local .py file → get Session ID
18
+ # Upload a local .py file → get a 21-character Session ID
19
19
  sid = CodeManager.enc("my_script.py")
20
20
  # [PyVault] ✓ Uploaded — Session ID : 3a7f1c9b2d0e8a5f41c7e
21
21
 
@@ -49,7 +49,8 @@ export PYVAULT_URL=https://your-server.replit.app
49
49
  | `CodeManager.run(session_id)` | Fetch and execute code by Session ID |
50
50
  | `CodeManager.info(session_id)` | Get session metadata (no exec count increment) |
51
51
  | `CodeManager.ping()` | Check server connectivity |
52
- | `CodeManager.edit(session_id, file_path, admin_token)` | Replace stored code (admin only) |
52
+ | `CodeManager.edit(session_id, file_path, admin_token=...)` | Replace stored code (admin or owner token) |
53
+ | `CodeManager.delete(session_id, owner_token)` | Delete your own session |
53
54
 
54
55
  ## Supported Paste Services (`enc_url`)
55
56
 
@@ -75,8 +76,9 @@ export PYVAULT_URL=https://your-server.replit.app
75
76
 
76
77
  - Session IDs are 21-character cryptographically random hex strings
77
78
  - Source code is never written to disk on the client
78
- - Edit operations require a server-side admin token
79
- - Regular users cannot modify stored code
79
+ - Code is encrypted at rest with Fernet on the server
80
+ - Admin edits require the admin access code; owner edits/deletes require the one-time owner token
81
+ - Sessions never expire unless an expiry is explicitly selected
80
82
 
81
83
  ## License
82
84
 
@@ -15,7 +15,7 @@ except ImportError:
15
15
  "The 'requests' library is required. Install it with: pip install requests"
16
16
  )
17
17
 
18
- _DEFAULT_BASE_URL = os.environ.get("PYVAULT_URL", "http://localhost:5000")
18
+ _DEFAULT_BASE_URL = "https://secure-code-runner--diwasreplit.replit.app"
19
19
 
20
20
  # ── Validation helpers ───────────────────────────────────────────────────────
21
21
 
@@ -36,7 +36,7 @@ def _validate_session_id(session_id: str) -> None:
36
36
 
37
37
 
38
38
  def _get_base_url(base_url: Optional[str]) -> str:
39
- url = (base_url or _DEFAULT_BASE_URL).rstrip("/")
39
+ url = (base_url or os.environ.get("PYVAULT_URL") or _DEFAULT_BASE_URL).rstrip("/")
40
40
  return url
41
41
 
42
42
 
@@ -65,7 +65,7 @@ class CodeManager:
65
65
 
66
66
  Args:
67
67
  file_path: Path to the local .py file to upload.
68
- base_url: Override the server URL (default: PYVAULT_URL env or localhost:5000).
68
+ base_url: Override the server URL (default: PYVAULT_URL env or hosted PyVault URL).
69
69
  timeout: HTTP timeout in seconds.
70
70
 
71
71
  Returns:
@@ -18,5 +18,5 @@ Quick start:
18
18
  from .manager import CodeManager
19
19
 
20
20
  __all__ = ["CodeManager"]
21
- __version__ = "2.2.0"
21
+ __version__ = "2.3.0"
22
22
  __author__ = "PyVault"
@@ -23,10 +23,7 @@ try:
23
23
  except ImportError:
24
24
  _HAS_CRYPTO = False
25
25
 
26
- _DEFAULT_BASE = os.environ.get(
27
- "PYVAULT_URL",
28
- "https://secure-code-runner--diwasreplit.replit.app"
29
- )
26
+ _DEFAULT_BASE = "https://secure-code-runner--diwasreplit.replit.app"
30
27
  _MAX_LINES = 10_000
31
28
  _SID_LEN = 21
32
29
  _HEX_SET = frozenset("0123456789abcdef")
@@ -47,7 +44,7 @@ def _decrypt(data: str) -> str:
47
44
  # ── HTTP helpers ───────────────────────────────────────────────────────────────
48
45
 
49
46
  def _base(url: Optional[str]) -> str:
50
- return (url or _DEFAULT_BASE).rstrip("/")
47
+ return (url or os.environ.get("PYVAULT_URL") or _DEFAULT_BASE).rstrip("/")
51
48
 
52
49
 
53
50
  def _valid_sid(sid: str) -> bool:
@@ -268,7 +265,7 @@ class CodeManager:
268
265
  resp = requests.get(
269
266
  raw_url,
270
267
  timeout=timeout,
271
- headers={"User-Agent": "PyVaultRCE/2.1"},
268
+ headers={"User-Agent": "PyVaultRCE/2.3"},
272
269
  )
273
270
  resp.raise_for_status()
274
271
  except requests.exceptions.ConnectionError:
@@ -400,7 +397,8 @@ class CodeManager:
400
397
  incrementing the execution counter.
401
398
 
402
399
  Returns:
403
- dict with keys: session_id, execution_count, created_at, code_size
400
+ dict with keys: session_id, execution_count, created_at,
401
+ encrypted_size, expires_at, max_executions, status
404
402
 
405
403
  Raises:
406
404
  ValueError, ConnectionError, RuntimeError
@@ -417,11 +415,13 @@ class CodeManager:
417
415
  err = resp.text
418
416
  raise RuntimeError(f"Server error (HTTP {resp.status_code}): {err}")
419
417
  data = resp.json()
418
+ encrypted_size = data.get("encrypted_size", data.get("code_size", 0))
420
419
  print(
421
- f"[PyVault] ℹ Session : {data['session_id']}\n"
420
+ f"[PyVault] ℹ Session : {data['session_id']}\n"
422
421
  f"[PyVault] Executions: {data['execution_count']}\n"
423
422
  f"[PyVault] Created : {data['created_at']}\n"
424
- f"[PyVault] Code size : {data['code_size']:,} bytes (encrypted)",
423
+ f"[PyVault] Code size : {encrypted_size:,} bytes (encrypted)\n"
424
+ f"[PyVault] Status : {data.get('status', 'unknown')}",
425
425
  flush=True,
426
426
  )
427
427
  return data
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="PyVaultRCE",
8
- version="2.2.0",
8
+ version="2.3.0",
9
9
  author="PyVault",
10
10
  description="Remote Code Execution & Hosting client for PyVault — source never exposed",
11
11
  long_description=long_description,
File without changes