From 6b1cf588c4322db95e75af0710669b522eb7643c Mon Sep 17 00:00:00 2001 From: Lily Sturmann Date: Mon, 15 Nov 2021 17:34:15 -0500 Subject: [PATCH] Only include Attestation data if attestation storage enabled Signed-off-by: Lily Sturmann --- 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 df5bdea6d..6c8522219 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