DEV Community

caderaven6851
caderaven6851

Posted on

Healthtech Custom Domains: Copy or Write DNS (Control Before Operating Cost)

Default to showing records for customer-owned zones, and write records automatically only inside a platform-owned zone with an explicit change boundary. A healthtech portal should make that ownership decision before it offers a convenient connection button, because a request to connect one patient-facing hostname is a poor basis for granting authority over unrelated domain configuration.

Short answer: Show records to copy for customer-owned zones; offer scoped writes as an authorized alternative. Automate platform-owned zones within the same review and verification model. Treat operating cost as a consequence of the permission model, alongside support effort and review burden.

This decision record proposes a permission and evidence model for a healthtech product that lets a clinic point its own domain at a patient portal. It doesn't claim that a domain connection establishes any healthcare compliance property. The examples are design inputs, not accounts of a production deployment.

Should custom domain onboarding show records to copy or request write access?

The narrow request is to connect portal.clinic.example to a particular clinic's account. The broad authority might include changing other records in the clinic's zone. Those are different permissions, and the onboarding interface should explain their scope before asking for authorization. A progress bar cannot answer who may change a record or which unrelated configuration must survive.

Scope comes first.

Use two separate fields in the connection model: who owns the zone, and who is authorized to perform this particular change. A customer-owned zone can still have an authorized automation path; a platform-owned zone can still require an approval. Ownership sets the default workflow, while a recorded grant determines whether a particular write is allowed. The proposal deliberately avoids inferring either field from a hostname suffix or from a user having reached the onboarding screen.

The distinction matters around mail configuration. RFC 7489 defines DMARC policy discovery using DNS TXT records under the _dmarc name, and its policy record includes a version tag, v=DMARC1, and a policy tag, p. A portal connection doesn't need to edit that policy. Showing an operator the whole zone and asking them to replace it would give this onboarding task a needlessly large change boundary. Preserve unrelated mail configuration as an invariant, rather than treating it as an incidental detail of a DNS editor.

This is a change-authorization decision. It should remain understandable even if the record-writing implementation changes.

Invariants and failure boundaries

The proposed design has three invariants: each requested hostname belongs to one intended tenant connection; each mutation is constrained to an approved record set; and the interface distinguishes a submitted change from a verified connection. These are application requirements, not guarantees supplied by the presence of DNS records.

For the worked example, the proposed request contains the tenant identifier clinic-042, the hostname portal.clinic.example, and a connection identifier connection-017. Keep those identifiers in the change record. Don't put patient identifiers or medical information into the example's DNS values or diagnostic messages. Onboarding support needs to investigate a connection, not a patient's care.

Name the failures precisely. An authorization failure means the actor cannot make the requested change. A record conflict means the proposed change collides with existing configuration that needs review. Verification pending means the connection has not yet met the application's acceptance conditions. A tenant-binding conflict means the hostname is already associated with a different account in the application's connection registry. Combining these into a single red error would hide the next useful action.

The verification boundary deserves particular care. Under this proposal, a successful write response records only that the mutation was accepted by the writer. Marking the portal ready requires a separate check of the expected DNS configuration, the hostname's binding to the intended tenant, and the application's secure endpoint. The specific endpoint checks belong in the product's deployment contract; this note doesn't invent a universal DNS value or certificate issuance deadline.

No fixed wait qualifies.

DMARC's scope also has a limit worth keeping visible: RFC 7489 describes email authentication policy and reporting. It is evidence for protecting mail-related configuration during this workflow, not a specification for web-domain ownership verification, tenant routing, or portal readiness. Those controls need their own explicit application requirements.

Compare the authority each workflow consumes

The relevant comparison is between permission models. Both copying records and writing them can fit a controlled process; neither button label proves that the process has one.

Workflow Appropriate default Required evidence in this design Accepted trade-off
Show records to copy Customer-owned zone Named recipient, exact requested records, and subsequent verification Customer coordination remains part of the critical path
Write with a scoped customer grant Customer-owned zone with explicit authorization Grant tied to the connection and approved record set Less manual entry, with additional grant management and review work
Write within platform authority Platform-owned zone Internal authorization and the same record-level change evidence Fewer customer actions, with operational responsibility retained by the platform

For the clinic portal, the first row is the default. The interface should show the requested name, type, and value as separately copyable fields, identify the domain administrator who must act, and keep a verification action available after the user leaves and returns. Avoid making a customer repeat authorization just to read the instructions again.

