Expand description
RFC-001 — operator / organization enrollment (producer side).
The verifier side (org_membership, pair_decision, org_policy) consumes
identity claims; this is the half that produces them. Pure over the
supplied keypairs — key STORAGE (where the operator’s / org’s private keys
live on disk) is the CLI’s concern, deliberately not here, so this stays
unit-testable and reusable by the CLI, the live agent, and the e2e alike.
Two operations:
- an org issues a membership cert for an operator (
issue_member_cert): the org key signs the operator’sop_did; - an operator assembles its session claims (
build_member_claims): signsop_certover the session DID and carriesop_pubkey+ each org’s pubkey inline so the resulting card verifies fully offline (#94).
Structs§
- Member
Of - One org membership an operator holds, ready to assemble into card claims.
member_certis produced by the org viaissue_member_cert.
Functions§
- build_
member_ claims - Assemble the v3.2
IdentityClaimsa session presents. - issue_
member_ cert - An org issues a membership cert for an operator: the org’s key signs the
operator’s
op_did(UTF-8 bytes). The operator carries the returned base64 cert in its card; a receiver verifies it withidentity::verify_member_certagainst the inlineorg_pubkey. - rebuild_
card_ with_ current_ claims - Rebuild the on-disk agent card with the current enrollment state and
re-sign it. Closes the enroll-after-
initDX gap: claims are normally attached at card-build time (init::init_self_idempotent/cli.rsinit viawith_op_claims_if_enrolled), but an operator who enrolls AFTERinithas a stored card that pre-dates the claims. This reads the stored card, strips any pre-existing identity-claim fields + signature, overlays the current claims via the same helper used at init, re-signs with the existing session key, and writes the card back. Pure rebuild — does NOT publish; callers (thewire enroll republishCLI dispatcher) chain the existingrepublish_card_to_phonebookto push to the phonebook. Bails ifwire inithasn’t run; idempotent when not enrolled (strips stale claims → identical to a freshly-init’d non-enrolled card → re-signed → written). - with_
op_ claims_ if_ enrolled - Card-emit (RFC-001 Phase 1b): if this machine has an enrolled operator
(
op.keypresent), attach the operator’s identity claims + stored org memberships tocard. Returns the card unchanged when not enrolled, so card-build stays correct for the common case. The returned card is UNSIGNED; the caller signs it (sign_agent_card). Malformed stored memberships are skipped, not fatal.