Skip to main content

classify_git_trust_reply

Function classify_git_trust_reply 

Source
pub fn classify_git_trust_reply(
    doc: &TrustTask<Value>,
    expected_thread_id: &str,
) -> Option<WriteOutcome>
Expand description

Classify the reply to a git-trust/grant or git-trust/revoke write.

expected_thread_id is the thread of the request this is supposed to be answering — correlation_thread of the document you sent. A reply threaded to anything else is not an answer to it, and yields None rather than an outcome: acting on an uncorrelated reply means letting whichever document arrives next decide the fate of a write it has nothing to do with.

None therefore means “not an answer to this request” — either a document of another family, or a reply belonging to another exchange. Use replies_to if you need to tell those apart.

Idempotent success is keyed on the extended error code of SPEC §8.5 (GIT_TRUST_ALREADY_GRANTED_CODE, GIT_TRUST_NOT_GRANTED_CODE), never on the free-text message. See classify_git_trust_reply_with_policy for the deprecated compatibility path.