Skip to main content

Crate trust_tasks_capability_client

Crate trust_tasks_capability_client 

Source
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

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§

CapabilitySummary
One capability entry as rendered by a management UI.

Enums§

CapabilityClientError
Errors from document construction.
CapabilityReply
The classification of a governance/capability/* reply.
WriteOutcome
The classification of a git-trust write 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-didcomm binding envelope type (what a registry’s DIDComm Trust Task handler listens for).

Functions§

build_document
Build a capability Trust Task addressed issuerrecipient.
build_git_trust_grant
Build a git-trust/grant: grant subject commit-signing trust for resource (an org or org/repo slug).
build_git_trust_revoke
Build a git-trust/revoke.
build_list_document
Build a governance/capability/list request (status all).
build_toggle_document
Build a governance/capability/enable or /disable request. On enable, config.authority defaults 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/grant or git-trust/revoke write. None when doc is not a reply to this family.
parse_capability_reply
Classify a governance/capability/* reply document. None when it is not part of this family.
parse_envelope_document
Parse a DIDComm envelope body into (threadId, document). None when 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 a Value.