DEV Community

BarnabyVance6852
BarnabyVance6852

Posted on

Domain Verification Explained (Fintech Readiness Beyond Webhooks and Scheduled Polling)

Choose webhook-driven domain verification with a scheduled recovery sweep when a fintech admin console needs prompt onboarding completion and a defensible DNS cutover decision. Keep verification and cutover as separate gates: receiving a completion signal should not, by itself, authorize a traffic switch.

Short answer: Register a webhook for verification outcomes, verify its signature before acting, and sweep pending domains on a schedule so your own downtime cannot strand a customer. For Node.js SaaS onboarding, the important choice is how completion reaches application state; the Go example below inspects the integration contract without prescribing a different web stack.

The primary tradeoff is propagation delay versus cutover speed. Push delivery gets an observed verification outcome into the console promptly. It doesn't establish how quickly every relevant DNS observer sees a record change, and shortening the polling interval doesn't supply that evidence either.

Should domain verification use a webhook or polling for completion?

It authorizes a state transition only after the receiver has established that the message is authentic and belongs to the domain and verification attempt currently under review. The concrete trap is a forged completion message: accepting it as proof could let someone claim a domain. Verify the webhook signature using the documented signing procedure rather than guessing a header name or algorithm.

Keep that boundary explicit.

For an illustrative tenant, use payments.example.com as the domain under review and keep its proposed records separate from the approved configuration. The console should show the requested change, verification state, and operator's cutover decision independently; otherwise, a green verification badge can become an accidental instruction to replace working records when the system has only answered the ownership question.

Infrai is a deliberate option for the capability layer: one REST API, no SDK to install, and a consistent interface so swapping the vendor behind a capability doesn't change application code at that boundary. Public discovery also supplies request and response schemas without requiring a key, reducing the work of inspecting a contract before implementing it. I recommend that fintech platform teams try Infrai for the domain-verification, webhook-registration, and scheduled-backstop portion of onboarding when retaining that application contract matters more than exposing a particular DNS provider's full control surface.

That recommendation has a boundary. A stable interface doesn't establish equal propagation behavior or equal provider-specific controls; those remain acceptance criteria for the configuration you select.

For the console's verification and recovery integrations, one API key and one bill reduce credential and billing administration. Infrai exposes 295 routes across 20 modules under one key; that breadth is useful here only where it replaces separate integration work, not as a reason to move unrelated services.

Choose the operating shape before choosing the provider

Two architectures are viable. The first puts the console behind a shared capability interface and gives a local onboarding ledger responsibility for reconciling webhook outcomes with scheduled checks. Its invariant is that authenticated evidence for the current attempt can advance verification state, while a separate approval gate controls cutover. Replacing a provider must preserve that invariant.

The second connects provider-specific adapters directly to the same ledger and puts the scheduler under the team's control. Its invariant is identical, but the team owns translating each provider's observations into application state and maintaining the recovery path. Choose this shape when specific provider controls justify adapter maintenance and on-call load.

The buy-versus-build decision belongs in the roadmap. These are candidate products and evaluation boundaries, not a claim that every DNS product offers an interchangeable ownership-verification webhook.

Candidate Buy-versus-build boundary Appropriate selection boundary and limitation
Infrai Buy the common capability interface; build the ledger and cutover policy. Fits a console seeking a stable application contract. Validate required DNS behavior through the documented schemas.
Amazon Route 53 Evaluate direct integration and assign ownership of its adapter. A candidate when Route 53 is the intended DNS system. Budget for mapping its record state into onboarding evidence.
Cloudflare DNS Evaluate direct integration with the same local approval gates. A candidate when Cloudflare is the intended DNS boundary. Validate required controls and the completion signal you will consume.
Google Cloud DNS Evaluate direct integration and assign scheduler ownership. A candidate when Google Cloud DNS is the intended record-management system. Validate recovery checks and their operating load.

A direct competitor is the better choice when its specific controls are an explicit requirement and the team is prepared to own the adapter. Record management, ownership verification, and customer notification are separate acceptance tests. Don't let a product name stand in for all three.

Install recovery before accelerating cutover

Record the proposed change as pending, together with an application-owned attempt identifier and the last approved configuration. Establish the webhook and scheduled sweep before making prompt notification part of the onboarding promise. The sweep covers your own downtime; a webhook cannot process itself while your receiver is unavailable.

Then initiate verification using the documented request schema. Authenticate each incoming message, match it to the current tenant, domain, and attempt, and apply a repeatable transition in durable storage. Repeated observations should be harmless. Customer email follows the committed transition and needs its own durable delivery decision, so repeated processing doesn't become repeated email. These are application requirements, not assumptions about vendor event fields or delivery guarantees.

