Skip to content

Commit 8568ca4

Browse files
authored
fix: API transport on inline CAS (#916)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent c76ee12 commit 8568ca4

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

app/cli/internal/action/workflow_run_describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (action *WorkflowRunDescribe) Run(ctx context.Context, runID string, digest
171171
func materialPBToAction(in *pb.AttestationItem_Material) *Material {
172172
m := &Material{
173173
Name: in.Name,
174-
Value: in.Value,
174+
Value: string(in.Value),
175175
Type: in.Type,
176176
Hash: in.Hash,
177177
Tag: in.Tag,

app/controlplane/api/controlplane/v1/response_messages.pb.go

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

app/controlplane/api/controlplane/v1/response_messages.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ message AttestationItem {
9191
message Material {
9292
string name = 1;
9393
// This might be the raw value, the container image name, the filename and so on
94-
string value = 2;
94+
bytes value = 2;
9595
// filename of the artifact that was either uploaded or injected inline in "value"
9696
string filename = 8;
9797
// Material type, i.e ARTIFACT

app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts

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

app/controlplane/internal/service/attestation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ func extractMaterials(in []*chainloop.NormalizedMaterial) ([]*cpAPI.AttestationI
414414
Type: m.Type,
415415
Filename: m.Filename,
416416
Annotations: m.Annotations,
417-
Value: m.Value,
417+
Value: []byte(m.Value),
418418
UploadedToCas: m.UploadedToCAS,
419419
EmbeddedInline: m.EmbeddedInline,
420420
Tag: m.Tag,

app/controlplane/internal/service/attestation_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ func TestExtractMaterials(t *testing.T) {
6464
{
6565
Name: "foo",
6666
Type: "STRING",
67-
Value: "bar",
67+
Value: []byte("bar"),
6868
},
6969
{
7070
Name: "with_annotations",
7171
Type: "STRING",
72-
Value: "bar",
72+
Value: []byte("bar"),
7373
Annotations: map[string]string{
7474
"foo": "bar",
7575
"bar": "baz",
@@ -78,13 +78,13 @@ func TestExtractMaterials(t *testing.T) {
7878
{
7979
Name: "foo",
8080
Type: "ARTIFACT",
81-
Value: "bar",
81+
Value: []byte("bar"),
8282
Hash: "sha256:deadbeef",
8383
},
8484
{
8585
Name: "image",
8686
Type: "CONTAINER_IMAGE",
87-
Value: "docker.io/nginx",
87+
Value: []byte("docker.io/nginx"),
8888
Hash: "sha256:deadbeef",
8989
},
9090
},

0 commit comments

Comments
 (0)