Add default state and validation

What does this MR do and why?

Add default state and validation

Variable configuration now has validation and default state

This change improves the validation of variable override configurations in the security orchestration policy editor. It adds a new function to check if the variable override structure is valid (must have "allowed" as a boolean and "exceptions" as an array). The UI component now displays a validation error message when the structure is invalid, helping users identify and fix configuration problems. Additionally, the component now properly handles empty states and initializes with default values when first opened. The code also includes better type checking and error handling to ensure the variable override feature works correctly.

References

Screenshots or screen recordings

Description UI
Default state and validation validation and default.mov

How to set up and validate locally

  1. Enable feature flag:

    Feature.enable(:security_policies_optional_variables_control)
  2. Go to Secure -> Policies

  3. New pipeline execution policy

  4. Try to open variables option

  5. Switch to yaml mode, and type in invalid key or value

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.

Related to #537933 (closed)

Merge request reports

Loading