diff options
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r-- | app/controllers/projects/artifacts_controller.rb | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index 50399a8cfbb..da8a371acaa 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -8,37 +8,10 @@ class Projects::ArtifactsController < Projects::ApplicationController layout 'project' before_action :authorize_read_build! before_action :authorize_update_build!, only: [:keep] - before_action :authorize_destroy_artifacts!, only: [:destroy] before_action :extract_ref_name_and_path - before_action :validate_artifacts!, except: [:index, :download, :destroy] + before_action :validate_artifacts!, except: [:download] before_action :entry, only: [:file] - MAX_PER_PAGE = 20 - - def index - # Loading artifacts is very expensive in projects with a lot of artifacts. - # This feature flag prevents a DOS attack vector. - # It should be removed only after resolving the underlying performance - # issues: https://gitlab.com/gitlab-org/gitlab/issues/32281 - return head :no_content unless Feature.enabled?(:artifacts_management_page, @project) - - finder = ArtifactsFinder.new(@project, artifacts_params) - all_artifacts = finder.execute - - @artifacts = all_artifacts.page(params[:page]).per(MAX_PER_PAGE) - @total_size = all_artifacts.total_size - end - - def destroy - notice = if artifact.destroy - _('Artifact was successfully deleted.') - else - _('Artifact could not be deleted.') - end - - redirect_to project_artifacts_path(@project), status: :see_other, notice: notice - end - def download return render_404 unless artifacts_file @@ -101,10 +74,6 @@ class Projects::ArtifactsController < Projects::ApplicationController @ref_name, @path = extract_ref(params[:ref_name_and_path]) end - def artifacts_params - params.permit(:sort) - end - def validate_artifacts! render_404 unless build&.artifacts? end @@ -116,11 +85,6 @@ class Projects::ArtifactsController < Projects::ApplicationController end end - def artifact - @artifact ||= - project.job_artifacts.find(params[:id]) - end - def build_from_id project.builds.find_by_id(params[:job_id]) if params[:job_id] end |