Commit 51291041 authored by Thong Kuah's avatar Thong Kuah

Merge branch '12406-vulnerabilities-to-dl-response' into 'master'

Resolve "Add Dependency Scanning to Dependency List - Add vulnerabilities to response"

Closes #12406

See merge request gitlab-org/gitlab-ee!14761
parents f8880b1f 90b42fbc
...@@ -5,6 +5,11 @@ class DependencyEntity < Grape::Entity ...@@ -5,6 +5,11 @@ class DependencyEntity < Grape::Entity
expose :blob_path, :path expose :blob_path, :path
end end
class VulnerabilityEntity < Grape::Entity
expose :name, :severity
end
expose :name, :packager, :version expose :name, :packager, :version
expose :location, using: LocationEntity expose :location, using: LocationEntity
expose :vulnerabilities, using: VulnerabilityEntity
end end
---
title: Add vulnerabilities to dependency list
merge_request: 14761
author:
type: added
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"name", "name",
"packager", "packager",
"version", "version",
"location" "location",
"vulnerabilities"
], ],
"properties": { "properties": {
"name": { "name": {
...@@ -23,6 +24,17 @@ ...@@ -23,6 +24,17 @@
"path": { "path": {
"type": "string" "type": "string"
} }
},
"vulnerabilities": {
"type": "array",
"properties": {
"name": {
"type": "string"
},
"severity": {
"type": "string"
}
}
} }
}, },
"additionalProperties": false "additionalProperties": false
......
...@@ -12,7 +12,16 @@ describe DependencyEntity do ...@@ -12,7 +12,16 @@ describe DependencyEntity do
location: { location: {
blob_path: '/some_project/path/Gemfile.lock', blob_path: '/some_project/path/Gemfile.lock',
path: 'Gemfile.lock' path: 'Gemfile.lock'
} },
vulnerabilities:
[{
name: 'DDoS',
severity: 'high'
},
{
name: 'XSS vulnerability',
severity: 'low'
}]
} }
end end
......
...@@ -15,7 +15,12 @@ describe DependencyListSerializer do ...@@ -15,7 +15,12 @@ describe DependencyListSerializer do
location: { location: {
blob_path: '/some_project/path/Gemfile.lock', blob_path: '/some_project/path/Gemfile.lock',
path: 'Gemfile.lock' path: 'Gemfile.lock'
} },
vulnerabilities:
[{
name: 'XSS',
severity: 'low'
}]
}] }]
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