summaryrefslogtreecommitdiff
path: root/lib/api/keys.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-17 09:07:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-17 09:07:48 +0000
commit5bd24a54ef4ce3a38a860eb53b66d062c2382971 (patch)
tree5f5e65571dfcb2c62c27600ee7655dec4b44c923 /lib/api/keys.rb
parent74673d04d25ffed35cbcf17cd42969bed0a4e705 (diff)
downloadgitlab-ce-5bd24a54ef4ce3a38a860eb53b66d062c2382971.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/keys.rb')
-rw-r--r--lib/api/keys.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/keys.rb b/lib/api/keys.rb
index 8f2fd8cbae2..8f837107192 100644
--- a/lib/api/keys.rb
+++ b/lib/api/keys.rb
@@ -24,9 +24,11 @@ module API
requires :fingerprint, type: String, desc: 'Search for a SSH fingerprint'
end
get do
- authenticated_with_full_private_access!
+ authenticated_with_can_read_all_resources!
- key = KeysFinder.new(current_user, params).execute
+ finder_params = params.merge(key_type: 'ssh')
+
+ key = KeysFinder.new(current_user, finder_params).execute
not_found!('Key') unless key
present key, with: Entities::SSHKeyWithUser, current_user: current_user