octodns.record.chunked

Classes

ChunkedValueValidator(id[, sets])

Validates values for TXT/SPF-style chunked strings: present, ASCII-only, with no unescaped or double-escaped ; characters.

class octodns.record.chunked.ChunkedValueValidator(id, sets=None)[source]

Bases: ValueValidator

Validates values for TXT/SPF-style chunked strings: present, ASCII-only, with no unescaped or double-escaped ; characters.

_unescaped_semicolon_re = re.compile('\\w;')
_double_escaped_semicolon_re = re.compile('\\\\\\\\;')
validate(value_cls, data, _type)[source]

Validate a record’s rdata values.

Parameters:
  • value_cls (type) – The concrete value class being validated (e.g. MxValue, _Ipv4Value). Validators that need access to value class-level attributes (e.g. VALID_ALGORITHMS, _address_type) should read them from value_cls. Per-instance configuration should live on self, not on value_cls.

  • data (list | tuple | str | dict) – The rdata to validate. For multi-value record types this is a list/tuple of value dicts or strings; for single-value types it may be a bare value. Most validators iterate data directly — when a validator needs to accept either form it should normalize with if not isinstance(data, (list, tuple)): data = (data,).

  • _type (str) – The record type string (e.g. 'MX', 'A'). Passed through to helpers like _check_target_format which format it into their reason strings.

Returns:

A list of human-readable reason strings describing validation failures. Must return an empty list when the values are valid. Reasons from multiple validators are concatenated by the caller, so each reason must stand alone without context from the others.

Return type:

list[str]

Notes

Implementations must not raise on invalid input — all failures are reported via the returned list. Reason strings are surfaced verbatim in ValidationError messages, so phrasing and punctuation should be stable across releases.

class octodns.record.chunked._ChunkedValuesMixin(zone, name, data, source=None, context=None)[source]

Bases: ValuesMixin

CHUNK_SIZE = 255
chunked_value(value)[source]
property chunked_values
property rr_values
class octodns.record.chunked._ChunkedValue[source]

Bases: str

VALIDATORS = [<octodns.record.chunked.ChunkedValueValidator object>]
classmethod parse_rdata_text(value)[source]
classmethod _schema()[source]
classmethod process(values)[source]
property rdata_text
template(params)[source]