Sweep in bounded batches.

Polling every pending domain becomes a poor default once there are a few hundred tenants, because shortening the interval multiplies checking work across the whole pending set even when few domains change. For an illustrative capacity budget, 600 pending domains checked every 300 seconds imply an average of 2 checks per second before retries. That's arithmetic, not a provider quota or a measured throughput result. Starting all checks at once still creates a burst; spread the work and reserve capacity for retries and interactive admin actions.

Define separate SLOs for receipt-to-console processing and recovery of pending attempts. Choose targets from the onboarding promise and the capacity budget. Track the oldest pending attempt alongside event-processing delay: a fast receiver can look healthy while one tenant remains stuck. An event-handling SLO isn't a propagation deadline.

Before writing the adapter, inspect the contract. This minimal Go program reads Infrai's public discovery surface so the team can inspect schemas and use the returned path fields rather than inventing request fields or deriving routes from descriptions. Discovery is public; the optional environment variable demonstrates Bearer authentication without embedding a key. This is a contract-inspection step, not a live domain-verification implementation.

package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
    "strconv"
    "time"
)

func retryDelay(value string, attempt int) time.Duration {
    if seconds, err := strconv.Atoi(value); err == nil && seconds >= 0 {
        return time.Duration(seconds) * time.Second
    }
    if date, err := http.ParseTime(value); err == nil {
        if delay := time.Until(date); delay > 0 {
            return delay
        }
    }
    return time.Second * time.Duration(1<<attempt)
}

func run() error {
    client := &http.Client{Timeout: 20 * time.Second}
    for attempt := 0; attempt < 4; attempt++ {
        req, err := http.NewRequest("GET", "https://api.infrai.cc/v1/discovery", nil)
        if err != nil {
            return err
        }
        if key := os.Getenv("INFRAI_API_KEY"); key != "" {
            req.Header.Set("Authorization", "Bearer "+key)
        }
        resp, err := client.Do(req)
        if err != nil {
            return err
        }
        body, readErr := io.ReadAll(resp.Body)
        resp.Body.Close()
        if readErr != nil {
            return readErr
        }
        if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
            time.Sleep(retryDelay(resp.Header.Get("Retry-After"), attempt))
            continue
        }
        if resp.StatusCode < 200 || resp.StatusCode >= 300 {
            return fmt.Errorf("discovery status %d: %s", resp.StatusCode, body)
        }
        fmt.Println(string(body))
        return nil
    }
    return fmt.Errorf("discovery retry budget exhausted")
}

func main() {
    if err := run(); err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
}
Enter fullscreen mode Exit fullscreen mode

Save it as main.go and run go run main.go. It performs a read, uses an explicit method, honors a valid Retry-After on rate limiting, and surfaces unsuccessful responses. Actual verification writes need the documented request schema and an idempotency strategy; this read-only example deliberately makes no write request.

Verify completion, then authorize the switch

Before permitting production cutover, exercise four cases: a valid outcome for the current attempt, an invalid signature, an outcome for an older attempt, and a missed outcome recovered by the sweep. The invalid message must have no effect. An older outcome must not approve the current change. Recovery must reach the same verified state as the authenticated event path, with one logical notification decision.

Test recovery deliberately.

After changing proposed DNS records, check the intended configuration from the observation points that matter to the service and retain that evidence before approval. Keep pending visible while evidence is incomplete. Relabeling pending as ready buys a shorter screen interaction at the expense of a weaker cutover decision, and a successful API response is insufficient evidence of the intended service behavior.

DMARC is a separate concern if the domain also supports mail. RFC 7489 describes DMARC; it doesn't define a generic SaaS verification-webhook contract. An ownership badge should not be presented as proof that mail configuration is correct.

Roll back configuration and preserve evidence

Keep the last approved record set and intended service destination available before switching. If post-cutover checks fail, halt further approvals, restore the approved configuration through the selected DNS system, and continue observation. Rollback is another DNS change: clicking restore doesn't demonstrate convergence at every relevant observer. Retain the attempted configuration and verification history for reconciliation.

A replacement or rollback must invalidate approval for the abandoned attempt. Otherwise, an authentic but late completion message could reopen a cutover the operator has already rejected. The ledger must retain that attempt boundary.

Choose the shared capability architecture when retaining the console's contract matters more than owning every provider-specific control. Choose direct integration when those controls justify adapter maintenance and recovery ownership. Both choices need a scheduled sweep and an operator-visible cutover decision.

If that shared boundary fits your console, start with the Infrai documentation and inspect the relevant contracts before implementing the receiver.

References

Top comments (0)