Add soft limit daily phone verification attribute to application setting
What does this MR do and why?
The work in this MR solves for task: Convert soft_phone_verification_transactions_limit to an application setting
We are adding a JSONB attribute - soft_phone_verification_transactions_limit in the ApplicationSetting model under identity_verification_settings column with default value set as 16_000
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- In rails console set the value of
soft_phone_verification_transactions_limitto 2 by running following command
ApplicationSetting.last.update(soft_phone_verification_transactions_limit: 2)
- Now start making calls to
throttled?method of::Gitlab::ApplicationRateLimitermultiple times. Expectation is for the first two times it will return false as the count is still under the limit but in the third time it will return true.
::Gitlab::ApplicationRateLimiter.throttled?(:soft_phone_verification_transactions_limit, scope: nil)
=> false
::Gitlab::ApplicationRateLimiter.throttled?(:soft_phone_verification_transactions_limit, scope: nil)
=> false
# 3rd request
::Gitlab::ApplicationRateLimiter.throttled?(:soft_phone_verification_transactions_limit, scope: nil)
=> true
Edited by Ayush Billore