Skip to content

feat(provider): ListDomains + EnumerateAll for infra.dns#27

Merged
intel352 merged 4 commits into
mainfrom
feat/dns-enumerate-all-2026-05-26T1900
May 27, 2026
Merged

feat(provider): ListDomains + EnumerateAll for infra.dns#27
intel352 merged 4 commits into
mainfrom
feat/dns-enumerate-all-2026-05-26T1900

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • Adds Client.ListDomains(ctx) ([]Domain, error) to pkg/hoverclient calling GET /api/domains — the account-level inverse-key needed by the upstream IaCProviderEnumerator path.
  • Implements IaCProviderEnumerator.EnumerateAll(\"infra.dns\") on HoverProvider via the new ListDomains; per-zone Outputs carry zone + domain_id.
  • Wires hoverDomainLister interface so tests inject a slice-backed fake (fakeHoverClient) instead of spinning up the real login flow.
  • Domains with empty Name are dropped rather than emitted with empty ProviderID (loud-on-malformed-row).
  • ListDomains surfaces HTTP non-2xx + body-level {succeeded:false} as Go errors (loud-on-failure).
  • Adds env-gated live integration test (INFRA_DNS_ENUMERATE_LIVE=1 + HOVER_USERNAME + HOVER_PASSWORD).

Tag follow-up

The cross-repo cascade pin-bumps pkg/hoverclient in consumers via workflow-registry PR 5 — that requires this PR to merge and a v0.4.0 tag on the parent module (workflow-plugin-hover). pkg/hoverclient is a subpath inside the single Go module, NOT a separate module, so the parent tag is what consumers resolve via go get .../pkg/hoverclient@v0.4.0.

Part of cross-repo cascade docs/plans/2026-05-26-dns-provider-contract.md (workflow-plugin-infra).

Test plan

  • `GOWORK=off go test ./...` green (unit tests for ListDomains happy/error paths + HoverProvider.EnumerateAll happy/blank-name/uninitialized/unsupported-type guards + gRPC-level hoverIaCServer.EnumerateAll).
  • `GOWORK=off go build -tags live_dns ./...` green (live test compiles under the build tag).
  • Self-hosted live smoke: `INFRA_DNS_ENUMERATE_LIVE=1 HOVER_USERNAME=$U HOVER_PASSWORD=$P GOWORK=off go test -tags live_dns -run TestHoverProvider_EnumerateAll_DNS_live ./internal/...`
  • Capability advertisement: `wfctl plugin verify-capabilities` lists `IaCProviderEnumerator` (post-build, follow-up).

intel352 added 4 commits May 26, 2026 20:48
Adds Client.ListDomains calling GET /api/domains; returns the full
[]Domain list (ID + Name) for the authenticated account. Distinct from
GetDomain (which targets /api/domains/<name>/dns for per-zone records);
ListDomains is the account-level inverse-key needed by the upstream
IaCProviderEnumerator.EnumerateAll("infra.dns") path.

Loud-on-failure semantics:
- HTTP non-2xx surfaces as a Go error (rather than empty slice).
- Body-level {succeeded: false} also surfaces as an error so callers
  don't act on stale state.

Part of docs/plans/2026-05-26-dns-provider-contract.md PR 4 (Task 10).
Introduces the hoverDomainLister interface (single-method shape: ListDomains)
plus a domains field on HoverProvider so EnumerateAll can list the account's
zones via either the real *hoverclient.Client or a slice-backed fake
(fakeHoverClient) in tests. Initialize() now wires domains = client.

The EnumerateAll method is intentionally not yet defined — tests fail at
build time with 'no field or method EnumerateAll', driving the next
commit's implementation.

Part of docs/plans/2026-05-26-dns-provider-contract.md PR 4 (Task 12).
…ent ListDomains

Wires the existing IaCProviderEnumerator service body on hoverIaCServer
(was an Unimplemented stub) and adds the matching *HoverProvider.EnumerateAll
Go method. Production uses *hoverclient.Client.ListDomains; tests inject
a slice-backed hoverDomainLister (fakeHoverClient). Per-zone Outputs
carry zone + domain_id so the downstream IaCProvider.Import path can
adopt the zone without re-querying the account list.

Domains with empty Name are dropped rather than emitted with empty
ProviderID — guards against malformed upstream rows.

Adds gRPC-level coverage on hoverIaCServer.EnumerateAll exercising the
outputs_json marshalling round-trip.

Part of docs/plans/2026-05-26-dns-provider-contract.md PR 4 (Task 12).
Adds an INFRA_DNS_ENUMERATE_LIVE=1 build-tagged smoke test that exercises
the real *hoverclient.Client.ListDomains against a live Hover account.
Live runs require HOVER_USERNAME + HOVER_PASSWORD; HOVER_TOTP_SECRET is
optional and only needed when the test account has MFA enabled.

Part of docs/plans/2026-05-26-dns-provider-contract.md PR 4 (Task 13).
@intel352 intel352 merged commit b62520c into main May 27, 2026
4 checks passed
@intel352 intel352 deleted the feat/dns-enumerate-all-2026-05-26T1900 branch May 27, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant