2018-10-15 09:59:00 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-08 07:56:54 -05:00
|
|
|
constraints(::Constraints::GroupUrlConstrainer.new) do
|
2017-10-20 09:39:01 -04:00
|
|
|
scope(path: 'groups/*id',
|
|
|
|
controller: :groups,
|
2018-05-31 10:01:04 -04:00
|
|
|
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom|ics)/ }) do
|
2017-10-27 05:29:51 -04:00
|
|
|
scope(path: '-') do
|
2020-07-23 14:10:06 -04:00
|
|
|
# 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
|
2020-10-19 02:09:08 -04:00
|
|
|
get :unfoldered_environment_names, as: :unfoldered_environment_names_group # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2020-04-09 08:09:24 -04:00
|
|
|
|
2019-09-18 10:02:45 -04:00
|
|
|
# TODO: Remove as part of refactor in https://gitlab.com/gitlab-org/gitlab-foss/issues/49693
|
2020-07-23 14:10:06 -04:00
|
|
|
get 'shared', action: :show, as: :group_shared # rubocop:disable Cop/PutGroupRoutesUnderScope
|
|
|
|
get 'archived', action: :show, as: :group_archived # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2017-10-27 05:29:51 -04:00
|
|
|
end
|
|
|
|
|
2020-09-02 08:10:35 -04:00
|
|
|
get '/', action: :show, as: :group_canonical
|
2016-10-05 08:21:27 -04:00
|
|
|
end
|
2016-11-07 08:34:25 -05:00
|
|
|
|
2017-10-27 05:29:51 -04:00
|
|
|
scope(path: 'groups/*group_id/-',
|
2017-10-20 09:39:01 -04:00
|
|
|
module: :groups,
|
|
|
|
as: :group,
|
|
|
|
constraints: { group_id: Gitlab::PathRegex.full_namespace_route_regex }) do
|
2017-10-27 05:29:51 -04:00
|
|
|
namespace :settings do
|
2019-10-14 11:06:07 -04:00
|
|
|
resource :ci_cd, only: [:show, :update], controller: 'ci_cd' do
|
2018-09-10 17:57:03 -04:00
|
|
|
put :reset_registration_token
|
2019-03-12 06:15:33 -04:00
|
|
|
patch :update_auto_devops
|
2020-04-21 11:21:10 -04:00
|
|
|
post :create_deploy_token, path: 'deploy_token/create', to: 'repository#create_deploy_token'
|
2020-09-30 17:10:09 -04:00
|
|
|
get :runner_setup_scripts, format: :json
|
2020-04-21 11:21:10 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
resource :repository, only: [:show], controller: 'repository' do
|
2020-02-28 13:09:07 -05:00
|
|
|
post :create_deploy_token, path: 'deploy_token/create'
|
2018-09-10 17:57:03 -04:00
|
|
|
end
|
2022-01-17 07:17:11 -05:00
|
|
|
|
|
|
|
resources :access_tokens, only: [:index, :create] do
|
|
|
|
member do
|
|
|
|
put :revoke
|
|
|
|
end
|
|
|
|
end
|
2020-03-26 02:08:40 -04:00
|
|
|
|
|
|
|
resources :integrations, only: [:index, :edit, :update] do
|
|
|
|
member do
|
|
|
|
put :test
|
2020-12-02 19:09:53 -05:00
|
|
|
post :reset
|
2020-03-26 02:08:40 -04:00
|
|
|
end
|
|
|
|
end
|
2021-01-18 07:10:41 -05:00
|
|
|
|
2021-03-16 14:11:53 -04:00
|
|
|
resources :applications
|
|
|
|
|
2021-05-06 08:10:38 -04:00
|
|
|
resource :packages_and_registries, only: [:show]
|
2017-10-27 05:29:51 -04:00
|
|
|
end
|
2017-10-11 12:27:53 -04:00
|
|
|
|
2018-01-29 12:54:16 -05:00
|
|
|
resource :variables, only: [:show, :update]
|
2016-11-07 08:34:25 -05:00
|
|
|
|
2017-10-27 05:29:51 -04:00
|
|
|
resources :children, only: [:index]
|
2018-05-24 10:58:48 -04:00
|
|
|
resources :shared_projects, only: [:index]
|
2017-10-26 10:10:03 -04:00
|
|
|
|
2017-10-27 05:29:51 -04:00
|
|
|
resources :labels, except: [:show] do
|
|
|
|
post :toggle_subscription, on: :member
|
|
|
|
end
|
2017-10-26 11:49:07 -04:00
|
|
|
|
2022-01-14 07:18:55 -05:00
|
|
|
resources :packages, only: [:index, :show]
|
2020-07-21 08:09:30 -04:00
|
|
|
|
2018-08-06 15:02:52 -04:00
|
|
|
resources :milestones, constraints: { id: %r{[^/]+} } do
|
2017-10-27 05:29:51 -04:00
|
|
|
member do
|
2020-09-18 14:10:26 -04:00
|
|
|
get :issues
|
2017-10-27 05:29:51 -04:00
|
|
|
get :merge_requests
|
|
|
|
get :participants
|
|
|
|
get :labels
|
2017-10-26 11:49:07 -04:00
|
|
|
end
|
2017-10-27 05:29:51 -04:00
|
|
|
end
|
2017-10-26 11:49:07 -04:00
|
|
|
|
2020-08-12 08:10:25 -04:00
|
|
|
resources :releases, only: [:index]
|
|
|
|
|
2020-02-28 13:09:07 -05:00
|
|
|
resources :deploy_tokens, constraints: { id: /\d+/ }, only: [] do
|
|
|
|
member do
|
|
|
|
put :revoke
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-10-27 05:29:51 -04:00
|
|
|
resource :avatar, only: [:destroy]
|
2020-06-14 20:08:43 -04:00
|
|
|
resource :import, only: [:show]
|
2017-10-26 11:49:07 -04:00
|
|
|
|
2018-10-22 23:51:29 -04:00
|
|
|
concerns :clusterable
|
|
|
|
|
2022-03-09 19:08:36 -05:00
|
|
|
resources :group_members, only: [:index, :update, :destroy], concerns: :access_requestable do
|
2017-10-27 05:29:51 -04:00
|
|
|
post :resend_invite, on: :member
|
|
|
|
delete :leave, on: :collection
|
2017-10-20 09:39:01 -04:00
|
|
|
end
|
2017-12-06 06:36:11 -05:00
|
|
|
|
2022-03-22 11:07:25 -04:00
|
|
|
resources :group_links, only: [:update, :destroy], constraints: { id: /\d+|:id/ }
|
2019-10-30 11:14:17 -04:00
|
|
|
|
2017-12-06 06:36:11 -05:00
|
|
|
resources :uploads, only: [:create] do
|
|
|
|
collection do
|
2020-01-13 04:08:03 -05:00
|
|
|
get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} }, format: false, defaults: { format: nil }
|
2018-06-12 11:54:37 -04:00
|
|
|
post :authorize
|
2017-12-06 06:36:11 -05:00
|
|
|
end
|
|
|
|
end
|
2018-02-19 14:06:16 -05:00
|
|
|
|
2019-02-27 08:08:48 -05:00
|
|
|
resources :boards, only: [:index, :show], constraints: { id: /\d+/ }
|
2018-04-10 00:29:06 -04:00
|
|
|
|
|
|
|
resources :runners, only: [:index, :edit, :update, :destroy, :show] do
|
|
|
|
member do
|
|
|
|
post :resume
|
|
|
|
post :pause
|
|
|
|
end
|
|
|
|
end
|
2019-10-17 08:07:33 -04:00
|
|
|
|
2020-02-06 16:08:48 -05:00
|
|
|
resources :container_registries, only: [:index, :show], controller: 'registry/repositories'
|
2020-11-13 16:09:31 -05:00
|
|
|
resource :dependency_proxy, only: [:show, :update]
|
2021-02-01 10:08:56 -05:00
|
|
|
resources :email_campaigns, only: :index
|
2021-05-06 08:10:38 -04:00
|
|
|
|
2022-09-11 14:10:42 -04:00
|
|
|
resources :observability, only: :index
|
|
|
|
|
2022-07-13 20:08:59 -04:00
|
|
|
namespace :harbor do
|
2022-09-01 14:09:55 -04:00
|
|
|
resources :repositories, only: [:index, :show], constraints: { id: %r{[a-zA-Z./:0-9_\-]+} } do
|
2022-07-13 20:08:59 -04:00
|
|
|
resources :artifacts, only: [:index] do
|
|
|
|
resources :tags, only: [:index]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-05-06 08:10:38 -04:00
|
|
|
resources :autocomplete_sources, only: [] do
|
|
|
|
collection do
|
|
|
|
get 'members'
|
|
|
|
get 'issues'
|
|
|
|
get 'merge_requests'
|
|
|
|
get 'labels'
|
|
|
|
get 'commands'
|
|
|
|
get 'milestones'
|
|
|
|
end
|
|
|
|
end
|
2021-10-29 20:10:32 -04:00
|
|
|
|
2021-12-03 07:10:23 -05:00
|
|
|
namespace :crm do
|
2021-12-15 19:15:50 -05:00
|
|
|
resources :contacts, only: [:index, :new, :edit]
|
2022-03-31 17:08:16 -04:00
|
|
|
resources :organizations, only: [:index, :new, :edit]
|
2021-10-29 20:10:32 -04:00
|
|
|
end
|
2017-10-20 09:39:01 -04:00
|
|
|
end
|
2017-05-24 16:59:26 -04:00
|
|
|
|
|
|
|
scope(path: '*id',
|
|
|
|
as: :group,
|
|
|
|
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ },
|
|
|
|
controller: :groups) do
|
2020-09-02 08:10:35 -04:00
|
|
|
get '/', action: :show
|
|
|
|
patch '/', action: :update
|
|
|
|
put '/', action: :update
|
|
|
|
delete '/', action: :destroy
|
2017-05-24 16:59:26 -04:00
|
|
|
end
|
|
|
|
end
|
2020-11-13 16:09:31 -05:00
|
|
|
|
|
|
|
# Dependency proxy for containers
|
|
|
|
# Because docker adds v2 prefix to URI this need to be outside of usual group routes
|
|
|
|
scope format: false do
|
2020-12-03 13:10:10 -05:00
|
|
|
get 'v2' => 'groups/dependency_proxy_auth#authenticate' # rubocop:disable Cop/PutGroupRoutesUnderScope
|
2020-11-13 16:09:31 -05:00
|
|
|
|
|
|
|
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
|
2021-10-15 11:10:09 -04:00
|
|
|
post 'v2/*group_id/dependency_proxy/containers/*image/blobs/:sha/upload/authorize' => 'groups/dependency_proxy_for_containers#authorize_upload_blob' # rubocop:todo Cop/PutGroupRoutesUnderScope
|
|
|
|
post 'v2/*group_id/dependency_proxy/containers/*image/blobs/:sha/upload' => 'groups/dependency_proxy_for_containers#upload_blob' # rubocop:todo Cop/PutGroupRoutesUnderScope
|
2021-11-04 05:12:56 -04:00
|
|
|
post 'v2/*group_id/dependency_proxy/containers/*image/manifests/*tag/upload/authorize' => 'groups/dependency_proxy_for_containers#authorize_upload_manifest' # rubocop:todo Cop/PutGroupRoutesUnderScope
|
|
|
|
post 'v2/*group_id/dependency_proxy/containers/*image/manifests/*tag/upload' => 'groups/dependency_proxy_for_containers#upload_manifest' # rubocop:todo Cop/PutGroupRoutesUnderScope
|
2020-11-13 16:09:31 -05:00
|
|
|
end
|
|
|
|
end
|