Skip to content

Commit

Permalink
Remove definedInMaterial from invocation
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Franssen <marco.franssen@philips.com>
  • Loading branch information
marcofranssen committed Nov 11, 2021
1 parent 6442288 commit 968662e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion lib/github/provenance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ func TestGenerateProvenanceFromGitHubReleaseErrors(t *testing.T) {
}

func assertInvocation(assert *assert.Assertions, recipe intoto.Invocation) {
assert.Equal(0, recipe.DefinedInMaterial)
assert.Equal("", recipe.ConfigSource.EntryPoint)
assert.Nil(recipe.Environment)
assert.Nil(recipe.Parameters)
Expand Down
16 changes: 5 additions & 11 deletions lib/intoto/intoto.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,8 @@ func WithInvocation(buildType, entryPoint string, environment json.RawMessage, p
URI: materials[0].URI,
Digest: materials[0].Digest,
},
Parameters: parameters,
// Subject to change and simplify https://github.com/slsa-framework/slsa/issues/178
// Index in materials containing the recipe steps that are not implied by recipe.type. For example, if the recipe type were "make", then this would point to the source containing the Makefile, not the make program itself.
// Omit this field (or use null) if the recipe doesn't come from a material.
// TODO: What if there is more than one material?
DefinedInMaterial: 0,
Environment: environment,
Parameters: parameters,
Environment: environment,
}
s.Predicate.Materials = append(s.Predicate.Materials, materials...)
}
Expand Down Expand Up @@ -146,10 +141,9 @@ type Metadata struct {

// Invocation Identifies the configuration used for the build. When combined with materials, this SHOULD fully describe the build, such that re-running this recipe results in bit-for-bit identical output (if the build is reproducible).
type Invocation struct {
DefinedInMaterial int `json:"definedInMaterial"`
ConfigSource ConfigSource `json:"configSource"`
Parameters json.RawMessage `json:"parameters"`
Environment json.RawMessage `json:"environment"`
ConfigSource ConfigSource `json:"configSource"`
Parameters json.RawMessage `json:"parameters"`
Environment json.RawMessage `json:"environment"`
}

// ConfigSource Describes where the config file that kicked off the build came from.
Expand Down
1 change: 0 additions & 1 deletion lib/intoto/intoto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func assertStatement(assert *assert.Assertions, stmt *Statement, builderID, buil
assertConfigSource(assert, i.ConfigSource, stmt.Predicate.Materials)
assert.Nil(stmt.Predicate.BuildConfig)
assert.Equal(parameters, i.Parameters)
assert.Equal(0, i.DefinedInMaterial)
assert.Equal(material, stmt.Predicate.Materials)
}

Expand Down

0 comments on commit 968662e

Please sign in to comment.