diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-01-25 09:47:36 +0000 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-01-25 10:00:17 +0000 |
commit | 4903ff93971d28723ed9d81f7dae2ad2a1d5586a (patch) | |
tree | 8f6f5cbc302f0820c1ffd0c85528388fd33bb8d7 /lib/api/applications.rb | |
parent | 3805cd7ac5e1c9b286bfba667ef45972eab4d084 (diff) | |
parent | 944c1eb684fe979339262ba6e9f7bf9e1b77fc81 (diff) | |
download | gitlab-ce-13931-custom-emoji-implementation.tar.gz |
Merge branch 'master' into 13931-custom-emoji-implementation13931-custom-emoji-implementation
Conflicts:
app/assets/javascripts/dispatcher.js
app/assets/javascripts/pages/projects/shared/project_avatar.js
Diffstat (limited to 'lib/api/applications.rb')
-rw-r--r-- | lib/api/applications.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/api/applications.rb b/lib/api/applications.rb new file mode 100644 index 00000000000..b122cdefe4e --- /dev/null +++ b/lib/api/applications.rb @@ -0,0 +1,27 @@ +module API + # External applications API + class Applications < Grape::API + before { authenticated_as_admin! } + + resource :applications do + desc 'Create a new application' do + detail 'This feature was introduced in GitLab 10.5' + success Entities::ApplicationWithSecret + end + params do + requires :name, type: String, desc: 'Application name' + requires :redirect_uri, type: String, desc: 'Application redirect URI' + requires :scopes, type: String, desc: 'Application scopes' + end + post do + application = Doorkeeper::Application.new(declared_params) + + if application.save + present application, with: Entities::ApplicationWithSecret + else + render_validation_error! application + end + end + end + end +end |