Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/settings.rb')
-rw-r--r--lib/api/settings.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/api/settings.rb b/lib/api/settings.rb
index aac195f0668..36f816ae638 100644
--- a/lib/api/settings.rb
+++ b/lib/api/settings.rb
@@ -176,6 +176,7 @@ module API
optional :require_admin_approval_after_user_signup, type: Boolean, desc: 'Require explicit admin approval for new signups'
optional :whats_new_variant, type: String, values: ApplicationSetting.whats_new_variants.keys, desc: "What's new variant, possible values: `all_tiers`, `current_tier`, and `disabled`."
optional :floc_enabled, type: Grape::API::Boolean, desc: 'Enable FloC (Federated Learning of Cohorts)'
+ optional :user_deactivation_emails_enabled, type: Boolean, desc: 'Send emails to users upon account deactivation'
ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type|
optional :"#{type}_key_restriction",
@@ -225,6 +226,16 @@ module API
attrs[:asset_proxy_allowlist] = attrs.delete(:asset_proxy_whitelist)
end
+ # Also accept these attributes under their new names.
+ #
+ # TODO: Once we rename the columns, we have to swap this around and keep supporting the old names until v5.
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/340031
+ %w[enabled period_in_seconds requests_per_period].each do |suffix|
+ old_name = :"throttle_unauthenticated_#{suffix}"
+ new_name = :"throttle_unauthenticated_web_#{suffix}"
+ attrs[old_name] = attrs.delete(new_name) if attrs.has_key?(new_name)
+ end
+
# since 13.0 it's not possible to disable hashed storage - support can be removed in 14.0
attrs.delete(:hashed_storage_enabled) if attrs.has_key?(:hashed_storage_enabled)