#
#
#
from .base import Record
from .chunked import _ChunkedValue, _ChunkedValuesMixin
from .validator import RecordValidator
[docs]
class SpfRecordTypeValidator(RecordValidator):
'''
Validates that the deprecated SPF record type is not used.
'''
[docs]
def validate(self, record_cls, name, fqdn, data):
return [
'The SPF record type is DEPRECATED in favor of TXT values and will become an ValidationError in 2.0'
]
[docs]
class SpfRecord(_ChunkedValuesMixin, Record):
REFERENCES = ('https://datatracker.ietf.org/doc/html/rfc7208',)
_type = 'SPF'
_value_type = _ChunkedValue
VALIDATORS = [SpfRecordTypeValidator('spf-record-type', sets={'strict'})]
Record.register_type(SpfRecord)