mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-11-14 12:15:06 +08:00
58a5a4bcf0
All functions in should test for only one condition. There already is a function that tests for long TXT records: TxtNoLongStrings. Add calls to TxtNoLongStrings in all providers that use TxtNoMultipleStrings, to keep functionality, except for NS1 and ClouDNS, which allow for any TXT record length, but not for multiple strings per TXT.
47 lines
1 KiB
Go
47 lines
1 KiB
Go
package msdns
|
|
|
|
import (
|
|
"github.com/StackExchange/dnscontrol/v3/models"
|
|
"github.com/StackExchange/dnscontrol/v3/pkg/recordaudit"
|
|
)
|
|
|
|
// AuditRecords returns an error if any records are not
|
|
// supportable by this provider.
|
|
func AuditRecords(records []*models.RecordConfig) error {
|
|
|
|
if err := recordaudit.TxtNoMultipleStrings(records); err != nil {
|
|
return err
|
|
}
|
|
// Still needed as of 2021-03-01
|
|
|
|
if err := recordaudit.TxtNoLongStrings(records); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := recordaudit.TxtNotEmpty(records); err != nil {
|
|
return err
|
|
}
|
|
// Still needed as of 2021-03-01
|
|
|
|
if err := recordaudit.TxtNoBackticks(records); err != nil {
|
|
return err
|
|
}
|
|
// Still needed as of 2021-03-01
|
|
|
|
if err := recordaudit.TxtNoDoubleQuotes(records); err != nil {
|
|
return err
|
|
}
|
|
// Still needed as of 2021-03-01
|
|
|
|
if err := recordaudit.TxtNoSingleQuotes(records); err != nil {
|
|
return err
|
|
}
|
|
// Still needed as of 2021-03-01
|
|
|
|
if err := recordaudit.TxtNoLen255(records); err != nil {
|
|
return err
|
|
}
|
|
// Still needed as of 2021-03-01
|
|
|
|
return nil
|
|
}
|