BE [Group Owner bypass ] Implement "enterprise bypass of placeholder user confirmation" expiry date

What does this MR do and why?

This MR adds an expiration date to the enterprise bypass for placeholder user confirmations.

What's changing:

  • When users enable the bypass, they must now set an expiry date
  • The bypass automatically stops working after the expiry date
  • Added validation to ensure the date is in the future

Technical bits:

  • New column: enterprise_bypass_expires_at in namespace_settings
  • New validation: Date must be present and in the future when bypass is enabled
  • Updated the bypass check to respect the expiry date

References

Screenshots or screen recordings

Before After

How to set up and validate locally

Since this is a backend change, the main validation comes from our test suite and CI pipelines.

(Optional) Test in Rails console:

Create a namespace setting with bypass

#Enable the feature flag:
Feature.enable(:group_owner_placeholder_confirmation_bypass)

ns = Namespace.find(1).namespace_settings
ns.allow_enterprise_bypass_placeholder_confirmation = true
ns.enterprise_bypass_expires_at = 30.days.from_now
ns.save!

Check if bypass is active ns.enterprise_placeholder_bypass_enabled? # => true

Test with expired date

ns.enterprise_bypass_expires_at = 1.day.ago
ns.save # => false (validation error)

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 #540573 (closed)

Edited by Rez

Merge request reports

Loading