octodns.record.svcb

Functions

parse_rdata_text_svcparamvalue_list(...)

svcparamkeysort(svcparamkey)

validate_list(svcparamkey, svcparamvalue)

validate_svckey_number(paramkey)

validate_svcparam_alpn(svcparamvalue)

validate_svcparam_ech(svcparamvalue)

validate_svcparam_iphint(ip_version, ...)

validate_svcparam_ipv4hint(svcparamvalue)

validate_svcparam_ipv6hint(svcparamvalue)

validate_svcparam_mandatory(svcparamvalue)

validate_svcparam_port(svcparamvalue)

Classes

SvcbRecord(zone, name, data[, source, context])

SvcbValue(value)

SvcbValueBestPracticeValidator(id[, sets])

Checks that the SVCB/HTTPS targetname field ends with a trailing . (fully-qualified name).

SvcbValueValidator(id[, sets])

Validates SVCB/HTTPS rdata per RFC 9460: svcpriority in [0, 65535], targetname is a valid FQDN, and each SvcParam is either a recognized key (validated by its per-key helper) or a properly-formed keyNNN number.

octodns.record.svcb.validate_svcparam_port(svcparamvalue)[source]
octodns.record.svcb.validate_list(svcparamkey, svcparamvalue)[source]
octodns.record.svcb.validate_svcparam_alpn(svcparamvalue)[source]
octodns.record.svcb.validate_svcparam_iphint(ip_version, svcparamvalue)[source]
octodns.record.svcb.validate_svcparam_ipv4hint(svcparamvalue)[source]
octodns.record.svcb.validate_svcparam_ipv6hint(svcparamvalue)[source]
octodns.record.svcb.validate_svcparam_mandatory(svcparamvalue)[source]
octodns.record.svcb.validate_svcparam_ech(svcparamvalue)[source]
octodns.record.svcb.validate_svckey_number(paramkey)[source]
octodns.record.svcb.parse_rdata_text_svcparamvalue_list(svcparamvalue)[source]
octodns.record.svcb.svcparamkeysort(svcparamkey)[source]
class octodns.record.svcb.SvcbValueValidator(id, sets=None)[source]

Bases: ValueValidator

Validates SVCB/HTTPS rdata per RFC 9460: svcpriority in [0, 65535], targetname is a valid FQDN, and each SvcParam is either a recognized key (validated by its per-key helper) or a properly-formed keyNNN number. Also rejects SvcParams on AliasMode (svcpriority == 0) records.

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.svcb._SvcbValueBase(value)[source]

Bases: EqualityTupleMixin, dict

classmethod _schema()[source]
classmethod parse_rdata_text(value)[source]
classmethod process(values)[source]
__init__(value)[source]
property svcpriority
property targetname
property svcparams
property rdata_text
template(params)[source]
_equality_tuple()[source]
__repr__()[source]

Return repr(self).

class octodns.record.svcb.SvcbValueBestPracticeValidator(id, sets=None)[source]

Bases: ValueValidator

Checks that the SVCB/HTTPS targetname field ends with a trailing . (fully-qualified name).

Enabled as part of the best-practice validator set:

manager:
  enabled:
    - best-practice
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.svcb.SvcbValue(value)[source]

Bases: _SvcbValueBase

VALIDATORS = [<octodns.record.svcb.SvcbValueValidator object>, <octodns.record.svcb.SvcbValueBestPracticeValidator object>]
class octodns.record.svcb.SvcbRecord(zone, name, data, source=None, context=None)[source]

Bases: ValuesMixin, Record

REFERENCES = ('https://datatracker.ietf.org/doc/html/rfc9460', 'https://datatracker.ietf.org/doc/html/rfc9461', 'https://datatracker.ietf.org/doc/html/rfc9462')
_type = 'SVCB'
_value_type

alias of SvcbValue