Skip to main content

Module dns

Module dns 

Source
Expand description

DNS provider domain — the pleme/dns surface.

Provides the slash-named functions every lareira-dns-reconciler computeunit calls:

(dns/upsert :provider :route53 :zone-id Z :credentials C :record-type :CNAME :name “x.quero.lol” :value “lb…” :ttl 60 :proxied false) → {:status “ok” …} (dns/delete :provider … :zone-id … :credentials … :record-type … :name … :value … :ttl …) → {:status “ok” …} (dns/list :provider … :zone-id … :credentials …) → ((…) (…) …)

Two providers are wired end to end:

  • :cloudflare — REST over api.cloudflare.com/client/v4, Bearer token auth (creds key api-token / token). JSON wire format.
  • :route53ChangeResourceRecordSets / ListResourceRecordSets over route53.amazonaws.com, AWS SigV4 request signing (creds keys access-key-id + secret-access-key, optional session-token + region). XML wire format, built through a typed [ChangeBatch] Display impl — never format!()-of-XML.

:hetzner / :gcp are declared in the reconciler’s provider enum but return a typed unimplemented provider error here — never a silent wrong answer (org CLAUDE.md TYPED-SPEC rule).

§Testability

All network egress goes through the DnsTransport trait — the Environment seam from the org CLAUDE.md typed-spec-triplet rule. The production impl (UreqTransport) wraps the shared ureq::Agent; tests drive a [MockTransport] that records the request and returns a canned response, so every provider path + the SigV4 signer is unit tested with zero network. The signer is validated against AWS’s published GET-vanilla example vector.

Structs§

AmzDate
AWS request date in the two forms SigV4 needs: YYYYMMDD (scope) and YYYYMMDDTHHMMSSZ (x-amz-date). Built from a Unix timestamp with a pure civil-date conversion so it’s deterministic + test-vector-able.
ChangeRequest
Credentials
Provider-agnostic credentials, parsed from the :credentials map a computeunit gets from (k8s/read-secret …).
HttpRequest
HttpResponse
Outcome
Result returned to Lisp as a map.
Record
A single record returned by dns/list.
Sigv4
All inputs needed to sign one request. Pure — no IO — so it is unit tested against AWS’s published example vector.
UreqTransport
Production transport — borrows a clone of the script’s shared agent.

Enums§

Action
Method
Provider
RecordType

Traits§

DnsTransport
The single egress point every provider funnels through. Mockable in tests; the production impl is UreqTransport.

Functions§

install