Skip to content

Commit

Permalink
feat(policies): enable CONTAINER_IMAGE materials in policy evaluation…
Browse files Browse the repository at this point in the history
…s. (chainloop-dev#1442)

Signed-off-by: Jose I. Paris <[email protected]>
  • Loading branch information
jiparis authored Oct 25, 2024
1 parent ac21fc8 commit 52e63f7
Show file tree
Hide file tree
Showing 12 changed files with 401 additions and 192 deletions.
142 changes: 71 additions & 71 deletions app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ message PolicySpec {
(buf.validate.field).enum = {
not_in: [
1,
2,
3,
10,
11
Expand Down Expand Up @@ -247,7 +246,6 @@ message PolicySpecV2 {
CraftingSchema.Material.MaterialType kind = 3 [(buf.validate.field).enum = {
not_in: [
1,
2,
3,
10,
11
Expand Down
5 changes: 3 additions & 2 deletions app/controlplane/pkg/biz/referrer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

conf "github.com/chainloop-dev/chainloop/app/controlplane/internal/conf/controlplane/config/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation"
v2 "github.com/chainloop-dev/chainloop/pkg/attestation/crafter/api/attestation/v1"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
"github.com/chainloop-dev/chainloop/pkg/servicelogger"
"github.com/go-kratos/kratos/v2/log"
Expand Down Expand Up @@ -411,9 +412,9 @@ func intotoSubjectToReferrer(r *v1.ResourceDescriptor) (*Referrer, error) {
// it's a material type
for k, v := range r.Annotations.AsMap() {
// It's a material type
if k == chainloop.AnnotationMaterialType {
if k == v2.AnnotationMaterialType {
materialType = v.(string)
} else if k == chainloop.AnnotationMaterialCAS {
} else if k == v2.AnnotationMaterialCAS {
uploadedToCAS = v.(bool)
}
}
Expand Down
Loading

0 comments on commit 52e63f7

Please sign in to comment.