mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
* stash * Use rejectif idea * rename * wip! * Convert old systems to new * fixup! * fix typo
This commit is contained in:
@@ -2,41 +2,26 @@ package msdns
|
||||
|
||||
import (
|
||||
"github.com/StackExchange/dnscontrol/v3/models"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/recordaudit"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/rejectif"
|
||||
)
|
||||
|
||||
// AuditRecords returns an error if any records are not
|
||||
// supportable by this provider.
|
||||
func AuditRecords(records []*models.RecordConfig) error {
|
||||
// AuditRecords returns a list of errors corresponding to the records
|
||||
// that aren't supported by this provider. If all records are
|
||||
// supported, an empty list is returned.
|
||||
func AuditRecords(records []*models.RecordConfig) []error {
|
||||
a := rejectif.Auditor{}
|
||||
|
||||
if err := recordaudit.TxtNoMultipleStrings(records); err != nil {
|
||||
return err
|
||||
}
|
||||
// Still needed as of 2021-03-01
|
||||
a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2021-03-01
|
||||
|
||||
if err := recordaudit.TxtNoStringsLen256orLonger(records); err != nil {
|
||||
return err
|
||||
}
|
||||
a.Add("TXT", rejectif.TxtHasDoubleQuotes) // Last verified 2021-03-01
|
||||
|
||||
if err := recordaudit.TxtNotEmpty(records); err != nil {
|
||||
return err
|
||||
}
|
||||
// Still needed as of 2021-03-01
|
||||
a.Add("TXT", rejectif.TxtHasMultipleSegments) // Last verified 2021-03-01
|
||||
|
||||
if err := recordaudit.TxtNoBackticks(records); err != nil {
|
||||
return err
|
||||
}
|
||||
// Still needed as of 2021-03-01
|
||||
a.Add("TXT", rejectif.TxtHasSingleQuotes) // Last verified 2021-03-01
|
||||
|
||||
if err := recordaudit.TxtNoDoubleQuotes(records); err != nil {
|
||||
return err
|
||||
}
|
||||
// Still needed as of 2021-03-01
|
||||
a.Add("TXT", rejectif.TxtHasSegmentLen256orLonger)
|
||||
|
||||
if err := recordaudit.TxtNoSingleQuotes(records); err != nil {
|
||||
return err
|
||||
}
|
||||
// Still needed as of 2021-03-01
|
||||
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2021-03-01
|
||||
|
||||
return nil
|
||||
return a.Audit(records)
|
||||
}
|
||||
|
Reference in New Issue
Block a user