drukbox-python-sdk 0.4.0__tar.gz → 0.5.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.5
2
2
  Name: drukbox-python-sdk
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Async Python client for Drukbox.
5
5
  Project-URL: Homepage, https://github.com/clawhaven/drukbox-python-sdk
6
6
  Project-URL: Repository, https://github.com/clawhaven/drukbox-python-sdk
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "drukbox-python-sdk"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  description = "Async Python client for Drukbox."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -198,7 +198,8 @@ class DoctorReport:
198
198
 
199
199
  ok: bool
200
200
  active_provider: str
201
- tailscale_enabled: bool
201
+ # Whether the active provider's hosts join the tailnet.
202
+ tailnet: bool
202
203
  checks: list[DoctorCheck]
203
204
 
204
205
 
@@ -490,7 +491,8 @@ class SandboxAPI:
490
491
  return DoctorReport(
491
492
  ok=data["ok"],
492
493
  active_provider=data["active_provider"],
493
- tailscale_enabled=data["tailscale_enabled"],
494
+ # drukbox before "Join the tailnet per provider" sent tailscale_enabled.
495
+ tailnet=data["tailnet"] if "tailnet" in data else data["tailscale_enabled"],
494
496
  checks=[DoctorCheck(**check) for check in data["checks"]],
495
497
  )
496
498
 
@@ -48,7 +48,7 @@ def _doctor_payload(**overrides: Any) -> dict[str, Any]:
48
48
  payload: dict[str, Any] = {
49
49
  "ok": True,
50
50
  "active_provider": "aws",
51
- "tailscale_enabled": True,
51
+ "tailnet": True,
52
52
  "checks": [
53
53
  {
54
54
  "name": "db",
@@ -925,6 +925,17 @@ def test_from_env_strips_trailing_slash_via_constructor(
925
925
  assert sandbox.base_url == "https://trailing.test"
926
926
 
927
927
 
928
+ @respx.mock
929
+ async def test_doctor_reads_tailscale_enabled_from_an_older_drukbox(api: SandboxAPI):
930
+ payload = _doctor_payload()
931
+ payload["tailscale_enabled"] = payload.pop("tailnet")
932
+ respx.get(f"{BASE_URL}/doctor").mock(return_value=httpx.Response(200, json=payload))
933
+
934
+ report = await api.doctor()
935
+
936
+ assert report.tailnet is True
937
+
938
+
928
939
  @respx.mock
929
940
  async def test_doctor_parses_report_and_checks(api: SandboxAPI):
930
941
  route = respx.get(f"{BASE_URL}/doctor").mock(
@@ -937,7 +948,7 @@ async def test_doctor_parses_report_and_checks(api: SandboxAPI):
937
948
  assert route.calls.last.request.headers["Authorization"] == "Bearer t-test"
938
949
  assert report.ok is True
939
950
  assert report.active_provider == "aws"
940
- assert report.tailscale_enabled is True
951
+ assert report.tailnet is True
941
952
  assert [check.name for check in report.checks] == ["db", "provider", "tailscale"]
942
953
  provider = next(check for check in report.checks if check.name == "provider")
943
954
  assert provider.status == "ok"