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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 21:08:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 21:08:10 +0300
commit175b4fa261259ab0d033482d10bb4159fee8e538 (patch)
treee1f1dba5e41177f11ffded5a505e0e7f692b8df5 /lib/api/keys.rb
parent4eea104c69e59f6fa53c7bc15b986c69f29b60c8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/keys.rb')
-rw-r--r--lib/api/keys.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/keys.rb b/lib/api/keys.rb
index d5280a0035d..8f2fd8cbae2 100644
--- a/lib/api/keys.rb
+++ b/lib/api/keys.rb
@@ -16,6 +16,23 @@ module API
present key, with: Entities::SSHKeyWithUser, current_user: current_user
end
+
+ desc 'Get SSH Key information' do
+ success Entities::UserWithAdmin
+ end
+ params do
+ requires :fingerprint, type: String, desc: 'Search for a SSH fingerprint'
+ end
+ get do
+ authenticated_with_full_private_access!
+
+ key = KeysFinder.new(current_user, params).execute
+
+ not_found!('Key') unless key
+ present key, with: Entities::SSHKeyWithUser, current_user: current_user
+ rescue KeysFinder::InvalidFingerprint
+ render_api_error!('Failed to return the key', 400)
+ end
end
end
end