Commit ff193ff1 authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Douwe Maan

Change vulnerability name to message

parent e47f6a2b
---
title: Use vulnerability message on Dependency list
merge_request: 15125
author:
type: changed
...@@ -76,7 +76,7 @@ module Gitlab ...@@ -76,7 +76,7 @@ module Gitlab
def formatted_vulnerability(vulnerability) def formatted_vulnerability(vulnerability)
{ {
name: vulnerability['name'], name: vulnerability['message'],
severity: vulnerability['severity'].downcase severity: vulnerability['severity'].downcase
} }
end end
......
...@@ -37,10 +37,10 @@ describe Gitlab::Ci::Parsers::Security::DependencyList do ...@@ -37,10 +37,10 @@ describe Gitlab::Ci::Parsers::Security::DependencyList do
vuln_async = report.dependencies[3][:vulnerabilities] vuln_async = report.dependencies[3][:vulnerabilities]
expect(vuln_nokogiri.size).to eq(4) expect(vuln_nokogiri.size).to eq(4)
expect(vuln_nokogiri[0][:name]).to eq('Vulnerabilities in libxml2') expect(vuln_nokogiri[0][:name]).to eq('Vulnerabilities in libxml2 in nokogiri')
expect(vuln_nokogiri[0][:severity]).to eq('high') expect(vuln_nokogiri[0][:severity]).to eq('high')
expect(vuln_debug.size).to eq(1) expect(vuln_debug.size).to eq(1)
expect(vuln_debug[0][:name]).to eq('Regular Expression Denial of Service') expect(vuln_debug[0][:name]).to eq('Regular Expression Denial of Service in debug')
expect(vuln_async.size).to eq(0) expect(vuln_async.size).to eq(0)
end end
end end
......
...@@ -43,8 +43,8 @@ describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do ...@@ -43,8 +43,8 @@ describe Gitlab::Ci::Parsers::Security::Formatters::DependencyList do
vulnerabilities = data[:vulnerabilities] vulnerabilities = data[:vulnerabilities]
expect(vulnerabilities.size).to eq(4) expect(vulnerabilities.size).to eq(4)
expect(vulnerabilities[0][:name]).to eq('Vulnerabilities in libxml2') expect(vulnerabilities[0][:name]).to eq('Vulnerabilities in libxml2 in nokogiri')
expect(vulnerabilities[3][:name]).to eq('Bypass of a protection mechanism in libxslt') expect(vulnerabilities[3][:name]).to eq('Bypass of a protection mechanism in libxslt in nokogiri')
expect(vulnerabilities[0][:severity]).to eq('high') expect(vulnerabilities[0][:severity]).to eq('high')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment