DomainConnect.Config (DomainConnect v0.5.0)

Copy Markdown View Source

The Domain Connect settings discovered for a domain's DNS provider.

Returned by DomainConnect.discover/2. Mirrors the JSON the DNS provider serves at https://<api-host>/v2/<domain>/settings, plus the resolved zone (:domain) and the sub-host (:host) split out from the queried name.

Fields

  • :domain — the zone the _domainconnect TXT record was found at (e.g. "theirplace.com"). This is what goes in the domain apply parameter.
  • :host — the labels below the zone in the queried name (e.g. "rent" for rent.theirplace.com), or nil for an apex query. This becomes the host apply parameter.
  • :provider_id / :provider_name / :provider_display_name — the DNS provider identity.
  • :url_sync_ux — base URL for the synchronous apply UX (redirect the user here; see DomainConnect.apply_url/2).
  • :url_async_ux — base URL for the asynchronous OAuth consent UX.
  • :url_api — base URL for the provider's Domain Connect API (OAuth token exchange + programmatic apply).
  • :url_control_panel — optional deep link to the provider's DNS control panel (a manual fallback).
  • :nameservers — the provider's nameservers, when advertised.
  • :width / :height — suggested popup dimensions for the apply UX.
  • :raw — the full decoded settings map, for fields not lifted above.

Summary

Functions

Whether this provider advertised an asynchronous (OAuth) flow.

Builds a Config from the decoded /settings JSON map for domain (the zone) and host (the sub-host, or nil).

Whether this provider advertised a synchronous apply UX.

Types

t()

@type t() :: %DomainConnect.Config{
  domain: String.t(),
  height: integer() | nil,
  host: String.t() | nil,
  nameservers: [String.t()],
  provider_display_name: String.t() | nil,
  provider_id: String.t() | nil,
  provider_name: String.t() | nil,
  raw: map(),
  url_api: String.t() | nil,
  url_async_ux: String.t() | nil,
  url_control_panel: String.t() | nil,
  url_sync_ux: String.t() | nil,
  width: integer() | nil
}

Functions

async_supported?(config)

@spec async_supported?(t()) :: boolean()

Whether this provider advertised an asynchronous (OAuth) flow.

from_settings(settings, domain, host)

@spec from_settings(map(), String.t(), String.t() | nil) :: t()

Builds a Config from the decoded /settings JSON map for domain (the zone) and host (the sub-host, or nil).

sync_supported?(config)

@spec sync_supported?(t()) :: boolean()

Whether this provider advertised a synchronous apply UX.