octodns.record.spf
Classes
|
|
|
Validates that the deprecated SPF record type is not used. |
- class octodns.record.spf.SpfRecordTypeValidator(id, sets=None)[source]
Bases:
RecordValidatorValidates that the deprecated SPF record type is not used.
- validate(record_cls, name, fqdn, data, disabled=None)[source]
Validate a record’s non-value attributes.
- Parameters:
record_cls (type) – The concrete
Recordsubclass being validated. Validators that need access to record class-level attributes (e.g._type,_value_type) should read them fromrecord_cls. Per-instance configuration should live onself, not onrecord_cls.name (str) – The record’s name relative to its zone (
''for the zone root). Alreadyidna_encode’d.fqdn (str) – The record’s fully-qualified domain name (
name+ zone name).data (dict) – The raw record config dict (as loaded from YAML/JSON) including
ttl,type,value/values, and any type-specific fields likedynamic,geo, oroctodns.disabled (dict or None) – The zone’s per-type map of disabled validator ids (
record_cls ._typeor'*'-> set of ids), as configured via the zone’svalidators.record.disable_validators. Most validators can ignore this; it only matters to validators that themselves dispatch to other validators (e.g. value-type bridges,geoanddynamicvalidators), which must forward it along so the disabled ids are honored down the chain.
- Returns:
A list of
ValidationReasonobjects describing validation failures — construct each withValidationReason(reason, validator_id=self.id). Must return an empty list when the record is valid. Reasons from multiple validators are concatenated by the caller, so each reason must stand alone without context from the others. Returning barestrreasons is DEPRECATED — the registry wraps them inValidationReasonand emits a deprecation warning; support will be removed in 2.0.- Return type:
Notes
Implementations must not raise on invalid input — all failures are reported via the returned list. Reason text is surfaced verbatim in
ValidationErrormessages, so phrasing and punctuation should be stable across releases.Third-party validators that predate the
disabledparameter and implementvalidate(self, record_cls, name, fqdn, data)continue to work: the caller detects theTypeErrorand falls back to calling without it, emitting a deprecation warning. Support for the parameter-less form will be removed in 2.0.
- class octodns.record.spf.SpfRecord(zone, name, data, source=None, context=None)[source]
Bases:
_ChunkedValuesMixin,Record- REFERENCES = ('https://datatracker.ietf.org/doc/html/rfc7208',)
- _type = 'SPF'
- _value_type
alias of
_ChunkedValue
- VALIDATORS = [<octodns.record.spf.SpfRecordTypeValidator object>]