Skip to main content

Module domain

Module domain 

Source
Expand description

Domain validation (since the namespace-validation step): a namespace host is valid when https://<host>/.well-known/datumesh.json fetches and passes the key-document rules (SPEC 9.2, 9.3: datumesh_core::key_document_from_response, declarations included).

Validator::validate checks one host and records the outcome in the store:

  • valid: the document is recorded with put_namespace (so validated_at moves forward and a rotation, SPEC 9.5, replaces the stored key document through the store’s normal path), then Store::record_namespace_success resets the failure count and reinstates a suspended namespace;
  • invalid (no answer, not 200, not a key document for the host, a declaration that fails): Store::record_namespace_failure adds one to the consecutive failures, and the SUSPEND_AFTERth in a row suspends the namespace (suspended_at).

A suspended namespace refuses new writes under it with the store’s datumesh_store::Error::NamespaceSuspended: a receipt signed by the host (put_receipt), a version of such a receipt (put_version), a name under the host (bind_name, so define and publish-stored too, and the import of a foreign host’s bindings and cells). Reads, verification, the key document the mesh serves and the receipts already stored are not affected; a cross-mesh import that the store refuses reaches a request as E_INPUT_UNAVAILABLE (the closest code that exists), with the suspension in its detail.

The mesh’s own namespaces (Config::namespaces) are never validated here, so never suspended: a failed fetch of the mesh’s own site must not stop the mesh publishing. Hosts with no namespace in the store have nothing to suspend; their failed validation is reported and nothing is recorded.

datumesh-mesh validate <host> and validate --all run this from the command line; the weekly re-check is a cron entry running validate --all (deploy/install_cron.sh).

Structs§

Validation
The result of validating one host, with what the store now records.
Validator
Validates namespace hosts against their own sites and records the outcome in a store.

Enums§

Outcome
How one host’s validation came out.

Constants§

SUSPEND_AFTER
The consecutive failed validations after which a namespace is suspended.