Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/activity_pub/projects/releases_controller.rb')
-rw-r--r--app/controllers/activity_pub/projects/releases_controller.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/controllers/activity_pub/projects/releases_controller.rb b/app/controllers/activity_pub/projects/releases_controller.rb
new file mode 100644
index 00000000000..7c4c2a0322b
--- /dev/null
+++ b/app/controllers/activity_pub/projects/releases_controller.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module ActivityPub
+ module Projects
+ class ReleasesController < ApplicationController
+ feature_category :release_orchestration
+
+ def index
+ opts = {
+ inbox: nil,
+ outbox: outbox_project_releases_url(@project)
+ }
+
+ render json: ActivityPub::ReleasesActorSerializer.new.represent(@project, opts)
+ end
+
+ def outbox
+ serializer = ActivityPub::ReleasesOutboxSerializer.new.with_pagination(request, response)
+ render json: serializer.represent(releases)
+ end
+
+ private
+
+ def releases(params = {})
+ ReleasesFinder.new(@project, current_user, params).execute
+ end
+ end
+ end
+end