From b62445813dffec92e85540ed081e4d6e12d58dc0 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Fri, 21 Sep 2012 04:49:28 -0700 Subject: API: SSH keys belong to user entity --- lib/api/keys.rb | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 lib/api/keys.rb (limited to 'lib/api/keys.rb') diff --git a/lib/api/keys.rb b/lib/api/keys.rb deleted file mode 100644 index 4c302727c4f..00000000000 --- a/lib/api/keys.rb +++ /dev/null @@ -1,50 +0,0 @@ -module Gitlab - # Keys API - class Keys < Grape::API - before { authenticate! } - resource :keys do - # Get currently authenticated user's keys - # - # Example Request: - # GET /keys - get do - present current_user.keys, with: Entities::Key - end - # Get single key owned by currently authenticated user - # - # Example Request: - # GET /keys/:id - get "/:id" do - key = current_user.keys.find params[:id] - present key, with: Entities::Key - end - # Add new ssh key to currently authenticated user - # - # Parameters: - # key (required) - New SSH Key - # title (required) - New SSH Key's title - # Example Request: - # POST /keys - post do - attrs = attributes_for_keys [:title, :key] - key = current_user.keys.new attrs - if key.save - present key, with: Entities::Key - else - not_found! - end - end - # Delete existed ssh key of currently authenticated user - # - # Parameters: - # id (required) - SSH Key ID - # Example Request: - # DELETE /keys/:id - delete "/:id" do - key = current_user.keys.find params[:id] - key.delete - end - end - end -end - -- cgit v1.2.1