Add findingTokenStatus to Vulnerability GraphQL type

What does this MR do and why?

Add findingTokenStatus to Vulnerability GraphQL type

This commit adds support for exposing the finding token status in the Vulnerability GraphQL API. This allows the frontend to display the status of secret tokens found in vulnerabilities.

Changes include:

  • Create FindingTokenStatusType GraphQL type
  • Create FindingTokenStatusEnum for status values
  • Add FindingTokenStatusPolicy for authorization
  • Add findingTokenStatus field to VulnerabilityType
  • Update vulnerability fragment to include the new field

Changelog: added EE: true

References

How to set up and validate locally

  1. in rails console enable the feature flag
 Feature.enable(:validity_checks)
  1. in rails console create a vulnerability finding token status
 Vulnerabilities::FindingTokenStatus.create(vulnerability_occurrence_id: <id>, status: "active")
  1. in gdk/-/graphql-explorer
{
  project(fullPath: <project-with-vulnerabilities>) {
    id
    securityScanners {
      enabled
    }
    vulnerabilities {
      nodes {
        id
        title
        severity
        state
        findingTokenStatus {
          id
          status
        }
      }
    }
  }
}
  1. verify that findingTokenStatus appears and matches what you set in step 2

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Radu Birsan

Merge request reports

Loading