Skip to content

Commit

Permalink
Add BuildConfig to predicate structure
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 b79087a commit 6442288
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/intoto/intoto.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,17 @@ type Subject struct {
//
// A predicate has a required predicateType (TypeURI) identifying what the predicate means, plus an optional predicate (object) containing additional, type-dependent parameters.
type Predicate struct {
Builder `json:"builder"`
BuildType string `json:"buildType"`
Metadata `json:"metadata"`
Invocation `json:"invocation"`
Materials []Item `json:"materials"`
Builder `json:"builder"`
BuildType string `json:"buildType"`
Invocation `json:"invocation"`
BuildConfig *BuildConfig `json:"build_config,omitempty"`
Metadata `json:"metadata,omitempty"`
Materials []Item `json:"materials"`
}

// BuildConfig Lists the steps in the build.
// If invocation.sourceConfig is not available, buildConfig can be used to verify information about the build.
type BuildConfig struct {
}

// Builder Identifies the entity that executed the recipe, which is trusted to have correctly performed the operation and populated this provenance.
Expand Down
1 change: 1 addition & 0 deletions lib/intoto/intoto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func assertStatement(assert *assert.Assertions, stmt *Statement, builderID, buil
assert.Equal(builderID, stmt.Predicate.Builder.ID)
assert.Equal(buildType, stmt.Predicate.BuildType)
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 6442288

Please sign in to comment.