debian-mirror-gitlab/lib/api/keys.rb

20 lines
422 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
module API
# Keys API
class Keys < Grape::API
before { authenticate! }
resource :keys do
2016-11-03 12:29:30 +05:30
desc 'Get single ssh key by id. Only available to admin users' do
success Entities::SSHKeyWithUser
end
2015-09-25 12:07:36 +05:30
get ":id" do
authenticated_as_admin!
key = Key.find(params[:id])
2018-11-18 11:00:15 +05:30
present key, with: Entities::SSHKeyWithUser, current_user: current_user
2015-09-25 12:07:36 +05:30
end
end
end
end