refactor(cli): let the client own its endpoints and split resolving from announcing

This commit is contained in:
Hugo Durand
2026-09-22 16:31:38 -04:00
parent 4ea2701a29
commit 80b94edd75
5 changed files with 66 additions and 61 deletions
+6 -1
View File
@@ -142,7 +142,8 @@ class HostBackendClient:
}
if tenant_id:
headers["X-Tenant-ID"] = tenant_id
self._base_url = base_url.rstrip("/")
self._endpoints = ControlPlaneEndpoints.from_control_plane_url(base_url)
self._base_url = self._endpoints.control_plane_url
self._client = httpx.Client(
base_url=self._base_url,
headers=headers,
@@ -154,6 +155,10 @@ class HostBackendClient:
def base_url(self) -> str:
return self._base_url
@property
def endpoints(self) -> ControlPlaneEndpoints:
return self._endpoints
def set_tenant(self, tenant_id: str) -> None:
self._client.headers["X-Tenant-ID"] = tenant_id