Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the VEX rules listing endpoint to correctly filter by a specific dependency vulnerability by aligning the backend query parameter with what the frontend sends, preventing unrelated rules from being returned.
Changes:
- Updated
VEXRuleController.Listto readdependencyVulnIdfrom the query string instead ofvulnId.
Comments suppressed due to low confidence (1)
controllers/vex_rule_controller.go:84
- Changing the query parameter from
vulnIdtodependencyVulnIdis a breaking API change for any existing clients still sendingvulnId. Consider supporting both params for a transition period (e.g., readdependencyVulnIdfirst and fall back tovulnId, and/or return 400 when both are provided but differ), and update the OpenAPI annotations to document the new param and deprecate the old one.
vulnID := ctx.QueryParam("dependencyVulnId")
if vulnID != "" {
vulnIDParsed, err := uuid.Parse(vulnID)
if err != nil {
return echo.NewHTTPError(400, "could not parse vuln ID to uuid").WithInternal(err)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Issue: #1870
Fixed the error that all all VexRules are returned on request to a specific Vuln.
The issue was that there was a mismatch in query parameters. While the frontend was using the query param
dependencyVulnId, the backend API expected the parametervulnId. It therefore defaulted back into a case where the database would return every VexRule in the organisation for every vuln.This issue is solved now, but VexRules which contain direct dependencies are still not being displayed. This is discussed in Issue: #1872