diff options
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/admin.rb | 2 | ||||
-rw-r--r-- | config/routes/api.rb | 2 | ||||
-rw-r--r-- | config/routes/dashboard.rb | 2 | ||||
-rw-r--r-- | config/routes/development.rb | 2 | ||||
-rw-r--r-- | config/routes/explore.rb | 2 | ||||
-rw-r--r-- | config/routes/git_http.rb | 6 | ||||
-rw-r--r-- | config/routes/google_api.rb | 2 | ||||
-rw-r--r-- | config/routes/group.rb | 1 | ||||
-rw-r--r-- | config/routes/help.rb | 2 | ||||
-rw-r--r-- | config/routes/import.rb | 2 | ||||
-rw-r--r-- | config/routes/legacy_builds.rb | 2 | ||||
-rw-r--r-- | config/routes/merge_requests.rb | 1 | ||||
-rw-r--r-- | config/routes/project.rb | 13 | ||||
-rw-r--r-- | config/routes/repository.rb | 2 | ||||
-rw-r--r-- | config/routes/sherlock.rb | 2 | ||||
-rw-r--r-- | config/routes/sidekiq.rb | 2 | ||||
-rw-r--r-- | config/routes/snippets.rb | 2 | ||||
-rw-r--r-- | config/routes/uploads.rb | 2 | ||||
-rw-r--r-- | config/routes/user.rb | 4 | ||||
-rw-r--r-- | config/routes/wiki.rb | 2 |
20 files changed, 51 insertions, 4 deletions
diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 71a927f59b9..3e04f0d97cb 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :admin do resources :users, constraints: { id: %r{[a-zA-Z./0-9_\-]+} } do resources :keys, only: [:show, :destroy] diff --git a/config/routes/api.rb b/config/routes/api.rb index 5dbfcc98f0f..dcbc98991e2 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + post '/api/graphql', to: 'graphql#execute' mount GraphiQL::Rails::Engine, at: '/-/graphql-explorer', graphql_path: Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, '/api/graphql') diff --git a/config/routes/dashboard.rb b/config/routes/dashboard.rb index 7e29a36f020..6a3aa5ff0c1 100644 --- a/config/routes/dashboard.rb +++ b/config/routes/dashboard.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + resource :dashboard, controller: 'dashboard', only: [] do get :issues, action: :issues_calendar, constraints: lambda { |req| req.format == :ics } get :issues diff --git a/config/routes/development.rb b/config/routes/development.rb index 9b2b47c6a21..4ea53e14120 100644 --- a/config/routes/development.rb +++ b/config/routes/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if Rails.env.development? # Make the built-in Rails routes available in development, otherwise they'd # get swallowed by the `namespace/project` route matcher below. diff --git a/config/routes/explore.rb b/config/routes/explore.rb index 59b53bdcf42..c6bf98b6fb3 100644 --- a/config/routes/explore.rb +++ b/config/routes/explore.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :explore do resources :projects, only: [:index] do collection do diff --git a/config/routes/git_http.rb b/config/routes/git_http.rb index 715d4b5cc59..6899a89cc7d 100644 --- a/config/routes/git_http.rb +++ b/config/routes/git_http.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + scope(path: '*repository_path', format: false) do constraints(repository_path: Gitlab::PathRegex.repository_git_route_regex) do scope(module: :repositories) do @@ -42,7 +44,7 @@ scope(path: '*repository_path', format: false) do wiki_redirect = redirect do |params, request| container_path = params[:repository_path].delete_suffix('.wiki.git') path = File.join(container_path, '-', 'wikis') - path << "?#{request.query_string}" unless request.query_string.blank? + path += "?#{request.query_string}" unless request.query_string.blank? path end @@ -54,7 +56,7 @@ scope(path: '*repository_path', format: false) do constraints(repository_path: Gitlab::PathRegex.repository_route_regex) do ref_redirect = redirect do |params, request| path = "#{params[:repository_path]}.git/info/refs" - path << "?#{request.query_string}" unless request.query_string.blank? + path += "?#{request.query_string}" unless request.query_string.blank? path end diff --git a/config/routes/google_api.rb b/config/routes/google_api.rb index a119b47c176..06f8d988072 100644 --- a/config/routes/google_api.rb +++ b/config/routes/google_api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + scope '-' do namespace :google_api do resource :auth, only: [], controller: :authorizations do diff --git a/config/routes/group.rb b/config/routes/group.rb index 012d5926872..e1ae860f6ec 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -111,6 +111,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do resources :container_registries, only: [:index, :show], controller: 'registry/repositories' resource :dependency_proxy, only: [:show, :update] + resources :email_campaigns, only: :index end scope(path: '*id', diff --git a/config/routes/help.rb b/config/routes/help.rb index 446310ba314..2a0aba8b632 100644 --- a/config/routes/help.rb +++ b/config/routes/help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + get 'help' => 'help#index' get 'help/shortcuts' => 'help#shortcuts' get 'help/instance_configuration' => 'help#instance_configuration' diff --git a/config/routes/import.rb b/config/routes/import.rb index 5f94fb8d058..64830ef1e52 100644 --- a/config/routes/import.rb +++ b/config/routes/import.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Alias import callbacks under the /users/auth endpoint so that # the OAuth2 callback URL can be restricted under http://example.com/users/auth # instead of http://example.com. diff --git a/config/routes/legacy_builds.rb b/config/routes/legacy_builds.rb index 5ab2b953ce1..c08b581e101 100644 --- a/config/routes/legacy_builds.rb +++ b/config/routes/legacy_builds.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + resources :builds, only: [:index, :show], constraints: { id: /\d+/ } do collection do resources :artifacts, only: [], controller: 'build_artifacts' do diff --git a/config/routes/merge_requests.rb b/config/routes/merge_requests.rb index 41d831f239e..b0bab1717a6 100644 --- a/config/routes/merge_requests.rb +++ b/config/routes/merge_requests.rb @@ -18,6 +18,7 @@ resources :merge_requests, concerns: :awardable, except: [:new, :create, :show], get :coverage_reports get :terraform_reports get :codequality_reports + get :codequality_mr_diff_reports scope constraints: ->(req) { req.format == :json }, as: :json do get :commits diff --git a/config/routes/project.rb b/config/routes/project.rb index 2e61bc8175e..21dfe173715 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -37,6 +37,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + namespace :security do + resource :configuration, only: [:show], controller: :configuration + end + resources :artifacts, only: [:index, :destroy] resources :packages, only: [:index, :show, :destroy], module: :packages @@ -83,10 +87,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + get :learn_gitlab, action: :index, controller: 'learn_gitlab' + namespace :ci do resource :lint, only: [:show, :create] resource :pipeline_editor, only: [:show], controller: :pipeline_editor, path: 'editor' resources :daily_build_group_report_results, only: [:index], constraints: { format: /(csv|json)/ } + namespace :prometheus_metrics do + resources :histograms, only: [:create], constraints: { format: 'json' } + end end namespace :settings do @@ -132,7 +141,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - resources :project_members, except: [:show, :new, :edit], constraints: { id: %r{[a-zA-Z./0-9_\-#%+]+} }, concerns: :access_requestable do + resources :project_members, except: [:show, :new, :edit], constraints: { id: %r{[a-zA-Z./0-9_\-#%+:]+} }, concerns: :access_requestable do collection do delete :leave @@ -219,7 +228,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resources :starrers, only: [:index] resources :forks, only: [:index, :new, :create] - resources :group_links, only: [:create, :update, :destroy], constraints: { id: /\d+/ } + resources :group_links, only: [:create, :update, :destroy], constraints: { id: /\d+|:id/ } resource :import, only: [:new, :create, :show] resource :avatar, only: [:show, :destroy] diff --git a/config/routes/repository.rb b/config/routes/repository.rb index 43837f2ce34..61a407d5a35 100644 --- a/config/routes/repository.rb +++ b/config/routes/repository.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # All routing related to repository browsing resource :repository, only: [:create] do diff --git a/config/routes/sherlock.rb b/config/routes/sherlock.rb index c9969f91c36..a9be434dba7 100644 --- a/config/routes/sherlock.rb +++ b/config/routes/sherlock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if Gitlab::Sherlock.enabled? namespace :sherlock do resources :transactions, only: [:index, :show] do diff --git a/config/routes/sidekiq.rb b/config/routes/sidekiq.rb index 36ec8bc1d54..5f6755fc3b3 100644 --- a/config/routes/sidekiq.rb +++ b/config/routes/sidekiq.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + constraints ::Constraints::AdminConstrainer.new do mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq end diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index 9e0c42fa07d..5c162d0c37f 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + resources :snippets, except: [:create, :update, :destroy], concerns: :awardable, constraints: { id: /\d+/ } do member do get :raw diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index fb8af76397c..71a868175a9 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + scope path: :uploads do # Note attachments and User/Group/Project avatars get "-/system/:model/:mounted_as/:id/:filename", diff --git a/config/routes/user.rb b/config/routes/user.rb index 515a9a23360..41319b6d730 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -46,9 +46,13 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get :contributed, as: :contributed_projects get :starred, as: :starred_projects get :snippets + get :followers + get :following get :exists get :suggests get :activity + post :follow + post :unfollow get '/', to: redirect('%{username}'), as: nil end end diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb index 49ad39e8369..4d14743b3d3 100644 --- a/config/routes/wiki.rb +++ b/config/routes/wiki.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + scope(controller: :wikis) do scope(path: 'wikis', as: :wikis) do get :git_access |