diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 15:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 15:08:47 +0300 |
commit | 5460c19548d3d3d2ff764ceff05c2b72aa2d3a32 (patch) | |
tree | 3a7fff116a7f6ff9c033e7f5e87a4341de801784 /app/controllers | |
parent | 2fe341d705700b3e99f82076b09b95885878ac0d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
25 files changed, 48 insertions, 0 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index a1bbcf34f69..14de8d6c6ab 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -2,6 +2,7 @@ class HelpController < ApplicationController skip_before_action :authenticate_user!, unless: :public_visibility_restricted? + feature_category :not_owned layout 'help' diff --git a/app/controllers/ide_controller.rb b/app/controllers/ide_controller.rb index 2c17f5b5542..8c0414ad5da 100644 --- a/app/controllers/ide_controller.rb +++ b/app/controllers/ide_controller.rb @@ -11,6 +11,8 @@ class IdeController < ApplicationController push_frontend_feature_flag(:schema_linting) end + feature_category :web_ide + def index Gitlab::UsageDataCounters::WebIdeCounter.increment_views_count end diff --git a/app/controllers/import/available_namespaces_controller.rb b/app/controllers/import/available_namespaces_controller.rb index 7983b4f20b5..c6211b33d28 100644 --- a/app/controllers/import/available_namespaces_controller.rb +++ b/app/controllers/import/available_namespaces_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class Import::AvailableNamespacesController < ApplicationController + feature_category :importers + def index render json: NamespaceSerializer.new.represent(current_user.manageable_groups_with_routes) end diff --git a/app/controllers/import/base_controller.rb b/app/controllers/import/base_controller.rb index 8a7a4c92b37..151ba46e629 100644 --- a/app/controllers/import/base_controller.rb +++ b/app/controllers/import/base_controller.rb @@ -4,6 +4,7 @@ class Import::BaseController < ApplicationController include ActionView::Helpers::SanitizeHelper before_action :import_rate_limit, only: [:create] + feature_category :importers def status respond_to do |format| diff --git a/app/controllers/import/bulk_imports_controller.rb b/app/controllers/import/bulk_imports_controller.rb index 58b9f8c0fbb..cad181f0d64 100644 --- a/app/controllers/import/bulk_imports_controller.rb +++ b/app/controllers/import/bulk_imports_controller.rb @@ -4,6 +4,8 @@ class Import::BulkImportsController < ApplicationController before_action :ensure_group_import_enabled before_action :verify_blocked_uri, only: :status + feature_category :importers + def configure session[access_token_key] = params[access_token_key]&.strip session[url_key] = params[url_key] diff --git a/app/controllers/import/gitlab_groups_controller.rb b/app/controllers/import/gitlab_groups_controller.rb index 330af68385e..d8118477a80 100644 --- a/app/controllers/import/gitlab_groups_controller.rb +++ b/app/controllers/import/gitlab_groups_controller.rb @@ -6,6 +6,8 @@ class Import::GitlabGroupsController < ApplicationController before_action :ensure_group_import_enabled before_action :import_rate_limit, only: %i[create] + feature_category :importers + def create unless file_is_valid?(group_params[:file]) return redirect_back_or_default(options: { alert: s_('GroupImport|Unable to process group import file') }) diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index 591ded7630c..c7b8486d1c9 100644 --- a/app/controllers/invites_controller.rb +++ b/app/controllers/invites_controller.rb @@ -12,6 +12,8 @@ class InvitesController < ApplicationController respond_to :html + feature_category :authentication_and_authorization + def show track_new_user_invite_experiment('opened') accept if skip_invitation_prompt? diff --git a/app/controllers/jira_connect/application_controller.rb b/app/controllers/jira_connect/application_controller.rb index a84f25998a6..9c311f92b69 100644 --- a/app/controllers/jira_connect/application_controller.rb +++ b/app/controllers/jira_connect/application_controller.rb @@ -7,6 +7,8 @@ class JiraConnect::ApplicationController < ApplicationController skip_before_action :verify_authenticity_token before_action :verify_atlassian_jwt! + feature_category :integrations + attr_reader :current_jira_installation private diff --git a/app/controllers/jwt_controller.rb b/app/controllers/jwt_controller.rb index 3e7755046cd..5199bb25c8c 100644 --- a/app/controllers/jwt_controller.rb +++ b/app/controllers/jwt_controller.rb @@ -8,6 +8,8 @@ class JwtController < ApplicationController # Add this before other actions, since we want to have the user or project prepend_before_action :auth_user, :authenticate_project_or_user + feature_category :authentication_and_authorization + SERVICES = { Auth::ContainerRegistryAuthenticationService::AUDIENCE => Auth::ContainerRegistryAuthenticationService }.freeze diff --git a/app/controllers/notification_settings_controller.rb b/app/controllers/notification_settings_controller.rb index e5d4a4bb073..7d8c035c852 100644 --- a/app/controllers/notification_settings_controller.rb +++ b/app/controllers/notification_settings_controller.rb @@ -3,6 +3,8 @@ class NotificationSettingsController < ApplicationController before_action :authenticate_user! + feature_category :users + def create return render_404 unless can_read?(resource) diff --git a/app/controllers/oauth/jira/authorizations_controller.rb b/app/controllers/oauth/jira/authorizations_controller.rb index f552b0dc10c..f23149c8544 100644 --- a/app/controllers/oauth/jira/authorizations_controller.rb +++ b/app/controllers/oauth/jira/authorizations_controller.rb @@ -8,6 +8,8 @@ class Oauth::Jira::AuthorizationsController < ApplicationController skip_before_action :authenticate_user! skip_before_action :verify_authenticity_token + feature_category :integrations + # 1. Rewire Jira OAuth initial request to our stablished OAuth authorization URL. def new session[:redirect_uri] = params['redirect_uri'] diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 2708e6669e7..c9791703413 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -11,6 +11,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController protect_from_forgery except: [:kerberos, :saml, :cas3, :failure], with: :exception, prepend: true + feature_category :authentication_and_authorization + def handle_omniauth omniauth_flow(Gitlab::Auth::OAuth) end diff --git a/app/controllers/registrations/experience_levels_controller.rb b/app/controllers/registrations/experience_levels_controller.rb index 38cffff91eb..eb2b899d20e 100644 --- a/app/controllers/registrations/experience_levels_controller.rb +++ b/app/controllers/registrations/experience_levels_controller.rb @@ -7,6 +7,8 @@ module Registrations before_action :check_experiment_enabled before_action :ensure_namespace_path_param + feature_category :navigation + def update current_user.experience_level = params[:experience_level] diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 204520a3e71..99b97bca73d 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -15,6 +15,8 @@ class RegistrationsController < Devise::RegistrationsController if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? } before_action :load_recaptcha, only: :new + feature_category :authentication_and_authorization + def new if experiment_enabled?(:signup_flow) track_experiment_event(:terms_opt_in, 'start') diff --git a/app/controllers/repositories/git_http_client_controller.rb b/app/controllers/repositories/git_http_client_controller.rb index e02955433b2..de452aa69b7 100644 --- a/app/controllers/repositories/git_http_client_controller.rb +++ b/app/controllers/repositories/git_http_client_controller.rb @@ -20,6 +20,8 @@ module Repositories prepend_before_action :authenticate_user, :parse_repo_path + feature_category :source_code_management + private def download_request? diff --git a/app/controllers/runner_setup_controller.rb b/app/controllers/runner_setup_controller.rb index 2cb204b729c..e0e9c5b7c23 100644 --- a/app/controllers/runner_setup_controller.rb +++ b/app/controllers/runner_setup_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class RunnerSetupController < ApplicationController + feature_category :continuous_integration + def platforms render json: Gitlab::Ci::RunnerInstructions::OS.merge(Gitlab::Ci::RunnerInstructions::OTHER_ENVIRONMENTS) end diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index b5e221a8894..5bc01cbb354 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -25,6 +25,8 @@ class SearchController < ApplicationController layout 'search' + feature_category :global_search + def show @project = search_service.project @group = search_service.group diff --git a/app/controllers/sent_notifications_controller.rb b/app/controllers/sent_notifications_controller.rb index 20134de81a0..db07b212d00 100644 --- a/app/controllers/sent_notifications_controller.rb +++ b/app/controllers/sent_notifications_controller.rb @@ -3,6 +3,8 @@ class SentNotificationsController < ApplicationController skip_before_action :authenticate_user! + feature_category :users + def unsubscribe @sent_notification = SentNotification.for(params[:id]) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 318553b5e0a..ae9744b224a 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -49,6 +49,8 @@ class SessionsController < Devise::SessionsController # token mismatch. protect_from_forgery with: :exception, prepend: true, except: :destroy + feature_category :authentication_and_authorization + CAPTCHA_HEADER = 'X-GitLab-Show-Login-Captcha' MAX_FAILED_LOGIN_ATTEMPTS = 5 diff --git a/app/controllers/snippets/application_controller.rb b/app/controllers/snippets/application_controller.rb index a533e46a75d..f259f4569ef 100644 --- a/app/controllers/snippets/application_controller.rb +++ b/app/controllers/snippets/application_controller.rb @@ -4,6 +4,8 @@ class Snippets::ApplicationController < ApplicationController include FindSnippet include SnippetAuthorizations + feature_category :snippets + private def authorize_read_snippet! diff --git a/app/controllers/snippets/notes_controller.rb b/app/controllers/snippets/notes_controller.rb index a7e8ef0798b..8532257cb8d 100644 --- a/app/controllers/snippets/notes_controller.rb +++ b/app/controllers/snippets/notes_controller.rb @@ -8,6 +8,8 @@ class Snippets::NotesController < ApplicationController before_action :authorize_read_snippet!, only: [:show, :index] before_action :authorize_create_note!, only: [:create] + feature_category :snippets + private def note diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index 9510734bc9b..6692c285335 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -25,6 +25,8 @@ class UploadsController < ApplicationController before_action :authorize_create_access!, only: [:create, :authorize] before_action :verify_workhorse_api!, only: [:authorize] + feature_category :not_owned + def uploader_class PersonalFileUploader end diff --git a/app/controllers/user_callouts_controller.rb b/app/controllers/user_callouts_controller.rb index 06f422b9d90..cfec9d6d905 100644 --- a/app/controllers/user_callouts_controller.rb +++ b/app/controllers/user_callouts_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class UserCalloutsController < ApplicationController + feature_category :navigation + def create callout = ensure_callout diff --git a/app/controllers/users/terms_controller.rb b/app/controllers/users/terms_controller.rb index 231e449f733..be670658048 100644 --- a/app/controllers/users/terms_controller.rb +++ b/app/controllers/users/terms_controller.rb @@ -14,6 +14,8 @@ module Users layout 'terms' + feature_category :users + def index @redirect = redirect_path diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e7af60beade..672f36dedc0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -21,6 +21,8 @@ class UsersController < ApplicationController before_action :authorize_read_user_profile!, only: [:calendar, :calendar_activities, :groups, :projects, :contributed_projects, :starred_projects, :snippets] + feature_category :users + def show respond_to do |format| format.html |