refactorai-cli 0.2.12__tar.gz → 0.2.13__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.
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/PKG-INFO +1 -1
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/pyproject.toml +1 -1
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/__init__.py +1 -1
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/runtime_manager.py +16 -2
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/PKG-INFO +1 -1
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/README.md +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/auth.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/client.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/__init__.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/auth_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/engine_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/model_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/rules_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/run_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/runtime_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/runtime_proxy_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/setup_cmds.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/control_plane.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/credentials.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/local_constitution.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/local_engine_runtime.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/local_paths.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/main.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/model_policy.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/settings.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/setup_flow.py +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/SOURCES.txt +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/dependency_links.txt +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/entry_points.txt +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/requires.txt +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/top_level.txt +0 -0
- {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/setup.cfg +0 -0
|
@@ -14,6 +14,7 @@ import platform
|
|
|
14
14
|
from dataclasses import dataclass
|
|
15
15
|
from datetime import datetime, timezone
|
|
16
16
|
from pathlib import Path
|
|
17
|
+
from urllib.parse import urlparse
|
|
17
18
|
|
|
18
19
|
import httpx
|
|
19
20
|
|
|
@@ -153,9 +154,11 @@ def resolve_runtime_manifest(*, channel: str = "stable", timeout: float = 20.0)
|
|
|
153
154
|
|
|
154
155
|
|
|
155
156
|
def download_artifact(url: str, *, timeout: float = 60.0) -> bytes:
|
|
156
|
-
|
|
157
|
+
headers: dict[str, str] = {}
|
|
158
|
+
if _should_send_runtime_auth(url):
|
|
159
|
+
headers["Authorization"] = _runtime_auth_header()
|
|
157
160
|
try:
|
|
158
|
-
response = httpx.get(url, headers=
|
|
161
|
+
response = httpx.get(url, headers=headers, timeout=max(float(timeout), 300.0))
|
|
159
162
|
except httpx.HTTPError as exc:
|
|
160
163
|
raise RuntimeError(f"Could not download runtime artifact: {exc}") from exc
|
|
161
164
|
if response.status_code >= 400:
|
|
@@ -163,6 +166,17 @@ def download_artifact(url: str, *, timeout: float = 60.0) -> bytes:
|
|
|
163
166
|
return response.content
|
|
164
167
|
|
|
165
168
|
|
|
169
|
+
def _should_send_runtime_auth(url: str) -> bool:
|
|
170
|
+
try:
|
|
171
|
+
artifact_host = str(urlparse(url).netloc or "").strip().lower()
|
|
172
|
+
platform_host = str(urlparse(platform_url()).netloc or "").strip().lower()
|
|
173
|
+
except Exception:
|
|
174
|
+
return True
|
|
175
|
+
if not artifact_host or not platform_host:
|
|
176
|
+
return True
|
|
177
|
+
return artifact_host == platform_host
|
|
178
|
+
|
|
179
|
+
|
|
166
180
|
def _runtime_auth_header() -> str:
|
|
167
181
|
try:
|
|
168
182
|
lease = ensure_lease()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/runtime_proxy_cmds.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|