summaryrefslogtreecommitdiff
path: root/lib/api/keys.rb
blob: 2b723b7950472014dcb7d6c376edb27f8881307b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module API
  # Keys API
  class Keys < Grape::API
    before { authenticate! }

    resource :keys do
      # Get single ssh key by id. Only available to admin users.
      #
      # Example Request:
      #   GET /keys/:id
      get ":id" do
        authenticated_as_admin!

        key = Key.find(params[:id])

        present key, with: Entities::SSHKeyWithUser
      end
    end
  end
end