boxd 0.2.14.dev758__tar.gz → 0.2.15.dev780__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.
- {boxd-0.2.14.dev758/src/boxd.egg-info → boxd-0.2.15.dev780}/PKG-INFO +1 -1
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/pyproject.toml +1 -1
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/__init__.py +2 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_credentials.py +25 -13
- boxd-0.2.15.dev780/src/boxd/_generated/api_pb2.py +552 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_generated/api_pb2_grpc.py +43 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_mappers.py +2 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_requests.py +10 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/models.py +20 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/machines.py +137 -3
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780/src/boxd.egg-info}/PKG-INFO +1 -1
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd.egg-info/SOURCES.txt +1 -0
- boxd-0.2.15.dev780/tests/test_delete_self.py +81 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_mappers.py +10 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_namespaces.py +87 -0
- boxd-0.2.14.dev758/src/boxd/_generated/api_pb2.py +0 -548
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/LICENSE +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/README.md +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/setup.cfg +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_client.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_generated/__init__.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_streaming.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_transport.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_urls.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/_version_check.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/errors.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/__init__.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/account.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/credentials.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/disks.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/domains.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/orgs.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/snapshots.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/teams.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd/resources/vars.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd.egg-info/dependency_links.txt +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd.egg-info/requires.txt +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/src/boxd.egg-info/top_level.txt +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_credentials.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_requests.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_streaming.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_transport.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_urls.py +0 -0
- {boxd-0.2.14.dev758 → boxd-0.2.15.dev780}/tests/test_version_check.py +0 -0
|
@@ -52,6 +52,7 @@ from .models import (
|
|
|
52
52
|
DiskStatus,
|
|
53
53
|
EnvVar,
|
|
54
54
|
ExecResult,
|
|
55
|
+
SelfDeleteResult,
|
|
55
56
|
ExposedPort,
|
|
56
57
|
BillingActivityEntry,
|
|
57
58
|
BillingActivityPage,
|
|
@@ -129,6 +130,7 @@ __all__ = [
|
|
|
129
130
|
"DiskStatus",
|
|
130
131
|
"EnvVar",
|
|
131
132
|
"ExecResult",
|
|
133
|
+
"SelfDeleteResult",
|
|
132
134
|
"ExposedPort",
|
|
133
135
|
"BillingActivityEntry",
|
|
134
136
|
"BillingActivityPage",
|
|
@@ -117,6 +117,29 @@ async def probe_async(host: str, port: int, timeout: float = _PROBE_TIMEOUT_SECS
|
|
|
117
117
|
return True
|
|
118
118
|
|
|
119
119
|
|
|
120
|
+
def metadata_base(not_inside: str = _NO_CREDENTIALS) -> str:
|
|
121
|
+
"""The in-VM metadata adapter's base URL, or ``AuthenticationError(not_inside)``
|
|
122
|
+
when this code is not running inside a boxd machine. Detection needs BOTH
|
|
123
|
+
signals, the environment hint and a live probe — neither alone is
|
|
124
|
+
sufficient."""
|
|
125
|
+
if not looks_like_a_machine():
|
|
126
|
+
raise AuthenticationError(not_inside)
|
|
127
|
+
gateway = detect_gateway()
|
|
128
|
+
if not gateway or not probe(gateway, METADATA_PORT):
|
|
129
|
+
raise AuthenticationError(not_inside)
|
|
130
|
+
return f"http://{gateway}:{METADATA_PORT}"
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
async def metadata_base_async(not_inside: str = _NO_CREDENTIALS) -> str:
|
|
134
|
+
"""Async twin of :func:`metadata_base`."""
|
|
135
|
+
if not looks_like_a_machine():
|
|
136
|
+
raise AuthenticationError(not_inside)
|
|
137
|
+
gateway = detect_gateway()
|
|
138
|
+
if not gateway or not await probe_async(gateway, METADATA_PORT):
|
|
139
|
+
raise AuthenticationError(not_inside)
|
|
140
|
+
return f"http://{gateway}:{METADATA_PORT}"
|
|
141
|
+
|
|
142
|
+
|
|
120
143
|
# ── Response parsing (shared by both clients) ────────────────────────
|
|
121
144
|
|
|
122
145
|
|
|
@@ -256,13 +279,7 @@ class SyncCredentials(_CredentialsBase):
|
|
|
256
279
|
self.discovered_base_url = api_url
|
|
257
280
|
|
|
258
281
|
def _metadata_base(self) -> str:
|
|
259
|
-
|
|
260
|
-
if not looks_like_a_machine():
|
|
261
|
-
raise AuthenticationError(_NO_CREDENTIALS)
|
|
262
|
-
gateway = detect_gateway()
|
|
263
|
-
if not gateway or not probe(gateway, METADATA_PORT):
|
|
264
|
-
raise AuthenticationError(_NO_CREDENTIALS)
|
|
265
|
-
return f"http://{gateway}:{METADATA_PORT}"
|
|
282
|
+
return metadata_base()
|
|
266
283
|
|
|
267
284
|
|
|
268
285
|
class AsyncCredentials(_CredentialsBase):
|
|
@@ -321,12 +338,7 @@ class AsyncCredentials(_CredentialsBase):
|
|
|
321
338
|
self.discovered_base_url = api_url
|
|
322
339
|
|
|
323
340
|
async def _metadata_base(self) -> str:
|
|
324
|
-
|
|
325
|
-
raise AuthenticationError(_NO_CREDENTIALS)
|
|
326
|
-
gateway = detect_gateway()
|
|
327
|
-
if not gateway or not await probe_async(gateway, METADATA_PORT):
|
|
328
|
-
raise AuthenticationError(_NO_CREDENTIALS)
|
|
329
|
-
return f"http://{gateway}:{METADATA_PORT}"
|
|
341
|
+
return await metadata_base_async()
|
|
330
342
|
|
|
331
343
|
|
|
332
344
|
def _json_or_none(resp: httpx.Response) -> Any:
|