[grade=C urn:ump:meylbfvzagdtgff4oapeyqkvjmletbb6q7iul5suvwcw5gq66wxa] fix(ux): invalid explicit DNS ports are REJECTED, not silently defaulted

Deploy judge r1 (dc-prod-deploy-dns2-full, grade C) blocked on the
serialiser silently replacing an invalid explicit port (9090junk/0/-1/
70000) with the provider default — pointing the adapter at the wrong
service instead of reporting the user's typo. Now: empty field →
provider default (legitimate); invalid EXPLICIT value → buildDnsConfig
throws with an actionable message; the wizard surfaces it via
showNotification and aborts the save. Tests flipped to pin the
reject-not-fallback contract (throw + empty-field default preserved).
This commit is contained in:
Hermes committed 2026-11-19 13:21:25 -08:00
1 parent 9cff937e7c
commit 3d6856a795
5 files changed
+146 -129

No files matched your search

@@ -100,11 +100,12 @@ describe('wizard serialisation → adapter (real shared buildDnsConfig code)', (
['zero', '0'],
['negative', '-1'],
['out of range', '70000'],
])('invalid port %s normalizes to the provider default', (_label, badPort) => {
const dns = buildDnsConfig('powerdns', '192.0.2.30', badPort, 'k', 5380);
expect(dns.apiPort).toBe(8081);
const rfc = buildDnsConfig('rfc2136', '192.0.2.40', badPort, 'k', 5380);
expect(rfc.port).toBe(53);
])('an INVALID EXPLICIT port throws (never silently swapped for a default)', (_label, badPort) => {
expect(() => buildDnsConfig('powerdns', '192.0.2.30', badPort, 'k', 5380))
.toThrow(/Invalid port.*1 and 65535/);
// empty is still legitimate → provider default
const empty = buildDnsConfig('rfc2136', '192.0.2.40', '', 'k', 5380);
expect(empty.port).toBe(53);
});
});