Expose licenses in dependencies API
What does this MR do and why?
It exposes licenses information in the dependencies API to be equivalent to the dependencies controller (/:group/:project/-/dependencies.json
).
Related to gitlab-com/gl-security/engineering-and-research/gib#40
Screenshots or screen recordings
The license was already showing on http://gdk.test:3000/gitlab-org/gitlab-shell/-/dependencies
But now the REST API also contains the data http://gdk.test:3000/api/v4/projects/2/dependencies
How to set up and validate locally
-
Add this CI config to a project (I used
gitlab-org/gitlab-shell
in the GDK and replaced the existing config for this test)include: - template: Security/Dependency-Scanning.gitlab-ci.yml - template: Security/License-Scanning.gitlab-ci.yml
-
Wait for the pipeline to complete
-
Visit http://gdk.test:3000/api/v4/projects/2/dependencies and observe the licenses for the packages where the info is available
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.