Skip to content

Commit 52e63f7

Browse files
authored
feat(policies): enable CONTAINER_IMAGE materials in policy evaluations. (#1442)
Signed-off-by: Jose I. Paris <[email protected]>
1 parent ac21fc8 commit 52e63f7

File tree

12 files changed

+401
-192
lines changed

12 files changed

+401
-192
lines changed

app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go

Lines changed: 71 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/workflowcontract/v1/crafting_schema.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ message PolicySpec {
212212
(buf.validate.field).enum = {
213213
not_in: [
214214
1,
215-
2,
216215
3,
217216
10,
218217
11
@@ -247,7 +246,6 @@ message PolicySpecV2 {
247246
CraftingSchema.Material.MaterialType kind = 3 [(buf.validate.field).enum = {
248247
not_in: [
249248
1,
250-
2,
251249
3,
252250
10,
253251
11

app/controlplane/pkg/biz/referrer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
conf "github.com/chainloop-dev/chainloop/app/controlplane/internal/conf/controlplane/config/v1"
2727
"github.com/chainloop-dev/chainloop/pkg/attestation"
28+
v2 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
2829
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
2930
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
3031
"github.com/go-kratos/kratos/v2/log"
@@ -411,9 +412,9 @@ func intotoSubjectToReferrer(r *v1.ResourceDescriptor) (*Referrer, error) {
411412
// it's a material type
412413
for k, v := range r.Annotations.AsMap() {
413414
// It's a material type
414-
if k == chainloop.AnnotationMaterialType {
415+
if k == v2.AnnotationMaterialType {
415416
materialType = v.(string)
416-
} else if k == chainloop.AnnotationMaterialCAS {
417+
} else if k == v2.AnnotationMaterialCAS {
417418
uploadedToCAS = v.(bool)
418419
}
419420
}

0 commit comments

Comments
 (0)