fix: preserve tenant creation metadata and report authority denial
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Container Image / build-and-push (push) Successful in 35s

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
tegwick 2026-09-11 20:52:47 +02:00
parent b9ae48b00c
commit 3c85e563ee
3 changed files with 50 additions and 2 deletions

View file

@ -52,6 +52,8 @@ class HTTPTenantManagementAdapter:
"tenant_id": tenant,
"identifier": tenant,
"actor": ACTOR,
"display_name": display_name,
"correlation_id": correlation_id,
}).encode(),
headers={
"Authorization": f"Bearer {self.bearer_token}",
@ -65,12 +67,12 @@ class HTTPTenantManagementAdapter:
with urlopen(request, timeout=self.timeout) as response:
result = json.loads(response.read())
except HTTPError as exc:
exc.read(4096)
if exc.code == 409:
exc.read(4096)
return TenantProvisioningResult(
tenant=tenant, status="existing", resumed=True, external_ref=tenant,
)
raise RuntimeError(f"tenant authority failed ({exc.code})") from exc
raise self._redacted(exc) from exc
except URLError as exc:
raise RuntimeError("tenant authority unavailable") from exc
return TenantProvisioningResult(