Add validity_checks_enabled backend-to-frontend data flow
What does this MR do and why?
Currently the behaviour when the user is opted-out of Validity Checks is to display the default value of Possibly Active Secret. This is confusing as it might give the impression that the worker is still running even when it shouldn't be. This MR will hide the Token Status field when user is not opted in.
Add validity_checks_enabled backend-to-frontend data flow
- Send validity_checks_enabled from backend to frontend via helper
- Enable conditional rendering of Validity Check features based on user opt-in
- Add comprehensive test coverage for validity_checks_enabled functionality
- Update vulnerability details component to consume validity checks state
Allows the frontend to conditionally display Validity Check related UI elements only when users have explicitly enabled the feature.
Changelog: changed EE: true
References
[FE] Hide Validity Token Status When Opt-in is off (#551812 - closed) • Radu Birsan • 18.2
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- in rails console enable the feature flag
Feature.enable(:validity_checks)
- Navigate to project then Secure > Security Configuration
- Scroll down to Pipeline Secret Detection and enable it but make sure Validity Checks toggle is OFF
- Add a secret to your project and ensure the pipeline runs
- Check Secure > Vulnerability Report for the generated entry and ensure Token Status section doesn't appear
## MR acceptance checklist
Evaluate this MR against the [MR acceptance checklist](https://docs.gitlab.com/development/code_review/#acceptance-checklist).
It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Radu Birsan

