diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-11 18:08:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-11 18:08:10 +0000 |
commit | 175b4fa261259ab0d033482d10bb4159fee8e538 (patch) | |
tree | e1f1dba5e41177f11ffded5a505e0e7f692b8df5 /lib/api | |
parent | 4eea104c69e59f6fa53c7bc15b986c69f29b60c8 (diff) | |
download | gitlab-ce-175b4fa261259ab0d033482d10bb4159fee8e538.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/keys.rb | 17 |
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 |