summaryrefslogtreecommitdiff
path: root/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
downloadgitlab-ce-71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e.tar.gz
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb')
-rw-r--r--app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb16
1 files changed, 2 insertions, 14 deletions
diff --git a/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb b/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
index e179a14c497..e30818cc5d2 100644
--- a/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
+++ b/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
@@ -16,10 +16,8 @@ module Import
allow_local_network: allow_local_requests?,
dns_rebind_protection: true
}
- validate :aws_s3, if: :validate_aws_s3?
- # When removing the import_project_from_remote_file_s3 remove the
- # whole condition of this validation:
- validates_with RemoteFileValidator, if: -> { validate_aws_s3? || !s3_request? }
+
+ validates_with RemoteFileValidator, if: -> { !s3_request? }
def initialize(params:, current_user: nil)
@params = params
@@ -47,20 +45,10 @@ module Import
attr_reader :params
- def aws_s3
- if s3_request?
- errors.add(:base, 'To import from AWS S3 use `projects/remote-import-s3`')
- end
- end
-
def s3_request?
headers['Server'] == 'AmazonS3' && headers['x-amz-request-id'].present?
end
- def validate_aws_s3?
- ::Feature.enabled?(:import_project_from_remote_file_s3)
- end
-
def headers
return {} if file_url.blank?