summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-09-13 14:53:05 +0000
committerRobert Speicher <robert@gitlab.com>2018-09-13 14:53:05 +0000
commitc7d1eef671dbf598814a6c2ff1f81b924583ae8a (patch)
tree23988df1d29e933943858a66821ba7f493976b3e /lib/api/internal.rb
parentff5d8b635f234241441009e41af7b61f5804b2c2 (diff)
parent2039c8280db1646845c33d6c5a74e5f23ca6f4de (diff)
downloadgitlab-ce-c7d1eef671dbf598814a6c2ff1f81b924583ae8a.tar.gz
Merge branch 'rubocop-code-reuse' into 'master'
Add RuboCop cops to enforce code reusing rules See merge request gitlab-org/gitlab-ce!21391
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index e3e8cb71c09..71b87f60bf6 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -26,6 +26,7 @@ module API
# project - project full_path (not path on disk)
# action - git action (git-upload-pack or git-receive-pack)
# changes - changes as "oldrev newrev ref", see Gitlab::ChangesList
+ # rubocop: disable CodeReuse/ActiveRecord
post "/allowed" do
# Stores some Git-specific env thread-safely
env = parse_env
@@ -96,7 +97,9 @@ module API
response_with_status(code: 500, success: false, message: UNKNOWN_CHECK_RESULT_ERROR)
end
end
+ # rubocop: enable CodeReuse/ActiveRecord
+ # rubocop: disable CodeReuse/ActiveRecord
post "/lfs_authenticate" do
status 200
@@ -118,6 +121,7 @@ module API
repository_http_path: project.http_url_to_repo
}
end
+ # rubocop: enable CodeReuse/ActiveRecord
get "/merge_request_urls" do
merge_request_urls
@@ -126,6 +130,7 @@ module API
#
# Get a ssh key using the fingerprint
#
+ # rubocop: disable CodeReuse/ActiveRecord
get "/authorized_keys" do
fingerprint = params.fetch(:fingerprint) do
Gitlab::InsecureKeyFingerprint.new(params.fetch(:key)).fingerprint
@@ -134,10 +139,12 @@ module API
not_found!("Key") if key.nil?
present key, with: Entities::SSHKey
end
+ # rubocop: enable CodeReuse/ActiveRecord
#
# Discover user by ssh key, user id or username
#
+ # rubocop: disable CodeReuse/ActiveRecord
get "/discover" do
if params[:key_id]
key = Key.find(params[:key_id])
@@ -150,6 +157,7 @@ module API
present user, with: Entities::UserSafe
end
+ # rubocop: enable CodeReuse/ActiveRecord
get "/check" do
{
@@ -176,6 +184,7 @@ module API
end
end
+ # rubocop: disable CodeReuse/ActiveRecord
post '/two_factor_recovery_codes' do
status 200
@@ -217,6 +226,7 @@ module API
{ success: true, recovery_codes: codes }
end
+ # rubocop: enable CodeReuse/ActiveRecord
post '/pre_receive' do
status 200