Expand description
V9 session_ref: the session a write names, and whether the enrolled
Cloud may hear it.
An older Cloud refuses the closed event envelope and receipt document
with the member, and a refused signed event or receipt batch is moved
to outbox/failed for good. So the engine reads GET /v1/capabilities
(cached per server in <config>/capabilities.json, refreshed with the
instance card) and attaches a session only while that server announces
the session_ref feature.
What leaves is never the session id: it is an HMAC-SHA256 under the
engine-local receipts key (receipts.hmac-key, never uploaded), so Cloud
cannot test a guessed id (session ids carry a timestamp and a process id
and are guessable). Events name only sessions this engine generated
(lean_ctx::core::session::is_engine_session_id); labels such as an
import never become a session.
The older body field session_ref (ses_ and 24 hex characters) of
drafts, task claims, task proposals and episodes needs no capability:
its shape is unchanged. It is keyed the same way (uploaded_ses_ref);
when the local key cannot be read or created, the write is not uploaded
at all, so no unsalted digest of a guessable session id leaves the
machine.
Structs§
- Session
Refs - Keyed session refs, present only while the enrolled Cloud accepts them.
Constants§
- EVENT_
REF_ PREFIX - Prefix of the envelope ref:
hs_and 32 lowercase hex characters, the first half of the receipt’shmac-sha256:value for the same input. - FEATURE_
SESSION_ REF - The
featuresentry of a Cloud that acceptssession_ref(cloud_wire::engine::FEATURE_SESSION_REF). - NO_
SESSION_ KEY - Why nothing naming a session is uploaded: the local receipts key cannot be read or created, and the unsalted digest of a guessable session id must not stand in for the keyed one.
Functions§
- announced
- Whether the server this machine is enrolled with announced
featurewhen last asked. - record
- Record what
serverannounced. - refresh
- Ask the enrolled Cloud what it accepts and record it. A Cloud without the route announces nothing; any other failure keeps the last answer.
- rekeyed_
legacy_ ref - The ref a draft or proposal queued before body refs were keyed is sent
with: its stored unsalted
ses_digest (the queue never kept the session id), keyed under the local key with its own label. Errors asuploaded_ses_refdoes, and the item then stays queued. - uploaded_
ses_ ref - The body
ses_ref an upload (draft, task claim, task proposal, episode) names sessionid(or a fixed label such ascli-import) by: keyed under the local receipts key incloud_data(SessionRefs::episode_ref, no capability needed, the shape is unchanged). When that key cannot be read or created this is an error (NO_SESSION_KEY) and the caller skips the upload: every contract that carries the field requires it, and the unsaltedcrate::knowledge::draft::session_refof a guessable id never stands in. Local-only uses (file names, done markers) keep the unsalted ref.