lange-python 0.3.22__tar.gz → 0.3.25__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.
- {lange_python-0.3.22 → lange_python-0.3.25}/PKG-INFO +1 -1
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/distribution/_client.py +5 -5
- lange_python-0.3.25/lange/tunnel/_util.py +29 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/pyproject.toml +1 -1
- lange_python-0.3.22/lange/tunnel/_util.py +0 -18
- {lange_python-0.3.22 → lange_python-0.3.25}/README.md +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/__main__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/_util/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/_util/_base_client.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/_util/_key_handling.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/build/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/build/_command.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/build/_discovery.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/build/_docker.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/build/_poetry.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/build/_types.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/_stats.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/audit/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/audit/_command.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/audit/_discovery.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/audit/_runner.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/code/audit/_types.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/distribution/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/cli/distribution/_command.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/distribution/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/distribution/_update_macos.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/distribution/_util.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/tunnel/__init__.py +0 -0
- {lange_python-0.3.22 → lange_python-0.3.25}/lange/tunnel/_client.py +0 -0
|
@@ -28,7 +28,7 @@ class DistributionClient(BaseLangeLabsClient):
|
|
|
28
28
|
"""
|
|
29
29
|
Client for querying public distribution metadata and update availability.
|
|
30
30
|
|
|
31
|
-
:param host: Base
|
|
31
|
+
:param host: Base API-service URL, e.g. ``https://api.lange-labs.com``.
|
|
32
32
|
:param api_key: Optional API key supplied directly or resolved from the environment.
|
|
33
33
|
:param timeout: HTTP timeout in seconds for metadata requests.
|
|
34
34
|
:raises ValueError: If ``api_key`` is provided but empty.
|
|
@@ -36,13 +36,13 @@ class DistributionClient(BaseLangeLabsClient):
|
|
|
36
36
|
|
|
37
37
|
def __init__(self,
|
|
38
38
|
distribution_name: str,
|
|
39
|
-
host: str = "https://lange-labs.com",
|
|
39
|
+
host: str = "https://api.lange-labs.com",
|
|
40
40
|
api_key: str | None = None,
|
|
41
41
|
timeout: float = 10.0) -> None:
|
|
42
42
|
"""
|
|
43
|
-
Initialize a distribution metadata client for the Lange
|
|
43
|
+
Initialize a distribution metadata client for the Lange API service.
|
|
44
44
|
|
|
45
|
-
:param host: Base
|
|
45
|
+
:param host: Base API-service URL, e.g. ``https://api.lange-labs.com``.
|
|
46
46
|
:param api_key: Optional API key supplied directly or resolved from the environment.
|
|
47
47
|
:param timeout: HTTP timeout in seconds for metadata requests.
|
|
48
48
|
:param distribution_name: Distribution name as stored by the app service.
|
|
@@ -216,7 +216,7 @@ class DistributionClient(BaseLangeLabsClient):
|
|
|
216
216
|
|
|
217
217
|
:returns: Fully qualified versions collection URL.
|
|
218
218
|
"""
|
|
219
|
-
return f"{self.host}/api/distributions/{self.distribution_name}/versions"
|
|
219
|
+
return f"{self.host}/api/v1/distributions/{self.distribution_name}/versions"
|
|
220
220
|
|
|
221
221
|
def _get_newest_version_artifact(self, os_name: str) -> tuple[str, dict[str, Any]] | None:
|
|
222
222
|
"""
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from typing import Any, Final
|
|
2
|
+
|
|
3
|
+
HOP_BY_HOP_HEADERS: Final[frozenset[str]] = frozenset(
|
|
4
|
+
{
|
|
5
|
+
"connection",
|
|
6
|
+
"content-length",
|
|
7
|
+
"host",
|
|
8
|
+
"keep-alive",
|
|
9
|
+
"transfer-encoding",
|
|
10
|
+
"upgrade",
|
|
11
|
+
}
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _filter_hop_by_hop_headers(headers: Any) -> dict[str, str]:
|
|
16
|
+
"""
|
|
17
|
+
Remove hop-by-hop and proxy-controlled headers before forwarding to the local target.
|
|
18
|
+
|
|
19
|
+
:param headers: Request header mapping.
|
|
20
|
+
:returns: Filtered header mapping.
|
|
21
|
+
"""
|
|
22
|
+
if not isinstance(headers, dict):
|
|
23
|
+
return {}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
str(key): str(value)
|
|
27
|
+
for key, value in headers.items()
|
|
28
|
+
if str(key).lower() not in HOP_BY_HOP_HEADERS
|
|
29
|
+
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
def _filter_hop_by_hop_headers(headers: Any) -> dict[str, str]:
|
|
4
|
-
"""
|
|
5
|
-
Remove hop-by-hop headers before forwarding to the local target.
|
|
6
|
-
|
|
7
|
-
:param headers: Request header mapping.
|
|
8
|
-
:returns: Filtered header mapping.
|
|
9
|
-
"""
|
|
10
|
-
if not isinstance(headers, dict):
|
|
11
|
-
return {}
|
|
12
|
-
|
|
13
|
-
hop_by_hop = {"connection", "keep-alive", "transfer-encoding", "upgrade"}
|
|
14
|
-
return {
|
|
15
|
-
str(key): str(value)
|
|
16
|
-
for key, value in headers.items()
|
|
17
|
-
if str(key).lower() not in hop_by_hop
|
|
18
|
-
}
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|