Skip to content

GIGAHOST: Fix API quirks surfaced by the integration tests - #4617

Merged
TomOnTime merged 1 commit into
DNSControl:mod_gigahostfrom
jochristian:mod_gigahost_fixes
Jul 27, 2026
Merged

GIGAHOST: Fix API quirks surfaced by the integration tests#4617
TomOnTime merged 1 commit into
DNSControl:mod_gigahostfrom
jochristian:mod_gigahost_fixes

Conversation

@jochristian

Copy link
Copy Markdown
Collaborator

Fixes for #4553 — provider-level Gigahost API quirks the integration tests surfaced, all verified against the live API with a dedicated test zone. None are caused by the modernization changes; they were latent in the provider (or the API's behavior has changed since the provider was written).

Fixes

  • MX DELETE value form: the delete endpoint 404s when given the record_value the API itself returns for MX; it requires the internal RDATA presentation "<priority> <target>.". Added deleteValue().
  • 429 rate limiting: the API throttles hard enough that a normal-sized push can trip it. request() now retries up to 5 times with 2s→32s backoff, honoring Retry-After.
  • Null MX: the API rejects a . target ("MX record value must be a valid mail server hostname") → audit-reject with rejectif.MxNull.
  • TXT >255 octets: must be sent as RFC1035 quoted 255-octet chunks; the API returns that form with the outer quotes stripped, so it is decoded on read (unambiguous: a single character-string can't exceed 255 octets).
  • TXT with double quotes: cannot round-trip. Raw interior quotes are rejected by the API's zone parser (it blindly wraps values in quotes); the escaped form stores correctly (verified via dig) but reads back mangled (trailing \"\), breaking diffing and deletes → rejectif.TxtHasDoubleQuotes.
  • TXT leading/trailing spaces: trimmed by the API on store → rejectif.TxtStartsOrEndsWithSpaces.
  • NAPTR is single-record per label: POSTing a second NAPTR at the same label silently replaces the entire NAPTR RRset (201 "created", first record gone — verified via API and dig). Audit-rejects >1 NAPTR per label, and marks the NAPTR delete second record testcase .AllowNoChanges() so providers that audit-skip the multi-NAPTR case don't fail on the already-converged state.

Validation

cd integrationTest && go test -v -verbose -profile GIGAHOST -run TestDNSProviders
ok  github.com/DNSControl/dnscontrol/v5/integrationTest  87.9s
239 PASS / 77 SKIP / 0 FAIL

Also: go vet, gofmt, go test ./providers/gigahost clean.

All verified against the live API with a dedicated test zone:

- DELETE of an MX record requires value="<priority> <target>." (the
  internal RDATA presentation); the record_value the API returns 404s.
- Retry requests on 429 with backoff (honoring Retry-After); the API
  rate-limits aggressively enough that a normal push can trip it.
- Reject null MX ("0 ."): the API requires a valid mail server hostname.
- TXT values over 255 octets must be sent as RFC1035 quoted 255-octet
  chunks; the API returns that form with the outer quotes stripped, so
  decode it on read.
- Reject TXT values containing double quotes: raw interior quotes are
  rejected by the API's zone parser, and the escaped form stores
  correctly but reads back mangled (trailing '\"' becomes '\'),
  breaking diffing and deletes.
- Reject TXT values with leading/trailing spaces: the API trims them.
- Reject more than one NAPTR record per label: POSTing a second NAPTR
  silently replaces the entire NAPTR RRset. Mark the
  'NAPTR delete second record' testcase AllowNoChanges so providers
  that audit-skip the multi-NAPTR case don't fail on the already-
  converged state.

@TomOnTime TomOnTime left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the fast response!

@TomOnTime
TomOnTime merged commit db3597b into DNSControl:mod_gigahost Jul 27, 2026
7 checks passed
TomOnTime added a commit that referenced this pull request Jul 27, 2026
* gigahost: Modernize record conversion

* GIGAHOST: Fix API quirks surfaced by the integration tests (#4617)

All verified against the live API with a dedicated test zone:

- DELETE of an MX record requires value="<priority> <target>." (the
  internal RDATA presentation); the record_value the API returns 404s.
- Retry requests on 429 with backoff (honoring Retry-After); the API
  rate-limits aggressively enough that a normal push can trip it.
- Reject null MX ("0 ."): the API requires a valid mail server hostname.
- TXT values over 255 octets must be sent as RFC1035 quoted 255-octet
  chunks; the API returns that form with the outer quotes stripped, so
  decode it on read.
- Reject TXT values containing double quotes: raw interior quotes are
  rejected by the API's zone parser, and the escaped form stores
  correctly but reads back mangled (trailing '\"' becomes '\'),
  breaking diffing and deletes.
- Reject TXT values with leading/trailing spaces: the API trims them.
- Reject more than one NAPTR record per label: POSTing a second NAPTR
  silently replaces the entire NAPTR RRset. Mark the
  'NAPTR delete second record' testcase AllowNoChanges so providers
  that audit-skip the multi-NAPTR case don't fail on the already-
  converged state.

---------

Co-authored-by: Jo Christian Buvarp <jochristian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants