Skip to content

Commit 2081d41

Browse files
committed
Show vulnerability summary
1 parent 9a372ef commit 2081d41

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

app/uk/gov/hmrc/cataloguefrontend/vulnerabilities/model.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ case class DistinctVulnerability(
5454
vulnerableComponents : Seq[VulnerableComponent],
5555
id : String,
5656
score : Option[Double],
57+
summary : String,
5758
description : String,
5859
fixedVersions : Option[Seq[String]],
5960
references : Seq[String],
@@ -73,6 +74,7 @@ object DistinctVulnerability {
7374
~ (__ \ "vulnerableComponents" ).read[Seq[VulnerableComponent]]
7475
~ (__ \ "id" ).read[String]
7576
~ (__ \ "score" ).readNullable[Double]
77+
~ (__ \ "summary" ).read[String]
7678
~ (__ \ "description" ).read[String]
7779
~ (__ \ "fixedVersions" ).readNullable[Seq[String]]
7880
~ (__ \ "references" ).read[Seq[String]]

app/uk/gov/hmrc/cataloguefrontend/vulnerabilities/view/VulnerabilityDetails.scala.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,18 @@
3131
<div class="col">
3232
<div class="row mb-3">
3333
<div class="col-6">
34-
<p class="fw-bold">Description:</p>
35-
<div class="overflow-x-hidden overflow-y-scroll" style="height: 140px;">
36-
@vuln.distinctVulnerability.description
37-
</div>
34+
<dl class="row">
35+
<p class="fw-bold">Summary:</p>
36+
<div>
37+
@vuln.distinctVulnerability.summary
38+
</div>
39+
</dl>
40+
<dl class="row">
41+
<p class="fw-bold">Description:</p>
42+
<div class="overflow-x-hidden overflow-y-scroll" style="height: 140px;">
43+
@vuln.distinctVulnerability.description
44+
</div>
45+
</dl>
3846
</div>
3947
<div class="col-6">
4048
<dl class="row">

test/uk/gov/hmrc/cataloguefrontend/deployments/DeployServiceControllerSpec.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ class DeployServiceControllerSpec
338338
, vulnerableComponents = Nil
339339
, id = "some-id"
340340
, score = None
341+
, summary = "summary"
341342
, description = "some-description"
342343
, fixedVersions = None
343344
, references = Seq("some-reference")

test/uk/gov/hmrc/cataloguefrontend/vulnerabilities/VulnerabilitiesConnectorSpec.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class VulnerabilitiesConnectorSpec
8080
"vulnerableComponents": [{"component": "deb://ubuntu/xenial:test", "version": "1.2.5.4-1"}],
8181
"id": "CVE-123",
8282
"score": 10,
83+
"summary": "summary",
8384
"description": "testing",
8485
"fixedVersions": ["2.5.2"],
8586
"references": ["http://test.com"],
@@ -103,6 +104,7 @@ class VulnerabilitiesConnectorSpec
103104
vulnerableComponents = Seq(VulnerableComponent("deb://ubuntu/xenial:test", Version("1.2.5.4-1"))),
104105
id = "CVE-123",
105106
score = Some(10.0),
107+
summary = "summary",
106108
description = "testing",
107109
fixedVersions = Some(Seq("2.5.2")),
108110
references = Seq("http://test.com"),

0 commit comments

Comments
 (0)