Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/cli/cmd/workflow_workflow_run_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ func predicateV1Table(att *action.WorkflowRunAttestationItem) {
for _, m := range materials {
mt.AppendRow(table.Row{"Name", m.Name})
mt.AppendRow(table.Row{"Type", m.Type})
mt.AppendRow(table.Row{"Value", wrap.String(m.Value, 100)})
if m.Filename != "" {
mt.AppendRow(table.Row{"Filename", m.Filename})
}

// We do not want to show the value if it is a file
if !m.EmbeddedInline && m.UploadedToCAS {
mt.AppendRow(table.Row{"Value", wrap.String(m.Value, 100)})
}

if m.Hash != "" {
mt.AppendRow(table.Row{"Digest", m.Hash})
}
Expand Down
5 changes: 3 additions & 2 deletions app/cli/internal/action/workflow_run_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ type WorkflowRunAttestationItem struct {
}

type Material struct {
Name string `json:"name"`
// filename, container image name, string value, ...
Name string `json:"name"`
Value string `json:"value"`
Hash string `json:"hash"`
Filename string `json:"filename"`
Type string `json:"type"`
Annotations []*Annotation `json:"annotations,omitempty"`
UploadedToCAS bool `json:"uploadedToCAS,omitempty"`
Expand Down Expand Up @@ -170,6 +170,7 @@ func materialPBToAction(in *pb.AttestationItem_Material) *Material {
Type: in.Type,
Hash: in.Hash,
UploadedToCAS: in.UploadedToCas,
Filename: in.Filename,
EmbeddedInline: in.EmbeddedInline,
}

Expand Down
243 changes: 127 additions & 116 deletions app/controlplane/api/controlplane/v1/response_messages.pb.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/controlplane/api/controlplane/v1/response_messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ message AttestationItem {
string name = 1;
// This might be the raw value, the container image name, the filename and so on
string value = 2;
// filename of the artifact that was either uploaded or injected inline in "value"
string filename = 8;
// Material type, i.e ARTIFACT
string type = 3;
map<string, string> annotations = 4;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions app/controlplane/internal/service/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ func extractMaterials(in []*chainloop.NormalizedMaterial) ([]*cpAPI.AttestationI
materialItem := &cpAPI.AttestationItem_Material{
Name: m.Name,
Type: m.Type,
Filename: m.Filename,
Annotations: m.Annotations,
Value: m.Value,
UploadedToCas: m.UploadedToCAS,
Expand All @@ -399,11 +400,6 @@ func extractMaterials(in []*chainloop.NormalizedMaterial) ([]*cpAPI.AttestationI
materialItem.Hash = m.Hash.String()
}

// Override the value for the filename of the item uploaded
if m.EmbeddedInline || m.UploadedToCAS {
materialItem.Value = m.Filename
}

res = append(res, materialItem)
}

Expand Down