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/internal/base.rb')
-rw-r--r--lib/api/internal/base.rb26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb
index 2ab5d482295..b53f855c3a2 100644
--- a/lib/api/internal/base.rb
+++ b/lib/api/internal/base.rb
@@ -43,7 +43,7 @@ module API
# This is a separate method so that EE can alter its behaviour more
# easily.
- if Feature.enabled?(:rate_limit_gitlab_shell, default_enabled: :yaml)
+ if Feature.enabled?(:rate_limit_gitlab_shell)
check_rate_limit!(:gitlab_shell_operation, scope: [params[:action], params[:project], actor.key_or_user])
end
@@ -123,10 +123,19 @@ module API
'Could not find a user for the given key' unless actor.user
end
+ # TODO: backwards compatibility; remove after https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/454 is merged
def two_factor_otp_check
{ success: false, message: 'Feature is not available' }
end
+ def two_factor_manual_otp_check
+ { success: false, message: 'Feature is not available' }
+ end
+
+ def two_factor_push_otp_check
+ { success: false, message: 'Feature is not available' }
+ end
+
def with_admin_mode_bypass!(actor_id)
return yield unless Gitlab::CurrentSettings.admin_mode
@@ -320,10 +329,23 @@ module API
end
end
+ # TODO: backwards compatibility; remove after https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/454 is merged
post '/two_factor_otp_check', feature_category: :authentication_and_authorization do
status 200
- two_factor_otp_check
+ two_factor_manual_otp_check
+ end
+
+ post '/two_factor_push_otp_check', feature_category: :authentication_and_authorization do
+ status 200
+
+ two_factor_push_otp_check
+ end
+
+ post '/two_factor_manual_otp_check', feature_category: :authentication_and_authorization do
+ status 200
+
+ two_factor_manual_otp_check
end
end
end