2015-08-29 05:52:21 -04:00
|
|
|
module API
|
|
|
|
# Keys API
|
|
|
|
class Keys < Grape::API
|
|
|
|
before { authenticate! }
|
|
|
|
|
|
|
|
resource :keys do
|
2016-09-13 14:55:00 -04:00
|
|
|
desc 'Get single ssh key by id. Only available to admin users' do
|
|
|
|
success Entities::SSHKeyWithUser
|
|
|
|
end
|
2015-08-29 05:52:21 -04:00
|
|
|
get ":id" do
|
|
|
|
authenticated_as_admin!
|
|
|
|
|
|
|
|
key = Key.find(params[:id])
|
|
|
|
|
|
|
|
present key, with: Entities::SSHKeyWithUser
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|