summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/applications.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/applications.rb b/lib/api/applications.rb
index f29cd7fc003..1c940af95d7 100644
--- a/lib/api/applications.rb
+++ b/lib/api/applications.rb
@@ -24,6 +24,23 @@ module API
render_validation_error! application
end
end
+
+ desc 'Get applications' do
+ success Entities::ApplicationWithSecret
+ end
+ get do
+ applications = Doorkeeper::Application.all
+ present applications, with: Entities::Application
+ end
+
+ # rubocop: disable CodeReuse/ActiveRecord
+ desc 'Delete an application'
+ delete ':id' do
+ Doorkeeper::Application.find_by(id: params[:id]).destroy
+
+ status 204
+ end
+ # rubocop: enable CodeReuse/ActiveRecord
end
end
end