From 0047a75e3c87aa08117a904770e67987b4ef3a97 Mon Sep 17 00:00:00 2001 From: Lily Sturmann <lkatalin@users.noreply.github.com> Date: Mon, 15 Nov 2021 22:00:33 -0500 Subject: [PATCH] Only include Attestation data if attestation storage enabled (#494) Signed-off-by: Lily Sturmann <lsturman@redhat.com> --- cmd/rekor-cli/app/get.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/rekor-cli/app/get.go b/cmd/rekor-cli/app/get.go index df5bdea..6c85222 100644 --- a/cmd/rekor-cli/app/get.go +++ b/cmd/rekor-cli/app/get.go @@ -150,13 +150,16 @@ func parseEntry(uuid string, e models.LogEntryAnon) (interface{}, error) { } obj := getCmdOutput{ - Attestation: string(e.Attestation.Data), - AttestationType: e.Attestation.MediaType, - Body: eimpl, - UUID: uuid, - IntegratedTime: *e.IntegratedTime, - LogIndex: int(*e.LogIndex), - LogID: *e.LogID, + Body: eimpl, + UUID: uuid, + IntegratedTime: *e.IntegratedTime, + LogIndex: int(*e.LogIndex), + LogID: *e.LogID, + } + + if e.Attestation != nil { + obj.Attestation = string(e.Attestation.Data) + obj.AttestationType = e.Attestation.MediaType } return &obj, nil -- GitLab