Skip to main content

validate_provenance

Function validate_provenance 

Source
pub fn validate_provenance(
    view: &ProvenanceSidecarView<'_>,
) -> Result<(), ProvenanceSectionError>
Expand description

The validate-before-use gate: return Ok only if the sidecar can be trusted as the asset’s provenance. Two independent checks:

  1. Self-authenticating source — the carried source_bytes hash to the declared source_digest (the bytes really are the attested source; a swapped source is rejected).
  2. Context present — a non-empty licence (a provenance record with no licence is a stripped context, not an attestation).

A consumer runs this before treating an asset as citable/attested (mirroring the renderer’s has_attestation governance gate).