Skip to content

Commit ff30ce8

Browse files
committed
include author verification on attestation
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
1 parent ab58ce0 commit ff30ce8

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

pkg/attestation/renderer/chainloop/chainloop.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,12 @@ func (p *ProvenancePredicateCommon) GetMetadata() *Metadata {
334334

335335
const (
336336
// Subject names
337-
SubjectGitHead = "git.head"
338-
subjectGitAnnotationAuthorEmail = "author.email"
339-
subjectGitAnnotationAuthorName = "author.name"
340-
subjectGitAnnotationWhen = "date"
341-
subjectGitAnnotationMessage = "message"
342-
subjectGitAnnotationRemotes = "remotes"
343-
subjectGitAnnotationSignature = "signature"
337+
SubjectGitHead = "git.head"
338+
subjectGitAnnotationAuthorEmail = "author.email"
339+
subjectGitAnnotationAuthorName = "author.name"
340+
subjectGitAnnotationAuthorVerified = "author.verified"
341+
subjectGitAnnotationWhen = "date"
342+
subjectGitAnnotationMessage = "message"
343+
subjectGitAnnotationRemotes = "remotes"
344+
subjectGitAnnotationSignature = "signature"
344345
)

pkg/attestation/renderer/chainloop/v02.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ func commitAnnotations(c *v1.Commit) (*structpb.Struct, error) {
144144
annotationsRaw[subjectGitAnnotationSignature] = c.GetSignature()
145145
}
146146

147+
// add author verification only if exists
148+
if c.GetPlatformVerification() != nil {
149+
pv := c.GetPlatformVerification()
150+
annotationsRaw[subjectGitAnnotationAuthorVerified] = pv.GetStatus()
151+
}
152+
147153
if remotes := c.GetRemotes(); len(remotes) > 0 {
148154
remotesRaw := []interface{}{}
149155
for _, r := range remotes {

0 commit comments

Comments
 (0)