1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

GANDI: Add support for CAA rtype (#288)

* GANDI: Add support for CAA rtype
This commit is contained in:
Tom Limoncelli
2017-12-22 07:10:29 -05:00
committed by GitHub
parent 612001c5c1
commit a0f14e5981
4 changed files with 34 additions and 4 deletions

View File

@@ -443,6 +443,22 @@ func SplitCombinedSrvValue(s string) (priority, weight, port uint16, target stri
return uint16(priorityconv), uint16(weightconv), uint16(portconv), parts[3], nil
}
// CombineCAAs will merge the tags and flags into the target field for all CAA records.
// Useful for providers that desire them as one field.
func (dc *DomainConfig) CombineCAAs() {
for _, rec := range dc.Records {
if rec.Type == "CAA" {
if rec.CombinedTarget {
pm := strings.Join([]string{"CombineCAAs: Already collapsed: ", rec.Name, rec.Target}, " ")
panic(pm)
}
rec.Target = rec.Content()
fmt.Printf("DEBUG: NEW TARGET: %v\n", rec.Target)
rec.CombinedTarget = true
}
}
}
func SplitCombinedCaaValue(s string) (tag string, flag uint8, value string, err error) {
splitData := strings.SplitN(s, " ", 3)