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:
- 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-emptydelegationChainbound to the credential before it; else"credential {i}: {code}"); - 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;
- 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_expansionrules as embedded chains, time left out), and the child’s window sits inside the parent’s; - the leaf’s intent meets the caller’s exact
require_action,require_targetandrequire_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_candidateslists 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:keyissuer; there is nodid:webresolution (put such keys in the map); - a credential (or an embedded grant) that carries
credentialStatusis checked against the status lists the caller supplies; with none supplied it is refused, as the reference refuses it offline.check_status: falseskips the status check, ascheck_status=Falsedoes in the reference.
The leaf is returned so the caller can mark it in its replay store; the core keeps no replay state.
Structs§
- Fleet
Options - How a fleet chain is verified.
- Fleet
Result - 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.