Skip to main content

Module wan_verify

Module wan_verify 

Source
Expand description

Verify a same-account agent’s WAN signature on a cloud-delivered jekt (SPEC_WAN_JEKT_VERIFICATION_2026_09_24.md §2.3–2.6, step D2).

Runs in cloud_subscriber::delivery::claim_and_deliver, before transcript-request resolution, for each claimed injection. The checks run in the §2.3 order and every “couldn’t check” outcome is None — only an active failure (envelope moved, certificate chain broken, record for something else, signature bad, replay) is Some(false), the forced-sensitive red flag. A directory that is down or slow gives None and the message is delivered anyway: never /reactive/release, because nothing re-wakes a released row and it could expire undelivered (§1.2).

Replaced keys. An install that replaces an agent’s key signs a WanKeyRevocation for the old one. A message signed by a fingerprint this install holds a revocation of is Some(false) (wan_key_revoked), whatever its timestamp says, and the key is not looked up again. A revocation is learned from the directory’s answer for the key (HTTP 410 with the signed notice) or from the account’s feed, read at most every [KEY_FEED_REFRESH_SECS] while signed messages arrive; each must verify before it is kept (wan_identity::revocations).

The HTTP entry point never reaches this: an HTTP caller’s self-declared delivery_tier: "wan" can’t set wan_verified (skip_deserializing).

Structs§

Directory
Where the directory is and how to reach it. Tests point base_url at a stub and bring their own budget.
FetchBudget
A fixed-window request budget ([FETCHES_PER_MINUTE]).

Statics§

GLOBAL_BUDGET
The one budget every production verification shares.

Functions§

instance_handed_over_to
The install from handed over to: the successor named in the revocation from signed with its own key, which the directory serves. None when from is not revoked, the directory holds no revocation it signed, or the directory could not be read.
instance_is_live_install
Whether instance_id is a live, unrevoked install of the signed-in account: listed in its presence list and not revoked (the standard a WAN sender’s install is held to). None when that can’t be told.
instance_is_revoked
Whether the directory holds a revocation instance_id signed itself (the standard WAN verification applies). None when that can’t be told.
recipient_record
A receiver’s record, for a sender sealing files to it (server::jekt_cloud, file transfer spec §7): agent’s key on install instance, channel channel, fingerprint key_fp, as the agent’s lease named them. Only a record whose chain holds is returned or cached, and never one of a revoked install. Err says why not, to follow the agent’s name.