Skip to content

GetEvaluableContent fails on binary material content #2963

Description

@jiparis

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:

  1. crafter.goPolicyGroupVerifier.VerifyMaterial()
  2. policy_groups.go:81material.GetEvaluableContent(path)
  3. crafting_state.go:158-159json.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.

Metadata

Metadata

Assignees

Labels

User BugbugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions