Expand description
Client-side wire helpers for the capability Trust Task families —
governance/capability/* (enable / disable / list a community capability)
and git-trust/* (grant / revoke commit-signing trust).
This crate owns the documents, not a transport: it builds request
documents, parses inbound envelope replies, classifies them, and (behind
the signing feature) attaches a Data-Integrity proof. Each consumer keeps
its own send/receive plumbing but shares this wire layer, so a capability
producer (a community service) and a management UI cannot drift on the
contract.
§Layers
- Envelope: capability documents travel as the
trust-tasks-didcommbinding envelope (TRUST_TASK_ENVELOPE_TYPE);parse_envelope_documentturns an inbound body into(threadId, document). - Builders:
build_documentplus the family-specificbuild_list_document,build_toggle_document,build_git_trust_grant,build_git_trust_revoke. - Replies:
classify_git_trust_reply(for grant/revoke writers) andparse_capability_reply(for governance management UIs).
Signing is deliberately not here — it is a thin Data-Integrity call
each consumer makes with its own signer (a service reuses its credential
signer; a client signs with the persona key), so this crate stays free of
any crypto dependency. Sign the built document over its canonical form
(the document minus its proof member, eddsa-jcs-2022) and set the
proof member.
Structs§
- Capability
Summary - One capability entry as rendered by a management UI.
Enums§
- Capability
Client Error - Errors from document construction.
- Capability
Reply - The classification of a
governance/capability/*reply. - Write
Outcome - The classification of a
git-trustwrite reply.
Constants§
- CAPABILITY_
DISABLE_ TYPE - CAPABILITY_
ENABLE_ TYPE - CAPABILITY_
LIST_ TYPE governance/capability/*type URIs.- GIT_
TRUST_ GRANT_ TYPE git-trust/*type URIs.- GIT_
TRUST_ REVOKE_ TYPE - TRUST_
TASK_ ENVELOPE_ TYPE - The
trust-tasks-didcommbinding envelope type (what a registry’s DIDComm Trust Task handler listens for).
Functions§
- build_
document - Build a capability Trust Task addressed
issuer→recipient. - build_
git_ trust_ grant - Build a
git-trust/grant: grantsubjectcommit-signing trust forresource(an org ororg/reposlug). - build_
git_ trust_ revoke - Build a
git-trust/revoke. - build_
list_ document - Build a
governance/capability/listrequest (statusall). - build_
toggle_ document - Build a
governance/capability/enableor/disablerequest. On enable,config.authoritydefaults to the community’s own DID — the community is the authority its capability records are issued under. - classify_
git_ trust_ reply - Classify the reply to a
git-trust/grantorgit-trust/revokewrite.Nonewhendocis not a reply to this family. - parse_
capability_ reply - Classify a
governance/capability/*reply document.Nonewhen it is not part of this family. - parse_
envelope_ document - Parse a DIDComm envelope body into
(threadId, document).Nonewhen the body is not a threaded Trust Task document. - parse_
envelope_ reply - Parse an inbound envelope body directly into
(threadId, reply)— the entry point for a UI’s inbound dispatch, which holds only aValue.