mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Re-engineer TXT records for simplicity and better compliance (#1063)
TXT records are now handled different. 1. The raw input from dnsconfig.js is passed all the way to the provider. The provider can determine if it can or can't handle such records (auditrecords.go) and processes them internally as such. 2. The CanUseTXTMulti capability is no longer needed. * DSPs now register a table of functions * Use audits for txt record variations * unit tests pass. integration fails. * fix deepcopy problem * rename to AuditRecordSupport * Reduce use of TXTMulti * Remove CanUseTXTMulti * fix Test Skip * fix DO * fix vultr * fix NDC * msdns fixes * Fix powerdns and cloudflare * HEDNS: Fix usage of target field to resolve TXT handling (#1067) * Fix HEXONET Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net> Co-authored-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
@@ -23,9 +23,6 @@ so that it is easy to do things the right way in preparation.
|
||||
// GetTargetField returns the target. There may be other fields (for example
|
||||
// an MX record also has a .MxPreference field.
|
||||
func (rc *RecordConfig) GetTargetField() string {
|
||||
if rc.HasFormatIdenticalToTXT() {
|
||||
return strings.Join(rc.TxtStrings, "")
|
||||
}
|
||||
return rc.target
|
||||
}
|
||||
|
||||
@@ -66,6 +63,11 @@ func (rc *RecordConfig) GetTargetCombined() string {
|
||||
}
|
||||
}
|
||||
|
||||
return rc.zoneFileQuoted()
|
||||
}
|
||||
|
||||
// zoneFileQuoted returns the rData as would be quoted in a zonefile.
|
||||
func (rc *RecordConfig) zoneFileQuoted() string {
|
||||
// We cheat by converting to a dns.RR and use the String() function.
|
||||
// This combines all the data for us, and even does proper quoting.
|
||||
// Sadly String() always includes a header, which we must strip out.
|
||||
|
Reference in New Issue
Block a user