SaltDns. Knot. EdgeCatalog
(Salt v1.0.0)
The catalog zone that tells Salt DNS's own public edge which zones to serve:
every active zone of every organisation.
Knot lets a zone be a member of only one catalog (verified: catalog-zone
holds a single value, a second conf-set replaces the first), and each
active zone is already a member of its organisation's catalog. So this
catalog is not generated by Knot: Salt DNS writes it as an ordinary zone
(RFC 9432: version TXT "2", one <id>.zones.<catalog> PTR <zone>. per
member) and the edge consumes it with catalog-role: interpret. The edge's
configuration is static; new organisations and zones need no edge change.
Refreshes are triggered by zone creation, update (status) and deletion
(SaltDns.Knot.Sync.attach/0), coalesced for delay ms, and by every
periodic reconcile. The catalog's name is
config :salt_dns, SaltDns.Knot.EdgeCatalog, zone: "edge.catalog.invalid".
Summary
Functions
Returns a specification to start this module under a supervisor.
The records the catalog should hold for zone_names: the version and one
PTR per member. Pure.
The member id of a zone in the catalog: the first 40 hex digits of the SHA-256 of its name. RFC 9432 only asks for a label that is unique within the catalog; deriving it from the name keeps it stable across refreshes.
The changes that turn the catalog's actual records (as read from Knot)
into desired/2: removals of members and anything else catalog-shaped that
should not be there, then additions. The apex SOA and NS are Knot's and are
left alone. Pure.
Refreshes the catalog soon (coalesced) and returns at once. A no-op when
config :salt_dns, SaltDns.Knot.EdgeCatalog, auto: false (tests that use a
fake Knot); refresh_sync/0 always runs.
Refreshes the catalog now and waits.
The catalog zone's name.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec desired(String.t(), [String.t()]) :: [SaltDns.Zones.Change.t()]
The records the catalog should hold for zone_names: the version and one
PTR per member. Pure.
The member id of a zone in the catalog: the first 40 hex digits of the SHA-256 of its name. RFC 9432 only asks for a label that is unique within the catalog; deriving it from the name keeps it stable across refreshes.
@spec plan(String.t(), [SaltDns.Zones.Change.t()], [SaltDns.Zones.Change.t()]) :: [ SaltDns.Zones.Change.t() ]
The changes that turn the catalog's actual records (as read from Knot)
into desired/2: removals of members and anything else catalog-shaped that
should not be there, then additions. The apex SOA and NS are Knot's and are
left alone. Pure.
@spec refresh() :: :ok
Refreshes the catalog soon (coalesced) and returns at once. A no-op when
config :salt_dns, SaltDns.Knot.EdgeCatalog, auto: false (tests that use a
fake Knot); refresh_sync/0 always runs.
@spec refresh_sync() :: :ok | {:error, term()}
Refreshes the catalog now and waits.
@spec zone() :: String.t()
The catalog zone's name.