Skip to main content

Module fleet

Module fleet 

Source
Expand description

Fleet chains: credentials presented one by one, root first.

A port of vouch.fleet.verify_delegated_chain (Python is the reference). A root identity grants a device’s DID a scope; the device signs its own actions (or sub-grants) with its own key. A verifier is handed the chain as separate credentials, [root_grant, ...sub_grants, leaf_action], and checks it back to a trusted root:

  1. before any credential is verified or any key is looked up, from the credentials’ fields alone: every credential is a JSON object (else "credential {i} is not a JSON object"), then the presented-chain binding rule (crate::grant_chain::presented_chain_problem: binding fields of the right shape, credential 0 a root grant, and every later credential that carries a digest or a non-empty delegationChain bound to the credential before it; else "credential {i}: {code}");
  2. for every credential, in order: it names an issuer, the first issuer is a trusted root, it verifies (proof, window, and any embedded delegation chain, with the fleet’s trusted roots as that chain’s trusted starting points and their keys resolving its grants), its status when it carries one, and neither its issuer nor its id is revoked;
  3. for every adjacent pair: the parent names a delegatee, the delegatee is not revoked, the child is issued by it, the child is no broader than the effective capability so far (the same capability_view / inherit / non_expansion rules as embedded chains, time left out), and the child’s window sits inside the parent’s;
  4. the leaf’s intent meets the caller’s exact require_action, require_target and require_resource.

Refusal texts match the reference byte for byte. Three differences follow from the core being stateless and offline:

  • revocation is a list of revoked identifiers (device DIDs, credential ids), not a callback; revocation_candidates lists every identifier the check asks about, so a caller with a callback can build the list first;
  • keys come from the trusted-roots map, then from a did:key issuer; there is no did:web resolution (put such keys in the map);
  • a credential (or an embedded grant) that carries credentialStatus is checked against the status lists the caller supplies; with none supplied it is refused, as the reference refuses it offline. check_status: false skips the status check, as check_status=False does in the reference.

The leaf is returned so the caller can mark it in its replay store; the core keeps no replay state.

Structs§

FleetOptions
How a fleet chain is verified.
FleetResult
The outcome of verifying a fleet chain.

Functions§

revocation_candidates
Every identifier the revocation check asks about, in the order it asks: each credential’s issuer and id, and each credential’s delegatee. A caller with a revocation callback passes the ones it reports as revoked.
verify_delegated_chain
Verify a fleet chain: credentials presented one by one, root grant first, leaf action last. See the module documentation for every check, in order.