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

activity_pub.rb « routes « config - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a967889a0ad4be2ead5e0ca0fe03de8423582da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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'
                post 'inbox'
              end
            end
          end
        end
      end
    end
  end
end