The second row is a deliberate exception with a concrete precondition: the available integration must actually support the scope the application promises. If its permission boundary is wider than the approved change, don't describe it as record-scoped access. Keep the copy workflow available. That is a limit of the proposed authorization model, independent of which implementation supplies the writer.

Operating cost remains relevant, but it follows the decision. Budget for instruction maintenance, customer handoffs, grant review, verification work, and support investigation. Automated writes add responsibilities around authorization and mutation evidence; copied records retain a human coordination step. This note assigns no prices or savings percentages because it has no measured workload from which to derive them.

Put the policy gate before the writer

The critical path below is executable Python for the workflow-selection rule. It deliberately stops before any DNS operation: the record writer and verifier must implement the change and acceptance contracts described above. A boolean here represents the result of an authorization check, not a replacement for that check.

from dataclasses import dataclass
from enum import Enum


class ZoneOwner(Enum):
    CUSTOMER = "customer"
    PLATFORM = "platform"


class Workflow(Enum):
    SHOW_RECORDS = "show_records"
    WRITE_APPROVED_RECORDS = "write_approved_records"


@dataclass(frozen=True)
class ConnectionRequest:
    tenant_id: str
    connection_id: str
    hostname: str
    zone_owner: ZoneOwner
    customer_grant_covers_change: bool = False
    platform_authorization_covers_change: bool = False


def select_workflow(request: ConnectionRequest) -> Workflow:
    if request.zone_owner is ZoneOwner.CUSTOMER:
        if request.customer_grant_covers_change:
            return Workflow.WRITE_APPROVED_RECORDS
        return Workflow.SHOW_RECORDS

    if request.zone_owner is ZoneOwner.PLATFORM:
        if not request.platform_authorization_covers_change:
            raise PermissionError(
                "Platform change requires authorization")
        return Workflow.WRITE_APPROVED_RECORDS

    raise ValueError("Unknown zone owner")


request = ConnectionRequest(
    tenant_id="clinic-042",
    connection_id="connection-017",
    hostname="portal.clinic.example",
    zone_owner=ZoneOwner.CUSTOMER,
)
assert select_workflow(request) is Workflow.SHOW_RECORDS
Enter fullscreen mode Exit fullscreen mode

The useful property is the default: an ungranted customer request produces instructions. A platform-owned request without internal authorization stops.

Permission isn't implied.

Neither case silently expands permission in order to make onboarding appear complete. The trade-off is deliberate: retain a customer handoff rather than accept a write whose authority cannot be demonstrated. For connection-017, a grant covering another clinic's connection must leave the request in the instruction workflow, even if both clinics use the same domain administrator; the proposed rule binds authority to the approved change, not to the apparent convenience of a shared operator. This is a policy example, not a claim about an observed customer incident.

Before deploying this policy, test the decision boundary with absent authorization, a grant for another connection, a changed requested record set, and an existing hostname binding to another tenant. The latter three checks belong upstream of this small function, where the grant and connection registry are evaluated. Passing a boolean supplied directly by the browser would defeat the boundary.

Then test the write and verification stages independently. In the proposed workflow, a timeout leaves the result unresolved until reconciliation reads the relevant state; it must not automatically trigger a broader replacement operation. If the requested records change after approval, require a fresh scope check. Preserve the previous approved state so a rollback can be reviewed against subsequent changes rather than blindly restoring an entire zone snapshot.

Observability should follow that same separation. Record workflow selection, authorization rejection, mutation submission, and verification outcome against the connection identifier. Present the customer with an action appropriate to that state: contact the domain administrator, review a conflict, or retry verification. Measure time spent waiting for customer action separately from time spent awaiting application verification; a single onboarding-duration metric cannot show which part needs attention.

Rejected default and its valid use case

Reject automatic writing to every customer zone as the default. It asks the product to establish a trustworthy authorization boundary before it can honor a narrow hostname request, and any integration unable to enforce that boundary would force the interface to promise more control than the implementation provides. A shorter form is insufficient justification.

Automatic writing remains a valid choice when the customer explicitly grants the required scope and the system can enforce it, or when the platform owns the zone and authorizes the change internally. In both cases, retain the same evidence and independent verification requirements.

For a healthtech portal, the durable decision rule is therefore ownership first, explicit authority second, verified readiness last. Show records when the customer retains the change responsibility. Write them when the approved authority covers the exact change. Keep operating cost in the review, while preserving that order.

References

Top comments (0)