SaltDns.Auth.Presets (Salt v1.0.0)

Ready-made, validated grant sets for common clients.

Both presets return {:ok, grants} or {:error, reason} (the names come from user input); the ! variants raise ArgumentError.

Every preset also lets the client read SOA and NS at the apex, which is how ACME clients and DNS-update tools find the zone. Because :update implies :read, the writable names are also readable for their types.

Summary

Functions

ACME DNS-01: TXT update on _acme-challenge.<n> for each relative name n ("@" gives _acme-challenge), plus read of apex SOA and NS. Nothing else. Wildcard certificates for *.example.com use the name "@".

Like acme/2, raising ArgumentError on invalid input.

Mail platform (DKIM, MTA-STS, TLS-RPT, BIMI, Karta's ownership record and its inventory record, and mail-client discovery)

Like mail/2, raising ArgumentError on invalid input.

Functions

acme(zone, relative_names)

@spec acme(String.t(), [String.t()]) ::
  {:ok, [SaltDns.Auth.Grants.grant()]} | {:error, term()}

ACME DNS-01: TXT update on _acme-challenge.<n> for each relative name n ("@" gives _acme-challenge), plus read of apex SOA and NS. Nothing else. Wildcard certificates for *.example.com use the name "@".

acme!(zone, relative_names)

@spec acme!(String.t(), [String.t()]) :: [SaltDns.Auth.Grants.grant()]

Like acme/2, raising ArgumentError on invalid input.

mail(zone, opts \\ [])

@spec mail(String.t(), keyword()) ::
  {:ok, [SaltDns.Auth.Grants.grant()]} | {:error, term()}

Mail platform (DKIM, MTA-STS, TLS-RPT, BIMI, Karta's ownership record and its inventory record, and mail-client discovery):

  • TXT update on *._domainkey, _mta-sts, _smtp._tls, default._bimi and _karta (the ownership record Karta publishes first), for the zone apex, and on _karta-records (Karta's inventory, always at the zone itself);
  • TXT update on _caldavs._tcp and _carddavs._tcp;
  • SRV update on _imaps._tcp, _imap._tcp, _pop3s._tcp, _submission._tcp, _submissions._tcp, _caldavs._tcp, _carddavs._tcp and _autodiscover._tcp;
  • CNAME, A and AAAA update on autoconfig and autodiscover;
  • CNAME update on opts[:cname_names] (default ["mta-sts"], the MTA-STS policy host);
  • read of apex SOA and NS.

Option :domains (default ["@"]) names the sending domains that live in the zone, relative to it: ["@", "mail"] covers example.com and mail.example.com. Each gets the TXT, SRV and client-host names above under it, and, when :cname_names is not given, its mta-sts policy host as CNAME. The tracking host's name (a CNAME Karta publishes) is not predictable: pass it in :cname_names.

mail!(zone, opts \\ [])

@spec mail!(String.t(), keyword()) :: [SaltDns.Auth.Grants.grant()]

Like mail/2, raising ArgumentError on invalid input.