Commit 90b42fbc authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Thong Kuah

Add vulnerabilities to response

Private endpoint /dependencies now returns
array of vulnerabilities for each dependency
parent f8880b1f
......@@ -5,6 +5,11 @@ class DependencyEntity < Grape::Entity
expose :blob_path, :path
end
class VulnerabilityEntity < Grape::Entity
expose :name, :severity
end
expose :name, :packager, :version
expose :location, using: LocationEntity
expose :vulnerabilities, using: VulnerabilityEntity
end
---
title: Add vulnerabilities to dependency list
merge_request: 14761
author:
type: added
......@@ -4,7 +4,8 @@
"name",
"packager",
"version",
"location"
"location",
"vulnerabilities"
],
"properties": {
"name": {
......@@ -23,6 +24,17 @@
"path": {
"type": "string"
}
},
"vulnerabilities": {
"type": "array",
"properties": {
"name": {
"type": "string"
},
"severity": {
"type": "string"
}
}
}
},
"additionalProperties": false
......
......@@ -12,7 +12,16 @@ describe DependencyEntity do
location: {
blob_path: '/some_project/path/Gemfile.lock',
path: 'Gemfile.lock'
}
},
vulnerabilities:
[{
name: 'DDoS',
severity: 'high'
},
{
name: 'XSS vulnerability',
severity: 'low'
}]
}
end
......
......@@ -15,7 +15,12 @@ describe DependencyListSerializer do
location: {
blob_path: '/some_project/path/Gemfile.lock',
path: 'Gemfile.lock'
}
},
vulnerabilities:
[{
name: 'XSS',
severity: 'low'
}]
}]
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