From 2e8589e4cee46737c6aa5001c307b577ac69525f Mon Sep 17 00:00:00 2001 From: Robert Koch Date: Mon, 13 May 2019 11:57:14 +0800 Subject: [PATCH] Added DS for cloudflare provider with tests --- integrationTest/integration_test.go | 6 +++--- providers/cloudflare/cloudflareProvider.go | 2 +- providers/cloudflare/rest.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/integrationTest/integration_test.go b/integrationTest/integration_test.go index 929ca9b5f..7cb8d19bf 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/providers/cloudflare/cloudflareProvider.go b/providers/cloudflare/cloudflareProvider.go index abe307fab..359dc9bbe 100644 --- a/providers/cloudflare/cloudflareProvider.go +++ b/providers/cloudflare/cloudflareProvider.go @@ -474,7 +474,7 @@ type cfRecData struct { Selector uint8 `json:"selector"` // TLSA Matching_Type uint8 `json:"matching_type"` // TLSA Certificate string `json:"certificate"` // TLSA - Algorithm uint8 `json:"algorithm"` // SSHFP/DS + Algorithm uint8 `json:"algorithm"` // SSHFP or DS Hash_Type uint8 `json:"type"` // SSHFP Fingerprint string `json:"fingerprint"` // SSHFP KeyTag uint16 `json:"key_tag"` // DS diff --git a/providers/cloudflare/rest.go b/providers/cloudflare/rest.go index 09b243b6d..9caaf2149 100644 --- a/providers/cloudflare/rest.go +++ b/providers/cloudflare/rest.go @@ -222,6 +222,7 @@ func (c *CloudflareApi) createRec(rec *models.RecordConfig, domainID string) []* cf.Name = rec.GetLabelFQDN() } else if rec.Type == "DS" { cf.Data = cfDSData(rec) + cf.Content = "" } endpoint := fmt.Sprintf(recordsURL, domainID) buf := &bytes.Buffer{}