Skip to content

Refactor: migrate from deprecated in-toto-golang types to in-toto/attestation module #3347

@st3penta

Description

@st3penta

The CLI uses deprecated types and sub-packages from github.com/in-toto/in-toto-golang/in_toto that should be replaced with their modern equivalents from github.com/in-toto/attestation (https://github.com/in-toto/attestation/tree/main/go).

Deprecated types currently in use (production code):

  • in_toto.Statement -- used in internal/attestation/attestation.go and internal/applicationsnapshot/attestation.go
  • in_toto.ProvenanceStatementSLSA02 -- used in internal/attestation/slsa_provenance_02.go and internal/image/fake.go
  • in_toto.ProvenanceStatementSLSA1 -- used in internal/attestation/slsa_provenance_v1.go
  • in_toto.StatementInTotoV01 -- used across multiple attestation files
  • in_toto.StatementHeader, in_toto.Subject -- used via the above types
  • Sub-packages in_toto/slsa_provenance/v0.2, in_toto/slsa_provenance/v1, in_toto/slsa_provenance/common

Affected files (production):

  • internal/attestation/attestation.go (5 nolint suppressions)
  • internal/attestation/slsa_provenance_02.go (1 nolint suppression)
  • internal/attestation/slsa_provenance_v1.go (3 nolint suppressions)
  • internal/applicationsnapshot/attestation.go (4 nolint suppressions)
  • internal/image/fake.go (2 nolint suppressions)

Affected files (tests and acceptance): Numerous test files and the acceptance/ and benchmark/ directories also use the deprecated types.

Migration target: The github.com/in-toto/attestation module (already an indirect dependency at v1.1.2) provides the replacement APIs. After migration, the github.com/in-toto/in-toto-golang dependency can potentially be removed entirely, and all //nolint:staticcheck suppressions can be cleaned up.

Context: A prior commit (011438a, Feb 2026) explicitly deferred this refactoring, adding nolint directives with the note: "Dealing with these deprecations requires a major refactoring, which doesn't fit in this PR."

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filefeaturegoPull requests that update Go codetriaged

    Type

    No type
    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