Skip to main content

Module root_cert

Module root_cert 

Source
Expand description

Trust in a self-hosted Cloud: the vendor’s root certificate (C0 1.7).

The hosted Cloud is trusted through its root compiled into this build. A self-hosted Cloud is trusted when LeanCTX vouched for its root with a RootCertV1, signed by a vendor root compiled in at release (LEANCTX_CLOUD_ROOT_KEYS, a JSON array of hex Ed25519 keys; no default): the certificate names the origin, the organizations whose leases the root may sign, and its validity (no grace after not_after).

The engine fetches the certificate on connect and at lease renewal, keeps the last verified one in <config>/cloud/root-cert.json (0600) and replaces it only with one that verifies. An invalid or expired stored certificate pauses Cloud, like a lapsed lease; local tools never notice. [cloud] root_key stays a development escape hatch (“unvouched Cloud root”); a certificate, when present, wins over it.

Structs§

ConnectTrust
How this engine trusts an origin it is about to connect to.

Functions§

check_lease_org
The organization check of a certified root: the lease’s org must be one the certificate names. Without a certificate there is nothing to check.
for_connect
The root for a new enrollment: a certificate the origin serves wins; an explicit [cloud] root_key is the unvouched fallback; the hosted Cloud uses its compiled root.
refresh
At lease renewal: fetch the certificate again and keep it when it verifies (a renewed one replaces the old); a failing fetch keeps the stored one, whose own validity still applies.
store_certificate
Keep a verified certificate (after the enrollment or a refresh).
stored_certificate
The stored certificate for the runtime lease (the runtime verifies it).
trust_root
The root that signs origin’s key set: a stored certificate’s, else the configured or compiled one.
unvouched
Whether the configured root is the unvouched escape hatch (for cloud status): a root_key is set and no certificate is stored.