Skip to main content

binding_fields_problem

Function binding_fields_problem 

Source
pub fn binding_fields_problem(subject: &Value) -> Option<&'static str>
Expand description

The shape of a credential’s own binding fields, read from its credentialSubject: None when they are well formed, otherwise malformed_delegation.

  • parentGrantDigest present and not a string: malformed_delegation;
  • delegationChain present and not a list: malformed_delegation;
  • a digest together with a non-empty delegationChain: malformed_delegation.

A present null, number or object is malformed, never absent (D29). An empty delegationChain is no chain. The verifiers apply this to the credential they verify (crate::delegation::verify_delegation_chain_with runs it first, on every verify path), to every grant in an embedded chain and to every credential in a fleet chain.

subject is the credential’s credentialSubject; anything that is not an object carries no binding fields.