From 47f954c3dcabb48d53d8b62247cd0e0d2f538fc1 Mon Sep 17 00:00:00 2001 From: felipecruz91 Date: Mon, 29 Jan 2024 16:00:24 +0100 Subject: [PATCH] fix: add publishedAt and updatedAt fields when mocking query Signed-off-by: felipecruz91 --- policy/policy_handler/legacy/builder.go | 2 ++ policy/types/graphql_types.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/policy/policy_handler/legacy/builder.go b/policy/policy_handler/legacy/builder.go index 792b3e9..ade24e1 100644 --- a/policy/policy_handler/legacy/builder.go +++ b/policy/policy_handler/legacy/builder.go @@ -30,6 +30,8 @@ func MockImagePackagesByDigestForLocalEval(sb *types.SBOM) ImagePackagesByDigest Severity: &v.Cvss.Severity, Score: &v.Cvss.Score, }, + PublishedAt: v.PublishedAt, + UpdatedAt: v.UpdatedAt, FixedBy: &v.FixedBy, Source: v.Source, SourceID: v.SourceId, diff --git a/policy/types/graphql_types.go b/policy/types/graphql_types.go index b1a0aa4..9a9edaf 100644 --- a/policy/types/graphql_types.go +++ b/policy/types/graphql_types.go @@ -41,6 +41,8 @@ type Vulnerability struct { VulnerableRange string `graphql:"vulnerableRange" json:"vulnerable_range,omitempty"` FixedBy string `graphql:"fixedBy" json:"fixed_by,omitempty"` Url string `graphql:"url" json:"url,omitempty"` + PublishedAt string `graphql:"publishedAt" json:"published_at,omitempty"` + UpdatedAt string `graphql:"updatedAt" json:"updated_at,omitempty"` Cvss struct { Score float32 `graphql:"score" json:"score,omitempty"` Severity string `graphql:"severity" json:"severity,omitempty"`