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 'config/routes/activity_pub.rb')
-rw-r--r--config/routes/activity_pub.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/config/routes/activity_pub.rb b/config/routes/activity_pub.rb
new file mode 100644
index 00000000000..f400d722e76
--- /dev/null
+++ b/config/routes/activity_pub.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+constraints(::Constraints::ActivityPubConstrainer.new) do
+ scope(module: 'activity_pub') do
+ constraints(::Constraints::ProjectUrlConstrainer.new) do
+ # Emulating route structure from routes/project.rb since we want to serve
+ # ActivityPub content with the proper "Accept" header to the same urls. See
+ # project routes file for rational behind this structure.
+ scope(
+ path: '*namespace_id',
+ as: :namespace,
+ namespace_id: Gitlab::PathRegex.full_namespace_route_regex
+ ) do
+ scope(
+ path: ':project_id',
+ constraints: { project_id: Gitlab::PathRegex.project_route_regex },
+ module: :projects,
+ as: :project
+ ) do
+ scope '-' do
+ resources :releases, only: :index do
+ collection do
+ get 'outbox'
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end