From c0354a585d39b84116e1bec514a2dc0c08399c86 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Sat, 30 May 2020 10:50:03 -0400 Subject: [PATCH] DS: More cleanups --- docs/_includes/matrix.html | 18 ++++++++++++++++++ integrationTest/integration_test.go | 6 +++--- pkg/normalize/validate.go | 6 ++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/_includes/matrix.html b/docs/_includes/matrix.html index 0d57882e9..869457694 100644 --- a/docs/_includes/matrix.html +++ b/docs/_includes/matrix.html @@ -813,6 +813,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/integrationTest/integration_test.go b/integrationTest/integration_test.go index 7cb8d19bf..929ca9b5f 100644 --- a/integrationTest/integration_test.go +++ b/integrationTest/integration_test.go @@ -373,11 +373,11 @@ func naptr(name string, order uint16, preference uint16, flags string, service s return r } -func ds(name string, keyTag uint16, algorithm, digestType uint8, digest string) *rec { +func ds(name string, keytag uint16, algorithm, digesttype uint8, digest string) *rec { r := makeRec(name, "", "DS") - r.DsKeyTag = keyTag + r.DsKeyTag = keytag r.DsAlgorithm = algorithm - r.DsDigestType = digestType + r.DsDigestType = digesttype r.DsDigest = digest return r } diff --git a/pkg/normalize/validate.go b/pkg/normalize/validate.go index 474f52be5..54c3e842a 100644 --- a/pkg/normalize/validate.go +++ b/pkg/normalize/validate.go @@ -169,6 +169,8 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) { if label == "@" { check(fmt.Errorf("cannot create CNAME record for bare domain")) } + case "DS": + check(checkTarget(target)) case "MX": check(checkTarget(target)) case "NS": @@ -186,7 +188,7 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) { check(checkTarget(target)) case "SRV": check(checkTarget(target)) - case "TXT", "IMPORT_TRANSFORM", "CAA", "SSHFP", "TLSA", "DS": + case "TXT", "IMPORT_TRANSFORM", "CAA", "SSHFP", "TLSA": default: if rec.Metadata["orig_custom_type"] != "" { // it is a valid custom type. We perform no validation on target @@ -316,7 +318,7 @@ func ValidateAndNormalizeConfig(config *models.DNSConfig) (errs []error) { } // Canonicalize Targets. - if rec.Type == "CNAME" || rec.Type == "MX" || rec.Type == "NAPTR" || rec.Type == "NS" || rec.Type == "SRV" { + if rec.Type == "CNAME" || rec.Type == "DS" || rec.Type == "MX" || rec.Type == "NAPTR" || rec.Type == "NS" || rec.Type == "SRV" { // #rtype_variations // These record types have a target that is a hostname. // We normalize them to a FQDN so there is less variation to handle. If a