Add export_path in order to make export api
What does this MR do and why?
Add export_path to this endpoint in order to make export api to consider relative_url
.
Related issue: #384884 (closed)
How to set up and validate locally
- Host Gitlab application on a relative url. https://docs.gitlab.com/ee/install/relative_url.html
- Go to a project's vulnerability report with a few vulnerabilities.
- Click on export to csv button.
Alternatively:
- Setup GDK by following these steps. It might require
gdk reconfigure
. - Go to a project's vulnerability report with a few vulnerabilities.
- Click on export to csv button.
Another option of validation is through rails console:
Currently the vulnerabilitiesExportEndpoint
used by CsvExportButton
does not include the relative aspect of the host url.
pry(main)> app.api_v4_security_projects_vulnerability_exports_path(id: 46)
=> "/api/v4/security/projects/46/vulnerability_exports"
Therefore calling expose_path
when setting vulnerabilities_export_endpoint
ensures that the relative aspect of the host url is considered.
pry(main)> expose_path(app.api_v4_security_projects_vulnerability_exports_path(id: 46))
=> "/gitlab/api/v4/security/projects/46/vulnerability_exports"
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.
Edited by Zamir Martins