diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /app/controllers/concerns | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'app/controllers/concerns')
10 files changed, 22 insertions, 16 deletions
diff --git a/app/controllers/concerns/authenticates_with_two_factor.rb b/app/controllers/concerns/authenticates_with_two_factor.rb index 14dcec33545..4228a93d310 100644 --- a/app/controllers/concerns/authenticates_with_two_factor.rb +++ b/app/controllers/concerns/authenticates_with_two_factor.rb @@ -23,9 +23,9 @@ module AuthenticatesWithTwoFactor session[:otp_user_id] = user.id session[:user_password_hash] = Digest::SHA256.hexdigest(user.encrypted_password) - push_frontend_feature_flag(:webauthn, default_enabled: :yaml) + push_frontend_feature_flag(:webauthn) - if Feature.enabled?(:webauthn, default_enabled: :yaml) + if Feature.enabled?(:webauthn) setup_webauthn_authentication(user) else setup_u2f_authentication(user) diff --git a/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb b/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb index 05be04059fd..574fc6c0f37 100644 --- a/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb +++ b/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb @@ -11,7 +11,7 @@ module AuthenticatesWithTwoFactorForAdminMode return handle_locked_user(user) unless user.can?(:log_in) session[:otp_user_id] = user.id - push_frontend_feature_flag(:webauthn, default_enabled: :yaml) + push_frontend_feature_flag(:webauthn) if user.two_factor_webauthn_enabled? setup_webauthn_authentication(user) diff --git a/app/controllers/concerns/dependency_proxy/group_access.rb b/app/controllers/concerns/dependency_proxy/group_access.rb index 44611641529..45392625e45 100644 --- a/app/controllers/concerns/dependency_proxy/group_access.rb +++ b/app/controllers/concerns/dependency_proxy/group_access.rb @@ -18,9 +18,5 @@ module DependencyProxy def authorize_read_dependency_proxy! access_denied! unless can?(auth_user, :read_dependency_proxy, group) end - - def authorize_admin_dependency_proxy! - access_denied! unless can?(auth_user, :admin_dependency_proxy, group) - end end end diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb index ae90bd59d01..4d3eb9cd183 100644 --- a/app/controllers/concerns/issuable_actions.rb +++ b/app/controllers/concerns/issuable_actions.rb @@ -184,7 +184,7 @@ module IssuableActions def paginated_discussions return if params[:per_page].blank? - return unless issuable.instance_of?(Issue) && Feature.enabled?(:paginated_issue_discussions, project, default_enabled: :yaml) + return unless issuable.instance_of?(Issue) && Feature.enabled?(:paginated_issue_discussions, project) strong_memoize(:paginated_discussions) do issuable diff --git a/app/controllers/concerns/notes_actions.rb b/app/controllers/concerns/notes_actions.rb index 8410a8779f6..55b6747fcfb 100644 --- a/app/controllers/concerns/notes_actions.rb +++ b/app/controllers/concerns/notes_actions.rb @@ -65,7 +65,7 @@ module NotesActions json.merge!(note_json(@note)) end - if @note.errors.present? && @note.errors.attribute_names != [:commands_only] + if @note.errors.present? && @note.errors.attribute_names != [:commands_only, :command_names] render json: json, status: :unprocessable_entity else render json: json diff --git a/app/controllers/concerns/oauth_applications.rb b/app/controllers/concerns/oauth_applications.rb index 794307ebb0c..8e63cc391ff 100644 --- a/app/controllers/concerns/oauth_applications.rb +++ b/app/controllers/concerns/oauth_applications.rb @@ -30,7 +30,7 @@ module OauthApplications end def permitted_params - %i{name redirect_uri scopes confidential expire_access_tokens} + %i{name redirect_uri scopes confidential} end def application_params diff --git a/app/controllers/concerns/product_analytics_tracking.rb b/app/controllers/concerns/product_analytics_tracking.rb index 03296d6b233..4021ff83578 100644 --- a/app/controllers/concerns/product_analytics_tracking.rb +++ b/app/controllers/concerns/product_analytics_tracking.rb @@ -20,7 +20,7 @@ module ProductAnalyticsTracking def route_events_to(destinations, name, &block) track_unique_redis_hll_event(name, &block) if destinations.include?(:redis_hll) - if destinations.include?(:snowplow) && Feature.enabled?(:route_hll_to_snowplow, tracking_namespace_source, default_enabled: :yaml) + if destinations.include?(:snowplow) && Feature.enabled?(:route_hll_to_snowplow, tracking_namespace_source) Gitlab::Tracking.event(self.class.to_s, name, namespace: tracking_namespace_source, user: current_user) end end diff --git a/app/controllers/concerns/send_file_upload.rb b/app/controllers/concerns/send_file_upload.rb index 8b053ef7c59..c8369c465b8 100644 --- a/app/controllers/concerns/send_file_upload.rb +++ b/app/controllers/concerns/send_file_upload.rb @@ -71,6 +71,6 @@ module SendFileUpload end def scaling_allowed_by_feature_flags?(file_upload) - Feature.enabled?(:dynamic_image_resizing, default_enabled: true, type: :ops) + Feature.enabled?(:dynamic_image_resizing, type: :ops) end end diff --git a/app/controllers/concerns/uploads_actions.rb b/app/controllers/concerns/uploads_actions.rb index c9b6e8923fe..f914e804e18 100644 --- a/app/controllers/concerns/uploads_actions.rb +++ b/app/controllers/concerns/uploads_actions.rb @@ -143,11 +143,17 @@ module UploadsActions end def bypass_auth_checks_on_uploads? - if ::Feature.enabled?(:enforce_auth_checks_on_uploads, project, default_enabled: :yaml) - false - else - action_name == 'show' && embeddable? + if ::Feature.enabled?(:enforce_auth_checks_on_uploads, target_project) + if target_project && !target_project.public? && target_project.enforce_auth_checks_on_uploads? + return false + end end + + action_name == 'show' && embeddable? + end + + def target_project + nil end def find_model diff --git a/app/controllers/concerns/wiki_actions.rb b/app/controllers/concerns/wiki_actions.rb index 91de1d8aeae..9fc8886aaee 100644 --- a/app/controllers/concerns/wiki_actions.rb +++ b/app/controllers/concerns/wiki_actions.rb @@ -21,6 +21,10 @@ module WikiActions before_action :load_sidebar, except: [:pages] before_action :set_content_class + before_action do + push_frontend_feature_flag(:preserve_unchanged_markdown, @group) + end + before_action only: [:show, :edit, :update] do @valid_encoding = valid_encoding? end |