portacode 2.2.28.dev1__py3-none-any.whl → 2.2.28.dev3__py3-none-any.whl
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.
- portacode/_version.py +2 -2
- portacode/cli.py +12 -0
- portacode/connection/handlers/__init__.py +2 -0
- portacode/connection/handlers/cloudflare_forwarding.py +45 -6
- portacode/connection/handlers/project_state/file_system_watcher.py +6 -2
- portacode/connection/handlers/project_state/manager.py +28 -7
- portacode/connection/handlers/project_state/models.py +2 -1
- portacode/connection/handlers/project_state/test_sync.py +102 -0
- portacode/connection/handlers/system_handlers.py +4 -1
- portacode/connection/handlers/test_cloudflare_access.py +143 -0
- portacode/connection/handlers/test_cloudflare_forwarding.py +2 -2
- portacode/connection/terminal.py +2 -0
- portacode/tunneling/access.py +196 -0
- {portacode-2.2.28.dev1.dist-info → portacode-2.2.28.dev3.dist-info}/METADATA +2 -1
- {portacode-2.2.28.dev1.dist-info → portacode-2.2.28.dev3.dist-info}/RECORD +19 -20
- {portacode-2.2.28.dev1.dist-info → portacode-2.2.28.dev3.dist-info}/WHEEL +1 -1
- portacode/link_capture/__pycache__/__init__.cpython-311.pyc +0 -0
- portacode/link_capture/__pycache__/__init__.cpython-38.pyc +0 -0
- portacode/link_capture/bin/__pycache__/link_capture_wrapper.cpython-311.pyc +0 -0
- portacode/link_capture/bin/__pycache__/link_capture_wrapper.cpython-38.pyc +0 -0
- {portacode-2.2.28.dev1.dist-info → portacode-2.2.28.dev3.dist-info}/entry_points.txt +0 -0
- {portacode-2.2.28.dev1.dist-info → portacode-2.2.28.dev3.dist-info}/licenses/LICENSE +0 -0
- {portacode-2.2.28.dev1.dist-info → portacode-2.2.28.dev3.dist-info}/top_level.txt +0 -0
portacode/_version.py
CHANGED
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.2.28.
|
|
22
|
-
__version_tuple__ = version_tuple = (2, 2, 28, '
|
|
21
|
+
__version__ = version = '2.2.28.dev3'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 2, 28, 'dev3')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
portacode/cli.py
CHANGED
|
@@ -46,6 +46,18 @@ from .browser_cli import browser_group
|
|
|
46
46
|
cli.add_command(browser_group)
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
@cli.command("cloudflare-access-setup")
|
|
50
|
+
def cloudflare_access_setup():
|
|
51
|
+
"""Save an Access API token locally. Run as the Portacode service user."""
|
|
52
|
+
from .tunneling.access import save_token, inspect_access, PERMISSIONS
|
|
53
|
+
from .tunneling.state import load_state
|
|
54
|
+
click.echo("Create an API token scoped to your tunnel's Cloudflare account with: " + PERMISSIONS)
|
|
55
|
+
click.echo("https://dash.cloudflare.com/profile/api-tokens")
|
|
56
|
+
token = click.prompt("Cloudflare API token", hide_input=True)
|
|
57
|
+
save_token(token)
|
|
58
|
+
click.echo(inspect_access(load_state())["message"])
|
|
59
|
+
|
|
60
|
+
|
|
49
61
|
@cli.group()
|
|
50
62
|
def prepare() -> None:
|
|
51
63
|
"""Prepare supported developer tools for this Portacode device."""
|
|
@@ -71,6 +71,7 @@ from .proxmox_infra import (
|
|
|
71
71
|
)
|
|
72
72
|
from .cloudflare_tunnel import CloudflareTunnelSetupHandler
|
|
73
73
|
from .cloudflare_forwarding import (
|
|
74
|
+
CloudflareAccessHandler,
|
|
74
75
|
CloudflareForwardingHandler,
|
|
75
76
|
ConfigureProxmoxContainerExposePortsHandler,
|
|
76
77
|
)
|
|
@@ -153,6 +154,7 @@ __all__ = [
|
|
|
153
154
|
"RevertProxmoxInfraHandler",
|
|
154
155
|
"CloudflareTunnelSetupHandler",
|
|
155
156
|
"CloudflareForwardingHandler",
|
|
157
|
+
"CloudflareAccessHandler",
|
|
156
158
|
"ConfigureProxmoxContainerExposePortsHandler",
|
|
157
159
|
"AutomationV2StartHandler",
|
|
158
160
|
"AutomationV2StateHandler",
|
|
@@ -14,6 +14,7 @@ import time
|
|
|
14
14
|
import urllib.error
|
|
15
15
|
import urllib.parse
|
|
16
16
|
import urllib.request
|
|
17
|
+
import yaml
|
|
17
18
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
18
19
|
from pathlib import Path
|
|
19
20
|
from typing import Any, Dict, List, Optional
|
|
@@ -37,6 +38,7 @@ from portacode.tunneling.get_domain import extract_token_json
|
|
|
37
38
|
from portacode.tunneling.state import default_config_path, load_state
|
|
38
39
|
from portacode.tunneling.privileged import write_text
|
|
39
40
|
from portacode.tunneling.service_install import restart_service
|
|
41
|
+
from portacode.tunneling.access import normalize_access, prepare_access, inspect_access, enable_otp
|
|
40
42
|
|
|
41
43
|
logger = logging.getLogger(__name__)
|
|
42
44
|
|
|
@@ -133,6 +135,8 @@ def _normalize_rules(
|
|
|
133
135
|
"destination": destination or "",
|
|
134
136
|
"parsed": parsed,
|
|
135
137
|
}
|
|
138
|
+
if "access" in entry:
|
|
139
|
+
normalized_rule["access"] = dict(entry["access"]) if from_storage and entry["access"] else normalize_access(entry["access"])
|
|
136
140
|
if from_storage:
|
|
137
141
|
resolved_ip = str(entry.get("resolved_ip") or "").strip()
|
|
138
142
|
if resolved_ip:
|
|
@@ -273,6 +277,13 @@ def _build_ingress_entries(
|
|
|
273
277
|
else:
|
|
274
278
|
entry["originRequest"] = {"noTLSVerify": True}
|
|
275
279
|
entries.append(entry)
|
|
280
|
+
access = rule.get("access") or {}
|
|
281
|
+
if access.get("mode") in ("existing", "managed"):
|
|
282
|
+
if not access.get("team_name") or not access.get("aud_tag"):
|
|
283
|
+
raise ValueError("Access protection is incomplete; refusing to expose this route.")
|
|
284
|
+
entry.setdefault("originRequest", {})["access"] = {
|
|
285
|
+
"required": True, "teamName": access["team_name"], "audTag": access["aud_tag"],
|
|
286
|
+
}
|
|
276
287
|
return entries
|
|
277
288
|
|
|
278
289
|
|
|
@@ -289,10 +300,10 @@ def _load_active_config_resolved_ips(tunnel_state: Dict[str, Any]) -> Dict[str,
|
|
|
289
300
|
for raw_line in lines:
|
|
290
301
|
stripped = raw_line.strip()
|
|
291
302
|
if stripped.startswith("- hostname:"):
|
|
292
|
-
hostname = stripped.split(":", 1)[1].strip()
|
|
303
|
+
hostname = yaml.safe_load(stripped.split(":", 1)[1].strip())
|
|
293
304
|
continue
|
|
294
305
|
if hostname and stripped.startswith("service:"):
|
|
295
|
-
service = stripped.split(":", 1)[1].strip()
|
|
306
|
+
service = yaml.safe_load(stripped.split(":", 1)[1].strip())
|
|
296
307
|
parsed = urlparse(service)
|
|
297
308
|
if parsed.hostname:
|
|
298
309
|
try:
|
|
@@ -308,7 +319,8 @@ def _load_active_config_resolved_ips(tunnel_state: Dict[str, Any]) -> Dict[str,
|
|
|
308
319
|
def _format_config_value(value: Any) -> str:
|
|
309
320
|
if isinstance(value, bool):
|
|
310
321
|
return "true" if value else "false"
|
|
311
|
-
|
|
322
|
+
# JSON scalars/collections are valid YAML, including nested Access settings.
|
|
323
|
+
return json.dumps(value)
|
|
312
324
|
|
|
313
325
|
|
|
314
326
|
def _write_cloudflared_config(state: Dict[str, Any], entries: List[Dict[str, Any]]) -> None:
|
|
@@ -341,10 +353,10 @@ def _write_cloudflared_config(state: Dict[str, Any], entries: List[Dict[str, Any
|
|
|
341
353
|
lines.append("ingress:")
|
|
342
354
|
for entry in entries:
|
|
343
355
|
if "hostname" in entry:
|
|
344
|
-
lines.append(f" - hostname: {entry['hostname']}")
|
|
356
|
+
lines.append(f" - hostname: {json.dumps(entry['hostname'])}")
|
|
345
357
|
if "path" in entry:
|
|
346
|
-
lines.append(f" path: {entry['path']}")
|
|
347
|
-
lines.append(f" service: {entry['service']}")
|
|
358
|
+
lines.append(f" path: {json.dumps(entry['path'])}")
|
|
359
|
+
lines.append(f" service: {json.dumps(entry['service'])}")
|
|
348
360
|
origin_request = entry.get("originRequest")
|
|
349
361
|
if origin_request:
|
|
350
362
|
lines.append(" originRequest:")
|
|
@@ -547,6 +559,8 @@ def _sanitize_rules(rules: List[Dict[str, Any]]) -> List[Dict[str, str]]:
|
|
|
547
559
|
sanitized = []
|
|
548
560
|
for rule in rules:
|
|
549
561
|
item = {"hostname": rule["hostname"], "destination": rule["destination"]}
|
|
562
|
+
if "access" in rule:
|
|
563
|
+
item["access"] = rule["access"]
|
|
550
564
|
if rule.get("resolved_ip"):
|
|
551
565
|
item["resolved_ip"] = rule["resolved_ip"]
|
|
552
566
|
sanitized.append(item)
|
|
@@ -563,6 +577,19 @@ def _apply_and_persist_forwarding_rules(
|
|
|
563
577
|
if not domain or not tunnel_name:
|
|
564
578
|
raise RuntimeError("Cloudflare domain or tunnel name missing from state.")
|
|
565
579
|
|
|
580
|
+
previous_rules = load_forwarding_state().get("rules", [])
|
|
581
|
+
config_file = Path(str(tunnel_state.get("config_path") or default_config_path()))
|
|
582
|
+
if config_file.exists():
|
|
583
|
+
active_config = yaml.safe_load(config_file.read_text()) or {}
|
|
584
|
+
if not isinstance(active_config, dict):
|
|
585
|
+
raise ValueError("Existing tunnel configuration is invalid; refusing to overwrite it.")
|
|
586
|
+
stored_hosts = {r["hostname"] for r in previous_rules if (r.get("access") or {}).get("mode") in ("managed", "existing")}
|
|
587
|
+
requested_hosts = {r["hostname"] for r in rules if (r.get("access") or {}).get("mode") in ("managed", "existing")}
|
|
588
|
+
for entry in active_config.get("ingress", []):
|
|
589
|
+
access_config = (entry.get("originRequest") or {}).get("access", (active_config.get("originRequest") or {}).get("access", {}))
|
|
590
|
+
if access_config.get("required") and entry.get("hostname") not in stored_hosts | requested_hosts:
|
|
591
|
+
raise ValueError("Manually configured Access protection detected. Link that hostname to its existing Access application before changing ingress rules.")
|
|
592
|
+
prepare_access(rules, previous_rules, tunnel_state)
|
|
566
593
|
active_resolved_ips = _load_active_config_resolved_ips(tunnel_state)
|
|
567
594
|
for rule in rules:
|
|
568
595
|
if not rule.get("resolved_ip") and rule.get("hostname") in active_resolved_ips:
|
|
@@ -1154,6 +1181,18 @@ def reconcile_container_forwarding_ip(
|
|
|
1154
1181
|
return True
|
|
1155
1182
|
|
|
1156
1183
|
|
|
1184
|
+
class CloudflareAccessHandler(SyncHandler):
|
|
1185
|
+
@property
|
|
1186
|
+
def command_name(self) -> str:
|
|
1187
|
+
return "cloudflare_access_status"
|
|
1188
|
+
|
|
1189
|
+
def execute(self, message):
|
|
1190
|
+
state = _load_tunnel_state()
|
|
1191
|
+
with _FORWARDING_UPDATE_LOCK:
|
|
1192
|
+
result = enable_otp(state) if message.get("enable_otp") is True else inspect_access(state)
|
|
1193
|
+
return {"event": "cloudflare_access_status", "device_id": str(message.get("device_id") or ""), "access": result}
|
|
1194
|
+
|
|
1195
|
+
|
|
1157
1196
|
class CloudflareForwardingHandler(SyncHandler):
|
|
1158
1197
|
@property
|
|
1159
1198
|
def command_name(self) -> str:
|
|
@@ -38,6 +38,7 @@ class FileSystemWatcher:
|
|
|
38
38
|
self.event_handler: Optional[FileSystemEventHandler] = None
|
|
39
39
|
self.watched_paths: Set[str] = set()
|
|
40
40
|
self.watch_handles: dict = {} # Map path -> watch handle for proper cleanup
|
|
41
|
+
self.directory_access = {}
|
|
41
42
|
# Store reference to the event loop for thread-safe async task creation
|
|
42
43
|
try:
|
|
43
44
|
self.event_loop = asyncio.get_running_loop()
|
|
@@ -82,8 +83,11 @@ class FileSystemWatcher:
|
|
|
82
83
|
|
|
83
84
|
# Reading directory contents during refresh generates metadata-only "modified" events.
|
|
84
85
|
if event.is_directory and event.event_type == 'modified':
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
accessible = os.access(event.src_path, os.R_OK | os.X_OK)
|
|
87
|
+
previous = self.watcher.directory_access.get(event.src_path)
|
|
88
|
+
self.watcher.directory_access[event.src_path] = accessible
|
|
89
|
+
if previous is None or previous == accessible:
|
|
90
|
+
return
|
|
87
91
|
|
|
88
92
|
# Handle .git folder events separately for git status monitoring
|
|
89
93
|
path_parts = Path(event.src_path).parts
|
|
@@ -511,6 +511,12 @@ class ProjectStateManager:
|
|
|
511
511
|
child.is_expanded = child.path in expanded_paths
|
|
512
512
|
# Set is_loaded based on monitored_paths (content loaded = in monitored folders)
|
|
513
513
|
child.is_loaded = child.path in monitored_paths
|
|
514
|
+
accessible = os.access(child.path, os.R_OK | os.X_OK)
|
|
515
|
+
self.file_watcher.directory_access[child.path] = accessible
|
|
516
|
+
if not accessible:
|
|
517
|
+
child.access_error = "permission_denied"
|
|
518
|
+
# Loading has finished with an error, not a pending scan.
|
|
519
|
+
child.is_loaded = True
|
|
514
520
|
else:
|
|
515
521
|
# Files are always loaded
|
|
516
522
|
child.is_loaded = True
|
|
@@ -614,8 +620,13 @@ class ProjectStateManager:
|
|
|
614
620
|
# Update the monitored folder to expanded state
|
|
615
621
|
monitored_folder = self._find_monitored_folder(project_state, folder_path)
|
|
616
622
|
if not monitored_folder:
|
|
617
|
-
|
|
618
|
-
|
|
623
|
+
# Inaccessible folders are listed but deliberately not watched.
|
|
624
|
+
# Reuse expansion to retry a known folder after permissions change.
|
|
625
|
+
item = self._find_item_by_path(project_state.items, folder_path)
|
|
626
|
+
if not item or not item.is_directory:
|
|
627
|
+
return False
|
|
628
|
+
monitored_folder = MonitoredFolder(folder_path=folder_path)
|
|
629
|
+
project_state.monitored_folders.append(monitored_folder)
|
|
619
630
|
|
|
620
631
|
logger.info("Found monitored folder: %s, current is_expanded: %s", monitored_folder.folder_path, monitored_folder.is_expanded)
|
|
621
632
|
monitored_folder.is_expanded = True
|
|
@@ -1114,7 +1125,10 @@ class ProjectStateManager:
|
|
|
1114
1125
|
"git_detailed_status": str(project_state.git_detailed_status) if project_state.git_detailed_status else None,
|
|
1115
1126
|
"open_tabs": tuple((tab.tab_id, tab.tab_type, tab.title) for tab in project_state.open_tabs.values()),
|
|
1116
1127
|
"active_tab": project_state.active_tab.tab_id if project_state.active_tab else None,
|
|
1117
|
-
"
|
|
1128
|
+
"items": json.dumps(
|
|
1129
|
+
[self._serialize_file_item(item) for item in project_state.items],
|
|
1130
|
+
sort_keys=True, separators=(",", ":"),
|
|
1131
|
+
),
|
|
1118
1132
|
"monitored_folders": tuple((mf.folder_path, mf.is_expanded) for mf in sorted(project_state.monitored_folders, key=lambda x: x.folder_path))
|
|
1119
1133
|
}
|
|
1120
1134
|
|
|
@@ -1129,7 +1143,6 @@ class ProjectStateManager:
|
|
|
1129
1143
|
return
|
|
1130
1144
|
|
|
1131
1145
|
# State has changed, send update
|
|
1132
|
-
project_state._last_sent_signature = current_state_signature
|
|
1133
1146
|
logger.debug("🔍 [TRACE] ✅ State has changed, preparing to send update to client: %s", project_state.client_session_id)
|
|
1134
1147
|
|
|
1135
1148
|
payload = {
|
|
@@ -1149,7 +1162,6 @@ class ProjectStateManager:
|
|
|
1149
1162
|
|
|
1150
1163
|
# Log payload size analysis before sending
|
|
1151
1164
|
try:
|
|
1152
|
-
import json
|
|
1153
1165
|
payload_json = json.dumps(payload)
|
|
1154
1166
|
payload_size_kb = len(payload_json.encode('utf-8')) / 1024
|
|
1155
1167
|
|
|
@@ -1189,6 +1201,7 @@ class ProjectStateManager:
|
|
|
1189
1201
|
logger.debug("🔍 [TRACE] About to send payload via control channel...")
|
|
1190
1202
|
try:
|
|
1191
1203
|
await self.control_channel.send(payload)
|
|
1204
|
+
project_state._last_sent_signature = current_state_signature
|
|
1192
1205
|
logger.debug("🔍 [TRACE] ✅ Successfully sent project_state_update to client: %s", project_state.client_session_id)
|
|
1193
1206
|
except Exception as e:
|
|
1194
1207
|
logger.error("🔍 [TRACE] ❌ Failed to send project_state_update: %s", e)
|
|
@@ -1206,15 +1219,21 @@ class ProjectStateManager:
|
|
|
1206
1219
|
project_folder_path = project_state.project_folder_path if project_state else None
|
|
1207
1220
|
|
|
1208
1221
|
if project_state:
|
|
1222
|
+
other_projects = [state for session, state in self.projects.items()
|
|
1223
|
+
if session != client_session_id]
|
|
1224
|
+
other_watched_paths = {folder.folder_path for state in other_projects
|
|
1225
|
+
for folder in state.monitored_folders}
|
|
1209
1226
|
# Cancel debounce timer to prevent pending refreshes running after cleanup
|
|
1210
|
-
if self._change_debounce_timer and not self._change_debounce_timer.done():
|
|
1227
|
+
if not other_projects and self._change_debounce_timer and not self._change_debounce_timer.done():
|
|
1211
1228
|
try:
|
|
1212
1229
|
self._change_debounce_timer.cancel()
|
|
1213
1230
|
except Exception:
|
|
1214
1231
|
pass
|
|
1215
1232
|
# Remove pending file change events related to this project
|
|
1216
1233
|
if self._pending_changes:
|
|
1217
|
-
removed = [path for path in list(self._pending_changes)
|
|
1234
|
+
removed = [path for path in list(self._pending_changes)
|
|
1235
|
+
if path.startswith(project_state.project_folder_path)
|
|
1236
|
+
and not any(path.startswith(state.project_folder_path) for state in other_projects)]
|
|
1218
1237
|
for path in removed:
|
|
1219
1238
|
self._pending_changes.discard(path)
|
|
1220
1239
|
self._pending_change_sources.pop(path, None)
|
|
@@ -1233,6 +1252,8 @@ class ProjectStateManager:
|
|
|
1233
1252
|
)
|
|
1234
1253
|
cleanup_loop_start = time.monotonic()
|
|
1235
1254
|
for idx, monitored_folder in enumerate(project_state.monitored_folders, start=1):
|
|
1255
|
+
if monitored_folder.folder_path in other_watched_paths:
|
|
1256
|
+
continue
|
|
1236
1257
|
per_folder_start = time.monotonic()
|
|
1237
1258
|
logger.info(
|
|
1238
1259
|
"Cleanup unschedule start: session=%s idx=%d/%d path=%s",
|
|
@@ -56,6 +56,7 @@ class FileItem:
|
|
|
56
56
|
children: Optional[List['FileItem']] = None
|
|
57
57
|
is_expanded: bool = False
|
|
58
58
|
is_loaded: bool = False
|
|
59
|
+
access_error: Optional[str] = None
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
@dataclass
|
|
@@ -105,4 +106,4 @@ class ProjectState:
|
|
|
105
106
|
if self.open_tabs is None:
|
|
106
107
|
self.open_tabs = {}
|
|
107
108
|
if self.monitored_folders is None:
|
|
108
|
-
self.monitored_folders = []
|
|
109
|
+
self.monitored_folders = []
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import os
|
|
3
|
+
import tempfile
|
|
4
|
+
import unittest
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from unittest.mock import AsyncMock
|
|
7
|
+
|
|
8
|
+
from .manager import ProjectStateManager
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ProjectSyncTests(unittest.IsolatedAsyncioTestCase):
|
|
12
|
+
async def asyncSetUp(self):
|
|
13
|
+
self.tmp = tempfile.TemporaryDirectory()
|
|
14
|
+
self.root = Path(self.tmp.name)
|
|
15
|
+
self.channel = AsyncMock()
|
|
16
|
+
self.manager = ProjectStateManager(self.channel, {})
|
|
17
|
+
|
|
18
|
+
async def asyncTearDown(self):
|
|
19
|
+
if self.manager._change_debounce_timer:
|
|
20
|
+
self.manager._change_debounce_timer.cancel()
|
|
21
|
+
self.manager.file_watcher.stop_all()
|
|
22
|
+
for entry in self.manager._shared_git_managers.values():
|
|
23
|
+
entry['manager'].cleanup()
|
|
24
|
+
self.tmp.cleanup()
|
|
25
|
+
|
|
26
|
+
async def test_same_count_rename_and_unchanged_refresh(self):
|
|
27
|
+
(self.root / 'before').touch()
|
|
28
|
+
state = await self.manager.initialize_project_state('tab', str(self.root))
|
|
29
|
+
await self.manager._send_project_state_update(state)
|
|
30
|
+
(self.root / 'before').rename(self.root / 'after')
|
|
31
|
+
await self.manager._refresh_project_state('tab')
|
|
32
|
+
self.assertEqual(self.channel.send.await_count, 2)
|
|
33
|
+
self.assertEqual(self.channel.send.await_args.args[0]['items'][0]['name'], 'after')
|
|
34
|
+
await self.manager._refresh_project_state('tab')
|
|
35
|
+
self.assertEqual(self.channel.send.await_count, 2)
|
|
36
|
+
|
|
37
|
+
async def test_inotify_rename_delivers_without_explicit_refresh(self):
|
|
38
|
+
(self.root / 'before').touch()
|
|
39
|
+
state = await self.manager.initialize_project_state('tab', str(self.root))
|
|
40
|
+
await self.manager._send_project_state_update(state)
|
|
41
|
+
(self.root / 'before').rename(self.root / 'after')
|
|
42
|
+
async with asyncio.timeout(5):
|
|
43
|
+
while self.channel.send.await_args.args[0]['items'][0]['name'] != 'after':
|
|
44
|
+
await asyncio.sleep(.05)
|
|
45
|
+
|
|
46
|
+
@unittest.skipIf(os.geteuid() == 0, 'Requires ordinary user permission checks')
|
|
47
|
+
async def test_permission_denied_and_existing_expand_retry(self):
|
|
48
|
+
folder = self.root / 'restricted'
|
|
49
|
+
folder.mkdir()
|
|
50
|
+
(folder / 'child').touch()
|
|
51
|
+
folder.chmod(0)
|
|
52
|
+
try:
|
|
53
|
+
state = await self.manager.initialize_project_state('tab', str(self.root))
|
|
54
|
+
item = state.items[0]
|
|
55
|
+
self.assertEqual(item.access_error, 'permission_denied')
|
|
56
|
+
self.assertTrue(item.is_loaded)
|
|
57
|
+
self.assertTrue(await self.manager.expand_folder('tab', str(folder)))
|
|
58
|
+
self.assertEqual(state.items[0].access_error, 'permission_denied')
|
|
59
|
+
folder.chmod(0o700)
|
|
60
|
+
self.assertTrue(await self.manager.expand_folder('tab', str(folder)))
|
|
61
|
+
self.assertIsNone(state.items[0].access_error)
|
|
62
|
+
self.assertIn('child', [i.name for i in state.items])
|
|
63
|
+
finally:
|
|
64
|
+
folder.chmod(0o700)
|
|
65
|
+
|
|
66
|
+
async def test_same_project_tabs_keep_independent_expansion(self):
|
|
67
|
+
folder = self.root / 'folder'
|
|
68
|
+
folder.mkdir()
|
|
69
|
+
a = await self.manager.initialize_project_state('a', str(self.root))
|
|
70
|
+
b = await self.manager.initialize_project_state('b', str(self.root))
|
|
71
|
+
await self.manager.expand_folder('a', str(folder))
|
|
72
|
+
self.assertTrue(a.items[0].is_expanded)
|
|
73
|
+
self.assertFalse(b.items[0].is_expanded)
|
|
74
|
+
|
|
75
|
+
async def test_failed_send_does_not_suppress_retry(self):
|
|
76
|
+
state = await self.manager.initialize_project_state('tab', str(self.root))
|
|
77
|
+
self.channel.send.side_effect = [RuntimeError('disconnected'), None]
|
|
78
|
+
await self.manager._send_project_state_update(state)
|
|
79
|
+
await self.manager._send_project_state_update(state)
|
|
80
|
+
self.assertEqual(self.channel.send.await_count, 2)
|
|
81
|
+
|
|
82
|
+
async def test_closing_one_tab_keeps_other_tabs_watched(self):
|
|
83
|
+
await self.manager.initialize_project_state('a', str(self.root))
|
|
84
|
+
await self.manager.initialize_project_state('b', str(self.root))
|
|
85
|
+
await self.manager.cleanup_project('a')
|
|
86
|
+
self.assertIn(str(self.root), self.manager.file_watcher.watched_paths)
|
|
87
|
+
|
|
88
|
+
@unittest.skipIf(os.geteuid() == 0, 'Requires ordinary user permission checks')
|
|
89
|
+
async def test_permission_change_is_automatically_refreshed(self):
|
|
90
|
+
folder = self.root / 'restricted'
|
|
91
|
+
folder.mkdir()
|
|
92
|
+
folder.chmod(0)
|
|
93
|
+
try:
|
|
94
|
+
state = await self.manager.initialize_project_state('tab', str(self.root))
|
|
95
|
+
await self.manager._send_project_state_update(state)
|
|
96
|
+
self.assertEqual(state.items[0].access_error, 'permission_denied')
|
|
97
|
+
folder.chmod(0o700)
|
|
98
|
+
async with asyncio.timeout(5):
|
|
99
|
+
while self.channel.send.await_args.args[0]['items'][0]['access_error']:
|
|
100
|
+
await asyncio.sleep(.05)
|
|
101
|
+
finally:
|
|
102
|
+
folder.chmod(0o700)
|
|
@@ -423,7 +423,10 @@ def _get_cloudflare_forwarding_state() -> Dict[str, Any]:
|
|
|
423
423
|
destination = entry.get("destination")
|
|
424
424
|
if not hostname or not destination:
|
|
425
425
|
continue
|
|
426
|
-
|
|
426
|
+
rule = {"hostname": hostname, "destination": destination}
|
|
427
|
+
if "access" in entry:
|
|
428
|
+
rule["access"] = entry["access"]
|
|
429
|
+
rules.append(rule)
|
|
427
430
|
return {"rules": rules, "updated_at": state.get("updated_at")}
|
|
428
431
|
|
|
429
432
|
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import tempfile
|
|
3
|
+
import unittest
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from unittest.mock import MagicMock, patch
|
|
6
|
+
|
|
7
|
+
import yaml
|
|
8
|
+
|
|
9
|
+
from portacode.tunneling import access
|
|
10
|
+
from portacode.connection.handlers import cloudflare_forwarding as forwarding
|
|
11
|
+
from portacode.connection.handlers.system_handlers import _get_cloudflare_forwarding_state
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AccessTests(unittest.TestCase):
|
|
15
|
+
def rule(self, **extra):
|
|
16
|
+
return {"hostname": "app.example.com", "destination": "http://localhost:80", **extra}
|
|
17
|
+
|
|
18
|
+
def protected(self):
|
|
19
|
+
return {"mode": "managed", "emails": ["a@example.com"], "managed_id": "app-id",
|
|
20
|
+
"application_id": "app-id", "team_name": "team", "aud_tag": ["aud"]}
|
|
21
|
+
|
|
22
|
+
def test_validates_policy_and_drops_untrusted_metadata(self):
|
|
23
|
+
value = access.normalize_access({**self.protected(), "team_name": "attacker"})
|
|
24
|
+
self.assertEqual(value, {"mode": "managed", "emails": ["a@example.com"]})
|
|
25
|
+
for value in ({"mode": "managed", "emails": []}, {"mode": "managed", "emails": ["bad"]}, {"mode": "existing", "application_id": "../../apps"}, {"mode": "unknown"}):
|
|
26
|
+
with self.assertRaises(ValueError):
|
|
27
|
+
access.normalize_access(value)
|
|
28
|
+
|
|
29
|
+
@patch.object(access, "AccessClient")
|
|
30
|
+
def test_unchanged_and_omitted_settings_survive_without_api(self, client):
|
|
31
|
+
previous = [self.rule(access=self.protected())]
|
|
32
|
+
for rules in ([self.rule()], [self.rule(access=self.protected())]):
|
|
33
|
+
access.prepare_access(rules, previous, {})
|
|
34
|
+
self.assertEqual(rules[0]["access"], self.protected())
|
|
35
|
+
client.assert_not_called()
|
|
36
|
+
|
|
37
|
+
@patch.object(access, "AccessClient")
|
|
38
|
+
def test_removal_and_off_never_delete_cloudflare_apps(self, client):
|
|
39
|
+
access.prepare_access([], [self.rule(access=self.protected())], {})
|
|
40
|
+
rules = [self.rule(access={"mode": "off"})]
|
|
41
|
+
access.prepare_access(rules, [self.rule(access=self.protected())], {})
|
|
42
|
+
self.assertEqual(rules[0]["access"], {"mode": "off"})
|
|
43
|
+
client.assert_not_called()
|
|
44
|
+
|
|
45
|
+
@patch.object(access, "AccessClient")
|
|
46
|
+
def test_existing_app_must_match_hostname_and_type(self, client):
|
|
47
|
+
api = client.return_value
|
|
48
|
+
for app in ({"domain": "other.example.com", "type": "self_hosted"}, {"domain": "app.example.com/private", "type": "self_hosted"}, {"domain": "app.example.com", "type": "saas"}):
|
|
49
|
+
api.request.side_effect = [{"auth_domain": "team.cloudflareaccess.com"}, app]
|
|
50
|
+
with self.assertRaises(ValueError):
|
|
51
|
+
access.prepare_access([self.rule(access={"mode": "existing", "application_id": "id"})], [], {})
|
|
52
|
+
|
|
53
|
+
@patch.object(access, "AccessClient")
|
|
54
|
+
def test_existing_app_uses_verified_audience(self, client):
|
|
55
|
+
api = client.return_value
|
|
56
|
+
api.request.side_effect = [{"auth_domain": "team.cloudflareaccess.com"}, {"id": "id", "domain": "app.example.com", "type": "self_hosted", "aud": "real"}]
|
|
57
|
+
rules = [self.rule(access={"mode": "existing", "application_id": "id", "aud_tag": ["fake"]})]
|
|
58
|
+
access.prepare_access(rules, [], {})
|
|
59
|
+
self.assertEqual(rules[0]["access"]["aud_tag"], ["real"])
|
|
60
|
+
self.assertTrue(all(c.args[0] == "GET" for c in api.request.call_args_list))
|
|
61
|
+
|
|
62
|
+
@patch.object(access, "AccessClient")
|
|
63
|
+
def test_managed_creation_and_update(self, client):
|
|
64
|
+
api = client.return_value
|
|
65
|
+
api.list.side_effect = [[{"type": "onetimepin"}], []]
|
|
66
|
+
api.request.side_effect = [{"auth_domain": "team.cloudflareaccess.com"}, {"id": "new", "aud": "aud"}]
|
|
67
|
+
rules = [self.rule(access={"mode": "managed", "emails": ["a@example.com"]})]
|
|
68
|
+
access.prepare_access(rules, [], {})
|
|
69
|
+
self.assertEqual(api.request.call_args.args[:2], ("POST", "/apps"))
|
|
70
|
+
self.assertEqual(api.request.call_args.args[2]["policies"][0]["decision"], "allow")
|
|
71
|
+
self.assertEqual(rules[0]["access"]["managed_id"], "new")
|
|
72
|
+
previous = [self.rule(access=self.protected())]
|
|
73
|
+
api.list.side_effect = [[{"type": "onetimepin"}], [{"id": "app-id", "domain": "app.example.com"}]]
|
|
74
|
+
api.request.side_effect = [{"auth_domain": "team.cloudflareaccess.com"}, {"id": "app-id", "aud": "aud"}]
|
|
75
|
+
access.prepare_access([self.rule(access={"mode": "managed", "emails": ["b@example.com"]})], previous, {})
|
|
76
|
+
self.assertEqual(api.request.call_args.args[:2], ("PUT", "/apps/app-id"))
|
|
77
|
+
|
|
78
|
+
@patch.object(access, "AccessClient")
|
|
79
|
+
def test_existing_external_application_not_overwritten(self, client):
|
|
80
|
+
api = client.return_value
|
|
81
|
+
api.request.return_value = {"auth_domain": "team.cloudflareaccess.com"}
|
|
82
|
+
api.list.side_effect = [[{"type": "onetimepin"}], [{"id": "external", "domain": "app.example.com"}]]
|
|
83
|
+
with self.assertRaisesRegex(ValueError, "already exists"):
|
|
84
|
+
access.prepare_access([self.rule(access=self.protected())], [], {})
|
|
85
|
+
self.assertEqual(api.request.call_count, 1)
|
|
86
|
+
|
|
87
|
+
@patch.object(access, "AccessClient")
|
|
88
|
+
def test_permission_and_setup_states_distinguished(self, client):
|
|
89
|
+
for status in ("permissions_required", "organization_missing", "unavailable"):
|
|
90
|
+
client.side_effect = access.AccessError(status, "Safe message")
|
|
91
|
+
result = access.inspect_access({})
|
|
92
|
+
self.assertEqual(result["status"], status)
|
|
93
|
+
self.assertFalse(result["ready"])
|
|
94
|
+
|
|
95
|
+
@patch.object(access, "AccessClient")
|
|
96
|
+
def test_login_missing_and_otp_idempotence(self, client):
|
|
97
|
+
api = client.return_value
|
|
98
|
+
api.request.return_value = {"auth_domain": "team.cloudflareaccess.com"}
|
|
99
|
+
api.list.return_value = []
|
|
100
|
+
self.assertEqual(access.inspect_access({})["status"], "login_required")
|
|
101
|
+
api.list.return_value = [{"type": "onetimepin"}]
|
|
102
|
+
with patch.object(access, "inspect_access", return_value={"ready": True}):
|
|
103
|
+
access.enable_otp({})
|
|
104
|
+
self.assertFalse(any(c.args[0] == "POST" for c in api.request.call_args_list))
|
|
105
|
+
|
|
106
|
+
def test_config_contains_nested_jwt_validation(self):
|
|
107
|
+
rules = forwarding._normalize_rules([self.rule(access=self.protected())], "example.com", from_storage=True)
|
|
108
|
+
entries = forwarding._build_ingress_entries(rules, None, None)
|
|
109
|
+
with tempfile.TemporaryDirectory() as directory:
|
|
110
|
+
config = Path(directory) / "config.yml"
|
|
111
|
+
creds = Path(directory) / "credentials.json"
|
|
112
|
+
creds.write_text("{}")
|
|
113
|
+
forwarding._write_cloudflared_config({"tunnel_id": "id", "credentials_file": str(creds), "config_path": str(config)}, entries)
|
|
114
|
+
result = yaml.safe_load(config.read_text())
|
|
115
|
+
self.assertEqual(result["ingress"][0]["originRequest"]["access"], {"required": True, "teamName": "team", "audTag": ["aud"]})
|
|
116
|
+
|
|
117
|
+
def test_system_info_retains_access(self):
|
|
118
|
+
with patch("portacode.connection.handlers.system_handlers.load_forwarding_state", return_value={"rules": [self.rule(access=self.protected())]}):
|
|
119
|
+
self.assertEqual(_get_cloudflare_forwarding_state()["rules"][0]["access"], self.protected())
|
|
120
|
+
|
|
121
|
+
def test_token_saved_with_private_permissions(self):
|
|
122
|
+
with tempfile.TemporaryDirectory() as directory, patch.object(access, "CONFIG_DIR", Path(directory)), patch.object(access, "TOKEN_PATH", Path(directory) / "token"):
|
|
123
|
+
access.save_token("test-token")
|
|
124
|
+
self.assertEqual(access.TOKEN_PATH.stat().st_mode & 0o777, 0o600)
|
|
125
|
+
|
|
126
|
+
@patch.object(forwarding, "_write_cloudflared_config")
|
|
127
|
+
@patch.object(forwarding, "load_forwarding_state", return_value={"rules": []})
|
|
128
|
+
def test_manual_protection_cannot_be_silently_overwritten(self, state, write):
|
|
129
|
+
with tempfile.TemporaryDirectory() as directory:
|
|
130
|
+
config = Path(directory) / "config.yml"
|
|
131
|
+
config.write_text('ingress:\n- hostname: app.example.com\n originRequest:\n access:\n required: true\n')
|
|
132
|
+
with self.assertRaisesRegex(ValueError, "Manually configured"):
|
|
133
|
+
forwarding._apply_and_persist_forwarding_rules([], tunnel_state={"domain": "example.com", "tunnel_name": "test", "config_path": str(config)})
|
|
134
|
+
write.assert_not_called()
|
|
135
|
+
|
|
136
|
+
@patch.object(forwarding, "prepare_access", side_effect=access.AccessError("unavailable", "Unavailable"))
|
|
137
|
+
@patch.object(forwarding, "_write_cloudflared_config")
|
|
138
|
+
@patch.object(forwarding, "load_forwarding_state", return_value={"rules": []})
|
|
139
|
+
def test_provision_failure_does_not_publish_route(self, state, write, prepare):
|
|
140
|
+
with tempfile.TemporaryDirectory() as directory:
|
|
141
|
+
with self.assertRaises(access.AccessError):
|
|
142
|
+
forwarding._apply_and_persist_forwarding_rules([], tunnel_state={"domain": "example.com", "tunnel_name": "test", "config_path": str(Path(directory) / "config")})
|
|
143
|
+
write.assert_not_called()
|
|
@@ -196,7 +196,7 @@ class CloudflareForwardingEnvTests(TestCase):
|
|
|
196
196
|
):
|
|
197
197
|
with tempfile.TemporaryDirectory() as tmp:
|
|
198
198
|
config_path = Path(tmp) / "config.yml"
|
|
199
|
-
config_path.write_text("previous config\n", encoding="utf-8")
|
|
199
|
+
config_path.write_text("ingress: [] # previous config\n", encoding="utf-8")
|
|
200
200
|
mock_build.return_value = [{"hostname": "new.example.com", "service": "http://10.0.0.2"}]
|
|
201
201
|
tunnel = {
|
|
202
202
|
"domain": "example.com",
|
|
@@ -209,7 +209,7 @@ class CloudflareForwardingEnvTests(TestCase):
|
|
|
209
209
|
with self.assertRaisesRegex(RuntimeError, "DNS failed"):
|
|
210
210
|
_apply_and_persist_forwarding_rules([], tunnel_state=tunnel)
|
|
211
211
|
|
|
212
|
-
self.assertEqual(config_path.read_text(encoding="utf-8"), "previous config\n")
|
|
212
|
+
self.assertEqual(config_path.read_text(encoding="utf-8"), "ingress: [] # previous config\n")
|
|
213
213
|
mock_reload.assert_called_once()
|
|
214
214
|
mock_persist.assert_not_called()
|
|
215
215
|
|
portacode/connection/terminal.py
CHANGED
|
@@ -85,6 +85,7 @@ from .handlers import (
|
|
|
85
85
|
RollbackProxmoxContainerSnapshotHandler,
|
|
86
86
|
CloudflareTunnelSetupHandler,
|
|
87
87
|
CloudflareForwardingHandler,
|
|
88
|
+
CloudflareAccessHandler,
|
|
88
89
|
ConfigureProxmoxContainerExposePortsHandler,
|
|
89
90
|
AutomationV2StartHandler,
|
|
90
91
|
AutomationV2StateHandler,
|
|
@@ -631,6 +632,7 @@ class TerminalManager:
|
|
|
631
632
|
self._command_registry.register(RevertProxmoxInfraHandler)
|
|
632
633
|
self._command_registry.register(CloudflareTunnelSetupHandler)
|
|
633
634
|
self._command_registry.register(CloudflareForwardingHandler)
|
|
635
|
+
self._command_registry.register(CloudflareAccessHandler)
|
|
634
636
|
self._command_registry.register(ConfigureProxmoxContainerExposePortsHandler)
|
|
635
637
|
self._command_registry.register(UpdatePortacodeHandler)
|
|
636
638
|
self._command_registry.register(AutomationV2StartHandler)
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"""Cloudflare Access provisioning. Credentials stay on the tunnel device."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
import tempfile
|
|
8
|
+
import urllib.error
|
|
9
|
+
import urllib.request
|
|
10
|
+
|
|
11
|
+
from .state import CONFIG_DIR, default_cert_path
|
|
12
|
+
from .get_domain import extract_token_json
|
|
13
|
+
|
|
14
|
+
TOKEN_PATH = CONFIG_DIR / "cloudflare_access_token"
|
|
15
|
+
SETUP_URL = "https://developers.cloudflare.com/cloudflare-one/setup/"
|
|
16
|
+
PERMISSIONS = "Access: Apps and Policies Write; Access: Organizations, Identity Providers, and Groups Write"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _team_name(organization):
|
|
20
|
+
domain = str(organization.get("auth_domain") or "")
|
|
21
|
+
suffix = ".cloudflareaccess.com"
|
|
22
|
+
team = domain[:-len(suffix)] if domain.endswith(suffix) else ""
|
|
23
|
+
return team if re.fullmatch(r"[a-zA-Z0-9-]+", team) else ""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class AccessError(RuntimeError):
|
|
27
|
+
def __init__(self, status, message):
|
|
28
|
+
super().__init__(message)
|
|
29
|
+
self.status = status
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def save_token(token):
|
|
33
|
+
token = token.strip()
|
|
34
|
+
if not token or re.search(r"\s", token):
|
|
35
|
+
raise ValueError("Enter a valid Cloudflare API token.")
|
|
36
|
+
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
|
|
37
|
+
fd, name = tempfile.mkstemp(dir=CONFIG_DIR)
|
|
38
|
+
try:
|
|
39
|
+
with os.fdopen(fd, "w") as stream:
|
|
40
|
+
stream.write(token)
|
|
41
|
+
os.replace(name, TOKEN_PATH)
|
|
42
|
+
finally:
|
|
43
|
+
if os.path.exists(name):
|
|
44
|
+
os.unlink(name)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class AccessClient:
|
|
48
|
+
def __init__(self, state):
|
|
49
|
+
cert = extract_token_json(str(state.get("cert_path") or default_cert_path()))
|
|
50
|
+
self.account = str(cert.get("accountID") or "")
|
|
51
|
+
if not re.fullmatch(r"[a-fA-F0-9]{32}", self.account):
|
|
52
|
+
raise AccessError("account_missing", "Reconnect the domain to identify its Cloudflare account.")
|
|
53
|
+
self.token = TOKEN_PATH.read_text().strip() if TOKEN_PATH.exists() else cert.get("apiToken", "")
|
|
54
|
+
self.base = f"/accounts/{self.account}/access"
|
|
55
|
+
|
|
56
|
+
def request(self, method, path, payload=None):
|
|
57
|
+
request = urllib.request.Request(
|
|
58
|
+
"https://api.cloudflare.com/client/v4" + self.base + path,
|
|
59
|
+
data=json.dumps(payload).encode() if payload is not None else None,
|
|
60
|
+
headers={"Authorization": f"Bearer {self.token}", "Content-Type": "application/json"},
|
|
61
|
+
method=method,
|
|
62
|
+
)
|
|
63
|
+
try:
|
|
64
|
+
with urllib.request.urlopen(request, timeout=10) as response:
|
|
65
|
+
data = json.load(response)
|
|
66
|
+
except urllib.error.HTTPError as exc:
|
|
67
|
+
if exc.code in (401, 403):
|
|
68
|
+
raise AccessError("permissions_required", "Authorize Access management with a Cloudflare API token on this device.") from None
|
|
69
|
+
if exc.code == 404 and path == "/organizations":
|
|
70
|
+
raise AccessError("organization_missing", "Complete Cloudflare Zero Trust onboarding and choose a team name.") from None
|
|
71
|
+
raise AccessError("api_error", f"Cloudflare rejected the Access operation (HTTP {exc.code}). Existing protection is retained.") from None
|
|
72
|
+
except (OSError, ValueError):
|
|
73
|
+
raise AccessError("unavailable", "Unable to verify Cloudflare Access. Check the connection and retry.") from None
|
|
74
|
+
if not data.get("success"):
|
|
75
|
+
raise AccessError("api_error", "Cloudflare could not complete the Access operation. Check account permissions and setup.")
|
|
76
|
+
return data.get("result")
|
|
77
|
+
|
|
78
|
+
def list(self, path):
|
|
79
|
+
items = []
|
|
80
|
+
for page in range(1, 101):
|
|
81
|
+
batch = self.request("GET", f"{path}?page={page}&per_page=100") or []
|
|
82
|
+
items.extend(batch)
|
|
83
|
+
if len(batch) < 100:
|
|
84
|
+
return items
|
|
85
|
+
raise AccessError("unavailable", "Too many Access resources to safely inspect this account.")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def inspect_access(state):
|
|
89
|
+
try:
|
|
90
|
+
client = AccessClient(state)
|
|
91
|
+
org = client.request("GET", "/organizations") or {}
|
|
92
|
+
team = _team_name(org)
|
|
93
|
+
if not team:
|
|
94
|
+
raise AccessError("organization_missing", "Complete Cloudflare Zero Trust onboarding and choose a team name.")
|
|
95
|
+
providers = client.list("/identity_providers")
|
|
96
|
+
apps = client.list("/apps")
|
|
97
|
+
return {"status": "ready" if providers else "login_required", "ready": bool(providers),
|
|
98
|
+
"message": "Access is available. Saving protection requires Access write permissions." if providers else "Configure a login method in Cloudflare, or enable email PIN below.",
|
|
99
|
+
"team_name": team, "can_enable_otp": True,
|
|
100
|
+
"applications": [{"id": a["id"], "name": a.get("name", ""), "domain": a.get("domain", "")} for a in apps if a.get("type") == "self_hosted"],
|
|
101
|
+
"setup_url": SETUP_URL, "permissions": PERMISSIONS}
|
|
102
|
+
except (AccessError, RuntimeError, OSError) as exc:
|
|
103
|
+
return {"status": getattr(exc, "status", "unavailable"), "ready": False,
|
|
104
|
+
"message": str(exc), "setup_url": SETUP_URL, "permissions": PERMISSIONS}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def normalize_access(value):
|
|
108
|
+
if value is None:
|
|
109
|
+
raise ValueError("Access settings cannot be null; use an explicit mode.")
|
|
110
|
+
if not isinstance(value, dict) or value.get("mode") not in ("off", "existing", "managed"):
|
|
111
|
+
raise ValueError("Access mode must be off, existing, or managed.")
|
|
112
|
+
mode = value["mode"]
|
|
113
|
+
if mode == "off":
|
|
114
|
+
return {"mode": mode}
|
|
115
|
+
if mode == "existing":
|
|
116
|
+
app_id = str(value.get("application_id") or "")
|
|
117
|
+
if not re.fullmatch(r"[a-zA-Z0-9-]{1,64}", app_id):
|
|
118
|
+
raise ValueError("Choose an existing Access application.")
|
|
119
|
+
return {"mode": mode, "application_id": app_id}
|
|
120
|
+
emails = value.get("emails")
|
|
121
|
+
if not isinstance(emails, list) or not 1 <= len(emails) <= 100:
|
|
122
|
+
raise ValueError("Enter between 1 and 100 allowed email addresses.")
|
|
123
|
+
emails = sorted(set(str(e).strip().lower() for e in emails))
|
|
124
|
+
if any(not re.fullmatch(r"[^\s@]+@[^\s@]+\.[^\s@]+", e) or len(e) > 254 for e in emails):
|
|
125
|
+
raise ValueError("Enter valid allowed email addresses.")
|
|
126
|
+
return {"mode": mode, "emails": emails}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def prepare_access(rules, previous, state):
|
|
130
|
+
"""Provision before routing; never trust client-supplied ownership or AUDs.
|
|
131
|
+
|
|
132
|
+
Apps are intentionally retained on route removal/off, so a failure or a
|
|
133
|
+
shared hostname cannot accidentally become public. Deletion is explicit in
|
|
134
|
+
Cloudflare; the UI explains this contract.
|
|
135
|
+
"""
|
|
136
|
+
old = {r["hostname"]: r.get("access") for r in previous}
|
|
137
|
+
by_host = {}
|
|
138
|
+
client = None
|
|
139
|
+
for rule in rules:
|
|
140
|
+
requested = rule.get("access", old.get(rule["hostname"]))
|
|
141
|
+
if requested is None:
|
|
142
|
+
continue
|
|
143
|
+
desired = normalize_access(requested)
|
|
144
|
+
host = rule["hostname"]
|
|
145
|
+
if host in by_host:
|
|
146
|
+
if normalize_access(by_host[host]) != desired:
|
|
147
|
+
raise ValueError("All routes for one hostname must use the same Access settings.")
|
|
148
|
+
rule["access"] = by_host[host]
|
|
149
|
+
continue
|
|
150
|
+
prior = old.get(host) or {}
|
|
151
|
+
if desired["mode"] == "off":
|
|
152
|
+
rule["access"] = desired
|
|
153
|
+
elif prior and desired == normalize_access(prior):
|
|
154
|
+
# Offline/unrelated updates retain the known JWT enforcement.
|
|
155
|
+
if not prior.get("aud_tag") or not prior.get("team_name"):
|
|
156
|
+
raise ValueError("Existing Access metadata is incomplete; configure protection again.")
|
|
157
|
+
rule["access"] = dict(prior)
|
|
158
|
+
else:
|
|
159
|
+
client = client or AccessClient(state)
|
|
160
|
+
org = client.request("GET", "/organizations") or {}
|
|
161
|
+
team = _team_name(org)
|
|
162
|
+
if not team:
|
|
163
|
+
raise ValueError("Complete Zero Trust onboarding first.")
|
|
164
|
+
if desired["mode"] == "existing":
|
|
165
|
+
app = client.request("GET", "/apps/" + desired["application_id"])
|
|
166
|
+
if app.get("type") != "self_hosted" or app.get("domain", "").lower() != host:
|
|
167
|
+
raise ValueError("Choose a self-hosted Access application covering this entire hostname.")
|
|
168
|
+
else:
|
|
169
|
+
providers = client.list("/identity_providers")
|
|
170
|
+
if not providers:
|
|
171
|
+
raise ValueError("Configure a login method or enable email PIN first.")
|
|
172
|
+
apps = client.list("/apps")
|
|
173
|
+
app = next((a for a in apps if a.get("id") == prior.get("managed_id")), None)
|
|
174
|
+
if app is None and any(a.get("domain", "").split("/")[0].lower() == host for a in apps):
|
|
175
|
+
raise ValueError("An Access application already exists for this hostname. Use existing application instead.")
|
|
176
|
+
payload = {"name": f"Portacode: {host}", "domain": host, "type": "self_hosted", "session_duration": "24h",
|
|
177
|
+
"policies": [{"name": "Portacode allowed emails", "decision": "allow", "include": [{"email": {"email": e}} for e in desired["emails"]]}]}
|
|
178
|
+
if app:
|
|
179
|
+
if app.get("domain") != host:
|
|
180
|
+
raise ValueError("Managed Access application changed externally; review it in Cloudflare.")
|
|
181
|
+
app = client.request("PUT", "/apps/" + app["id"], payload)
|
|
182
|
+
else:
|
|
183
|
+
app = client.request("POST", "/apps", payload)
|
|
184
|
+
desired["managed_id"] = app["id"]
|
|
185
|
+
if not app.get("aud"):
|
|
186
|
+
raise ValueError("Cloudflare did not return an application audience. Routing was not changed.")
|
|
187
|
+
desired.update(team_name=team, aud_tag=[app["aud"]], application_id=app["id"])
|
|
188
|
+
rule["access"] = desired
|
|
189
|
+
by_host[host] = rule["access"]
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def enable_otp(state):
|
|
193
|
+
client = AccessClient(state)
|
|
194
|
+
if not any(p.get("type") == "onetimepin" for p in client.list("/identity_providers")):
|
|
195
|
+
client.request("POST", "/identity_providers", {"name": "Email one-time PIN", "type": "onetimepin", "config": {}})
|
|
196
|
+
return inspect_access(state)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: portacode
|
|
3
|
-
Version: 2.2.28.
|
|
3
|
+
Version: 2.2.28.dev3
|
|
4
4
|
Summary: Device agent for the AI platform that builds, tests, deploys, and operates real software
|
|
5
5
|
Home-page: https://portacode.com/
|
|
6
6
|
Author: Meena Erian
|
|
@@ -33,6 +33,7 @@ Description-Content-Type: text/markdown
|
|
|
33
33
|
License-File: LICENSE
|
|
34
34
|
Requires-Dist: click>=8.0
|
|
35
35
|
Requires-Dist: platformdirs>=3.0
|
|
36
|
+
Requires-Dist: PyYAML<7,>=6.0
|
|
36
37
|
Requires-Dist: cryptography>=41.0
|
|
37
38
|
Requires-Dist: websockets>=12.0
|
|
38
39
|
Requires-Dist: pyperclip>=1.8
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
portacode/README.md,sha256=R76fnJCKOnLiBEirTtc7fj4A6j5vAN1pdYMGNGqu1cs,1215
|
|
2
2
|
portacode/__init__.py,sha256=Hwk8wm5KA79qi06r0qKJKT2kjUlHrWaDtH4CyhnWFw8,1086
|
|
3
3
|
portacode/__main__.py,sha256=jmHTGC1hzmo9iKJLv-SSYe9BSIbPPZ2IOpecI03PlTs,296
|
|
4
|
-
portacode/_version.py,sha256=
|
|
4
|
+
portacode/_version.py,sha256=9rpTbtg_HNt7pDaB7AgIslfUPMHDgtvp9HggHE43cuY,535
|
|
5
5
|
portacode/browser_cli.py,sha256=MEc_WxTeezR4WP9wKcC89FGDeXbLyN6Ybfs-foUnrEY,5995
|
|
6
6
|
portacode/browser_prepare.py,sha256=xZRMkSEDZxw1YYz4LbiiYbmF9nOkXLcGsgkbGtVFfmQ,4805
|
|
7
7
|
portacode/browser_runtime.py,sha256=YR0duDqZaZrgSy0I9HrfZqV2fzcU2kIvUG1VyBiC93c,4276
|
|
8
|
-
portacode/cli.py,sha256=
|
|
8
|
+
portacode/cli.py,sha256=mei5eqhrnI_uDQw3IJ_lyDCP4YiUdoq4r9SgHYa8OJA,41508
|
|
9
9
|
portacode/codex_loopback_proxy.py,sha256=CK875nnfdyHGY61C-hC7IaQHG9V-jCKdgbdOf2WuaWA,24837
|
|
10
10
|
portacode/codex_prepare.py,sha256=eVIYcXjyk06XhNBGl46sC_PsBQvykSR1sIR7Ny69cR0,28284
|
|
11
11
|
portacode/codex_usage_limit.py,sha256=H3TTD-dest4bTLvgX-ZWKpxVP5Yv25PDteJnHrLOyu8,1414
|
|
@@ -36,19 +36,19 @@ portacode/connection/client.py,sha256=QDFRwBjATw5tp-wlhkiz5OfL_jVAwRHcVpPOYg6ntO
|
|
|
36
36
|
portacode/connection/codex_app_server.py,sha256=Q16bD78Hf14mtiWQ4QIB8eCTEY4wZrVytrXxr36Mo2E,23245
|
|
37
37
|
portacode/connection/guest_host_protocol.py,sha256=bXghGvUFuj2yg89pPljLuS4ivEYwgM3BwDK7CHIc2Dk,6199
|
|
38
38
|
portacode/connection/multiplex.py,sha256=L-TxqJ_ZEbfNEfu1cwxgJ5vUdyRzZjsMy2Kx1diiZys,5237
|
|
39
|
-
portacode/connection/terminal.py,sha256=
|
|
39
|
+
portacode/connection/terminal.py,sha256=039wxCa502VYz1K4gG2ZMvVb4iLXYQD3D_SZz9EyBus,75614
|
|
40
40
|
portacode/connection/test_guest_host_protocol.py,sha256=KhoXv4YMDYh6ENQrzW5rQNDZ3PMTP7oSN6iSC9KH4NE,2561
|
|
41
41
|
portacode/connection/test_guest_host_terminal.py,sha256=3c54_1fBHljdKmxpj4LYudVpgMZ-W8p_wB14WYVswps,5151
|
|
42
42
|
portacode/connection/test_webmin_proxy_config.py,sha256=52Qv9C0E5UzKUvQDJfREAb3RwJWs5R_CkKECrTWOsNg,1121
|
|
43
43
|
portacode/connection/webmin_proxy_config.py,sha256=vxzucOUz_GgxDjZWcgNVj7ImNfbdpIRABWpG_ihcK6s,2569
|
|
44
44
|
portacode/connection/handlers/README.md,sha256=pnSmHxnmBIwLkWcuNBbZb2XQdYox_dOnSu8-cWoDWJA,13385
|
|
45
45
|
portacode/connection/handlers/WEBSOCKET_PROTOCOL.md,sha256=tKZS0I9mPSaH96U3gNqWn96NCERErVW2x9VMqaKJ51w,134520
|
|
46
|
-
portacode/connection/handlers/__init__.py,sha256=
|
|
46
|
+
portacode/connection/handlers/__init__.py,sha256=1orh40S0gMbL4tvuUaIRapihCtGJ5tXipo4YUotcJAM,5278
|
|
47
47
|
portacode/connection/handlers/automation_v2_handlers.py,sha256=tCwXul5MZaZhdwGwKvIQEaUC2ySiX12e35R64Gm3wR0,54239
|
|
48
48
|
portacode/connection/handlers/base.py,sha256=tMsKJmnNhXA3a4YZA55a0WO2e8-4Uh4BsG9lWAr3Ris,10829
|
|
49
49
|
portacode/connection/handlers/browser_handlers.py,sha256=FRSxxkexiqJVq7zivDoPwEAyZvhN2GFpwN0N8_lAlno,29065
|
|
50
50
|
portacode/connection/handlers/chunked_content.py,sha256=h6hXRmxSeOgnIxoU8CkmvEf2Odv-ajPrpHIe_W3GKcA,9251
|
|
51
|
-
portacode/connection/handlers/cloudflare_forwarding.py,sha256=
|
|
51
|
+
portacode/connection/handlers/cloudflare_forwarding.py,sha256=v7jLFnSYoECakB8O8cEKArhk1SuD8NYsRr_YE-QT0f8,49528
|
|
52
52
|
portacode/connection/handlers/cloudflare_tunnel.py,sha256=qHBrm2rATxFmvfoC49YOBj0EUXjh_FETiWw66krxCIg,6655
|
|
53
53
|
portacode/connection/handlers/codex_handlers.py,sha256=np7PxFC6nL68Qj99B7VD-1DdCayABR-KlideTxytjwU,53639
|
|
54
54
|
portacode/connection/handlers/diff_handlers.py,sha256=coN8gfY85KctBEs_bL9RCrZ6iymbP7zaB4Mzwgqrsck,24676
|
|
@@ -62,11 +62,12 @@ portacode/connection/handlers/registry.py,sha256=dMv0fiCY4RFtkkyB1vmQMrrpD7zEhiP
|
|
|
62
62
|
portacode/connection/handlers/resumable_transfer_handlers.py,sha256=p8PaRRYh45LjKdfhIdHdUqREHpTlJ90yXWxnhAdYGaE,32671
|
|
63
63
|
portacode/connection/handlers/runtime_user.py,sha256=tvetxe4CKe8QzmROz9HE-dEpTlKJhg_7UjChyviOlOc,7707
|
|
64
64
|
portacode/connection/handlers/session.py,sha256=xUmSorFxKoLz7y9BLxfFD4VkSHEtL0bi_qf3mP0kmcw,46784
|
|
65
|
-
portacode/connection/handlers/system_handlers.py,sha256
|
|
65
|
+
portacode/connection/handlers/system_handlers.py,sha256=rzu1vMiOlVMMoHXsbRO0ttuHEZfYYCsxDSe5QfRBT10,23870
|
|
66
66
|
portacode/connection/handlers/tab_factory.py,sha256=yn93h6GASjD1VpvW1oqpax3EpoT0r7r97zFXxML1wdA,16173
|
|
67
67
|
portacode/connection/handlers/terminal_handlers.py,sha256=s6bNmnXkjbV7rjSoYVDbbB9uHLGj2yNCz30wM6aRaHA,18651
|
|
68
68
|
portacode/connection/handlers/test_browser_handlers.py,sha256=Z5XuVrapOdCa5ZBcfmC6KLSuSV4Jl57YfIu0bLBLvAs,19407
|
|
69
|
-
portacode/connection/handlers/
|
|
69
|
+
portacode/connection/handlers/test_cloudflare_access.py,sha256=P43aeaVVZJ7Jr2GAwFzI5BSHIzMfKBXCcc0_vis6YQA,8743
|
|
70
|
+
portacode/connection/handlers/test_cloudflare_forwarding.py,sha256=ifKF-aSeEPr7IDuBlYjAfDowO7Q_qvji46I0iQe6T1w,11661
|
|
70
71
|
portacode/connection/handlers/test_file_move_copy.py,sha256=uXejCCcPWKs9qfyL6ckp0NxjwGYK3-Y63i3lFz-F47M,2872
|
|
71
72
|
portacode/connection/handlers/test_git_handlers.py,sha256=T9gFkCjanEC2L8n_kS2Ht0e67he34vThQtJU7j68auo,3514
|
|
72
73
|
portacode/connection/handlers/test_proxmox_infra.py,sha256=8vDSP7RhYltWazKOkD7oVxp2BpvQwPScDK3sD0D7FNg,60419
|
|
@@ -74,16 +75,15 @@ portacode/connection/handlers/test_runtime_user.py,sha256=L1p1XuW_D1O_HTGt6INRP4
|
|
|
74
75
|
portacode/connection/handlers/update_handler.py,sha256=44eVJlvhKzCiR0KXtyrPpGlqp7fAhMRyIpllaM9ZmiI,2124
|
|
75
76
|
portacode/connection/handlers/project_state/README.md,sha256=trdd4ig6ungmwH5SpbSLfyxbL-QgPlGNU-_XrMEiXtw,10114
|
|
76
77
|
portacode/connection/handlers/project_state/__init__.py,sha256=5ucIqk6Iclqg6bKkL8r_wVs5Tlt6B9J7yQH6yQUt7gc,2541
|
|
77
|
-
portacode/connection/handlers/project_state/file_system_watcher.py,sha256=
|
|
78
|
+
portacode/connection/handlers/project_state/file_system_watcher.py,sha256=pnDOCPEliZ1MTYmRWrgiS0BbtsY8I0daKRzpSvAo6Fs,10805
|
|
78
79
|
portacode/connection/handlers/project_state/git_manager.py,sha256=prXY1Mc-n8b2QWm3A0F8aRoRhQEyD6l8FA4NhwExL7w,69882
|
|
79
80
|
portacode/connection/handlers/project_state/handlers.py,sha256=IFA3mfQ-yx-h28JRoyJnSr4xehugX4Ef-n7QJAKLyG4,40550
|
|
80
|
-
portacode/connection/handlers/project_state/manager.py,sha256=
|
|
81
|
-
portacode/connection/handlers/project_state/models.py,sha256=
|
|
81
|
+
portacode/connection/handlers/project_state/manager.py,sha256=3Iwg5QSzgClLpkYKHiB1g0TXKQOCQJUzO24yhXrfOPM,71941
|
|
82
|
+
portacode/connection/handlers/project_state/models.py,sha256=WdxGCFjjD4dHE01PjQnZSrZCboCSriIeGl50hTIg-ik,4353
|
|
82
83
|
portacode/connection/handlers/project_state/test_handlers.py,sha256=OpDMA80NDAmE3Mz5blM6sOCeSnYeBg0fZmyN3gQpOlI,2789
|
|
84
|
+
portacode/connection/handlers/project_state/test_sync.py,sha256=eHw1SMrenclMhcHrPYNjtKYMPfi6-HxzArUR_K_Yz94,4781
|
|
83
85
|
portacode/connection/handlers/project_state/utils.py,sha256=LsbQr9TH9Bz30FqikmtTxco4PlB_n0kUIuPKQ6Fb_mo,1665
|
|
84
86
|
portacode/link_capture/__init__.py,sha256=93LjyYDqzOimsIDBhsPibTl7tr-8DiIzyDF7JWQkE2A,1231
|
|
85
|
-
portacode/link_capture/__pycache__/__init__.cpython-311.pyc,sha256=yKwOu63AoGpmk4l-jfGnt2G2YkI54I8MppgDvq8K4_s,2037
|
|
86
|
-
portacode/link_capture/__pycache__/__init__.cpython-38.pyc,sha256=q8pOyPtm1HJx__3-hR_9iW94o9NSrsue1W6_AcOfJLo,1123
|
|
87
87
|
portacode/link_capture/bin/elinks,sha256=VWEQlNcPazqaEJdDMbXmXJ2SLaAqN__IUBQNp8sSSto,104
|
|
88
88
|
portacode/link_capture/bin/gio-open,sha256=jOYX5fCkqWfFAY6ebJt6C1UcXISHa4iRmLePs5jU3Ko,106
|
|
89
89
|
portacode/link_capture/bin/gnome-open,sha256=oZHDhCtUWURmPry5EgkZjeJWZC2f10Qk101Dc4fNTVs,108
|
|
@@ -101,8 +101,6 @@ portacode/link_capture/bin/sensible-browser,sha256=oKVTZM1Z_mLEI2M-Lm-eaBK-Uqc00
|
|
|
101
101
|
portacode/link_capture/bin/w3m,sha256=mdM0AF4h_ElkfI2YZ-Ko1KHgWk2zLQrRwb2w1QQxXU8,101
|
|
102
102
|
portacode/link_capture/bin/x-www-browser,sha256=3RhqrunuuVktUf6WrbozW7qKlvfIlwXShl8PwF6Q80k,111
|
|
103
103
|
portacode/link_capture/bin/xdg-open,sha256=GLUv5ejdN8tym4PNtgKqTcZpF7YHIO3BnlWs3z3SQ3U,106
|
|
104
|
-
portacode/link_capture/bin/__pycache__/link_capture_wrapper.cpython-311.pyc,sha256=qRHqIznYM3smc99RBQ0XPA7j3NP5_HrTUvlTjKCmuos,3781
|
|
105
|
-
portacode/link_capture/bin/__pycache__/link_capture_wrapper.cpython-38.pyc,sha256=sBZ-Gss-eL7bsrOA-6WRKm0Fk8a7IKgqffrkE04uX9E,1971
|
|
106
104
|
portacode/static/js/test-ntp-clock.html,sha256=bUow9sifIuLNPqKvuPbpQozmEE6RhdCI4Plib3CqUmw,2130
|
|
107
105
|
portacode/static/js/utils/ntp-clock.js,sha256=t9moJyAGGU054BVtuGuSETVstlj1AoxVy44i4y9QWSs,6940
|
|
108
106
|
portacode/tests/test_automation_v2_inputs.py,sha256=ibVWnapK9owZtq5SIf5tTHvA1cGWf5ozDYb2AiL1LtA,5221
|
|
@@ -122,6 +120,7 @@ portacode/tests/test_system_handlers.py,sha256=gbc5n6o3OxDpm-wRs4D2Y3IURfs1Vesli
|
|
|
122
120
|
portacode/tests/test_terminal_periodic_system_info.py,sha256=cYdTnI6lEigWGNtDH_54JWP9Mo4D6xr8MFHvtE_PADA,1940
|
|
123
121
|
portacode/tests/test_terminal_session_shell.py,sha256=nNM_fbT1vM8oknGDBeNk0eiRtZ8uz17dXXOB7STgGK8,2157
|
|
124
122
|
portacode/tunneling/__init__.py,sha256=qOrizn5awmPfsabVF59-EkmXnvS8AogvcBtVON6UfP0,54
|
|
123
|
+
portacode/tunneling/access.py,sha256=zRdhsT_fQ-cFyqN2ZdLkOWwzXsHifm9tz3qqpVkke_U,9865
|
|
125
124
|
portacode/tunneling/cloudflared_login.py,sha256=5guJT84CG-O1KgR5PgLNIJNzQ-HxCjGgtfqoHSKe8Zg,2456
|
|
126
125
|
portacode/tunneling/ensure_cloudflared.py,sha256=4NiN-WZ8-vTeoFTALg-mc_sksvhEaFo0oCZwUMvPBdY,6041
|
|
127
126
|
portacode/tunneling/ensure_pyyaml.py,sha256=cR4LOdJnUQnhH_chq5NL1MAxtSd5x0coNrwzZdPbzhY,2178
|
|
@@ -136,7 +135,7 @@ portacode/utils/diff_apply.py,sha256=ArkT-vEQ7iyA1Nfqufq1AiNtRLhoCMnC75FCRh2kNgI
|
|
|
136
135
|
portacode/utils/diff_renderer.py,sha256=S76StnQ2DLfsz4Gg0m07UwPfRp8270PuzbNaQq-rmYk,13850
|
|
137
136
|
portacode/utils/ntp_clock.py,sha256=VqCnWCTehCufE43W23oB-WUdAZGeCcLxkmIOPwInYHc,2499
|
|
138
137
|
portacode/utils/runtime_paths.py,sha256=G9ROho5f5gnDhoQ7vpEAX2XifBzoJTvqTylkF2Hkx8E,1660
|
|
139
|
-
portacode-2.2.28.
|
|
138
|
+
portacode-2.2.28.dev3.dist-info/licenses/LICENSE,sha256=iiV44E3po4OL77NL8diCk3WtYvCNGu6gUci2TYxVUgQ,5520
|
|
140
139
|
test_modules/README.md,sha256=Do_agkm9WhSzueXjRAkV_xEj6Emy5zB3N3VKY5Roce8,9274
|
|
141
140
|
test_modules/__init__.py,sha256=1LcbHodIHsB0g-g4NGjSn6AMuCoGbymvXPYLOb6Z7F0,53
|
|
142
141
|
test_modules/test_device_online.py,sha256=QtYq0Dq9vME8Gp2O4fGSheqVf8LUtpsSKosXXk56gGM,1654
|
|
@@ -162,8 +161,8 @@ testing_framework/core/playwright_manager.py,sha256=asMe7zQg8Kp3a71F7pv92OiFt63B
|
|
|
162
161
|
testing_framework/core/runner.py,sha256=t3fq0mGCVUCE_TbieEPwmLKjxe44ez29SzW8G33ACME,19746
|
|
163
162
|
testing_framework/core/shared_cli_manager.py,sha256=BESSNtyQb7BOlaOvZmm04T8Uezjms4KCBs2MzTxvzYQ,8790
|
|
164
163
|
testing_framework/core/test_discovery.py,sha256=2FZ9fJ8Dp5dloA-fkgXoJ_gCMC_nYPBnA3Hs2xlagzM,4928
|
|
165
|
-
portacode-2.2.28.
|
|
166
|
-
portacode-2.2.28.
|
|
167
|
-
portacode-2.2.28.
|
|
168
|
-
portacode-2.2.28.
|
|
169
|
-
portacode-2.2.28.
|
|
164
|
+
portacode-2.2.28.dev3.dist-info/METADATA,sha256=u-B1rvd22rmlLPiXfuCGb3XZ-6d1dX4SMhGTsr2nBhs,12881
|
|
165
|
+
portacode-2.2.28.dev3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
166
|
+
portacode-2.2.28.dev3.dist-info/entry_points.txt,sha256=0cV_SuIztVnLWACUY5KMR8K8pWdAsLiaFbLXE5He0rk,151
|
|
167
|
+
portacode-2.2.28.dev3.dist-info/top_level.txt,sha256=TGhTYUxfW8SyVZc_zGgzjzc24gGT7nSw8Qf73liVRKM,41
|
|
168
|
+
portacode-2.2.28.dev3.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|