Problem
GetEvaluableContent in pkg/attestation/crafter/api/attestation/v1/crafting_state.go attempts to JSON-decode all material content, which fails for binary materials with errors like:
ERR adding material: error applying policy groups to material: failed to parse input: invalid character '\x7f' looking for beginning of value
The call chain is:
crafter.go → PolicyGroupVerifier.VerifyMaterial()
policy_groups.go:81 → material.GetEvaluableContent(path)
crafting_state.go:158-159 → json.Decoder.Decode() fails on non-JSON content
Expected behavior
GetEvaluableContent should detect binary or non-JSON content and either skip policy evaluation for those materials or handle them gracefully instead of returning an error.
Current behavior
Any material with binary content (e.g., containing control characters like \x7f) causes policy group evaluation to fail, blocking the attestation add command.
Problem
GetEvaluableContentinpkg/attestation/crafter/api/attestation/v1/crafting_state.goattempts to JSON-decode all material content, which fails for binary materials with errors like:The call chain is:
crafter.go→PolicyGroupVerifier.VerifyMaterial()policy_groups.go:81→material.GetEvaluableContent(path)crafting_state.go:158-159→json.Decoder.Decode()fails on non-JSON contentExpected behavior
GetEvaluableContentshould detect binary or non-JSON content and either skip policy evaluation for those materials or handle them gracefully instead of returning an error.Current behavior
Any material with binary content (e.g., containing control characters like
\x7f) causes policy group evaluation to fail, blocking theattestation addcommand.