2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
constraints(::Constraints::GroupUrlConstrainer.new) do
|
2018-03-17 18:26:18 +05:30
|
|
|
scope(path: 'groups/*id',
|
|
|
|
controller: :groups,
|
2018-11-08 19:23:39 +05:30
|
|
|
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom|ics)/ }) do
|
2018-03-17 18:26:18 +05:30
|
|
|
scope(path: '-') do
|
2020-10-24 23:57:45 +05:30
|
|
|
# These routes are legit and the cop rule will be improved in
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/230703
|
|
|
|
get :edit, as: :edit_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :issues, as: :issues_group_calendar, action: :issues_calendar, constraints: lambda { |req| req.format == :ics } # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :issues, as: :issues_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :merge_requests, as: :merge_requests_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :projects, as: :projects_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :details, as: :details_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :activity, as: :activity_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
put :transfer, as: :transfer_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
post :export, as: :export_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get :download_export, as: :download_export_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2021-01-03 14:25:43 +05:30
|
|
|
get :unfoldered_environment_names, as: :unfoldered_environment_names_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
# TODO: Remove as part of refactor in https://gitlab.com/gitlab-org/gitlab-foss/issues/49693
|
2020-10-24 23:57:45 +05:30
|
|
|
get 'shared', action: :show, as: :group_shared # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get 'archived', action: :show, as: :group_archived # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
get '/', action: :show, as: :group_canonical
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
scope(path: 'groups/*group_id/-',
|
|
|
|
module: :groups,
|
|
|
|
as: :group,
|
|
|
|
constraints: { group_id: Gitlab::PathRegex.full_namespace_route_regex }) do
|
2017-09-10 17:25:29 +05:30
|
|
|
namespace :settings do
|
2019-12-21 20:55:43 +05:30
|
|
|
resource :ci_cd, only: [:show, :update], controller: 'ci_cd' do
|
2018-12-05 23:21:45 +05:30
|
|
|
put :reset_registration_token
|
2019-07-07 11:18:12 +05:30
|
|
|
patch :update_auto_devops
|
2020-04-25 10:58:03 +05:30
|
|
|
post :create_deploy_token, path: 'deploy_token/create', to: 'repository#create_deploy_token'
|
2021-01-03 14:25:43 +05:30
|
|
|
get :runner_setup_scripts, format: :json
|
2020-04-25 10:58:03 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
resource :repository, only: [:show], controller: 'repository' do
|
2020-04-08 14:13:33 +05:30
|
|
|
post :create_deploy_token, path: 'deploy_token/create'
|
2018-12-05 23:21:45 +05:30
|
|
|
end
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
resources :integrations, only: [:index, :edit, :update] do
|
|
|
|
member do
|
|
|
|
put :test
|
2021-02-22 17:27:13 +05:30
|
|
|
post :reset
|
2020-04-22 19:07:51 +05:30
|
|
|
end
|
|
|
|
end
|
2021-03-08 18:12:59 +05:30
|
|
|
|
|
|
|
resources :packages_and_registries, only: [:index]
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
resource :variables, only: [:show, :update]
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
resources :children, only: [:index]
|
2018-11-08 19:23:39 +05:30
|
|
|
resources :shared_projects, only: [:index]
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
resources :labels, except: [:show] do
|
|
|
|
post :toggle_subscription, on: :member
|
|
|
|
end
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
resources :packages, only: [:index]
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
resources :milestones, constraints: { id: %r{[^/]+} } do
|
2018-03-17 18:26:18 +05:30
|
|
|
member do
|
2021-01-03 14:25:43 +05:30
|
|
|
get :issues
|
2018-03-17 18:26:18 +05:30
|
|
|
get :merge_requests
|
|
|
|
get :participants
|
|
|
|
get :labels
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
resources :releases, only: [:index]
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
resources :deploy_tokens, constraints: { id: /\d+/ }, only: [] do
|
|
|
|
member do
|
|
|
|
put :revoke
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
resource :avatar, only: [:destroy]
|
2020-06-23 00:09:42 +05:30
|
|
|
resource :import, only: [:show]
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
concerns :clusterable
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
|
|
|
|
post :resend_invite, on: :member
|
|
|
|
delete :leave, on: :collection
|
|
|
|
end
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
resources :group_links, only: [:create, :update, :destroy], constraints: { id: /\d+|:id/ }
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
resources :uploads, only: [:create] do
|
|
|
|
collection do
|
2020-03-13 15:44:24 +05:30
|
|
|
get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} }, format: false, defaults: { format: nil }
|
2018-11-08 19:23:39 +05:30
|
|
|
post :authorize
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
resources :boards, only: [:index, :show], constraints: { id: /\d+/ }
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
resources :runners, only: [:index, :edit, :update, :destroy, :show] do
|
|
|
|
member do
|
|
|
|
post :resume
|
|
|
|
post :pause
|
|
|
|
end
|
|
|
|
end
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
resources :container_registries, only: [:index, :show], controller: 'registry/repositories'
|
2021-01-29 00:20:46 +05:30
|
|
|
resource :dependency_proxy, only: [:show, :update]
|
2021-03-11 19:13:27 +05:30
|
|
|
resources :email_campaigns, only: :index
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
scope(path: '*id',
|
|
|
|
as: :group,
|
|
|
|
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ },
|
|
|
|
controller: :groups) do
|
2020-11-24 15:15:51 +05:30
|
|
|
get '/', action: :show
|
|
|
|
patch '/', action: :update
|
|
|
|
put '/', action: :update
|
|
|
|
delete '/', action: :destroy
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
|
|
|
|
# Dependency proxy for containers
|
|
|
|
# Because docker adds v2 prefix to URI this need to be outside of usual group routes
|
|
|
|
scope format: false do
|
2021-02-22 17:27:13 +05:30
|
|
|
get 'v2' => 'groups/dependency_proxy_auth#authenticate' # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2021-01-29 00:20:46 +05:30
|
|
|
|
|
|
|
constraints image: Gitlab::PathRegex.container_image_regex, sha: Gitlab::PathRegex.container_image_blob_sha_regex do
|
|
|
|
get 'v2/*group_id/dependency_proxy/containers/*image/manifests/*tag' => 'groups/dependency_proxy_for_containers#manifest' # rubocop:todo Cop/PutGroupRoutesUnderScope
|
|
|
|
get 'v2/*group_id/dependency_proxy/containers/*image/blobs/:sha' => 'groups/dependency_proxy_for_containers#blob' # rubocop:todo Cop/PutGroupRoutesUnderScope
|
|
|
|
end
|
|
|
|
end
|