Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/maven_packages.rb')
-rw-r--r--lib/api/maven_packages.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/lib/api/maven_packages.rb b/lib/api/maven_packages.rb
index eccc55ed158..517de98a148 100644
--- a/lib/api/maven_packages.rb
+++ b/lib/api/maven_packages.rb
@@ -34,18 +34,6 @@ module API
.exists?
end
- def extract_format(file_name)
- name, _, format = file_name.rpartition('.')
-
- if %w(md5 sha1).include?(format)
- unprocessable_entity! if Gitlab::FIPS.enabled? && format == 'md5'
-
- [name, format]
- else
- [file_name, format]
- end
- end
-
# The sha verification done by the maven api is between:
# - the sha256 set by workhorse helpers
# - the sha256 of the sha1 of the uploaded package file
@@ -69,46 +57,6 @@ module API
format == 'jar'
end
- def present_carrierwave_file_with_head_support!(package_file, supports_direct_download: true)
- package_file.package.touch_last_downloaded_at
- file = package_file.file
-
- if head_request_on_aws_file?(file, supports_direct_download) && !file.file_storage?
- return redirect(signed_head_url(file))
- end
-
- present_carrierwave_file!(file, supports_direct_download: supports_direct_download)
- end
-
- def signed_head_url(file)
- fog_storage = ::Fog::Storage.new(file.fog_credentials)
- fog_dir = fog_storage.directories.new(key: file.fog_directory)
- fog_file = fog_dir.files.new(key: file.path)
- expire_at = ::Fog::Time.now + file.fog_authenticated_url_expiration
-
- fog_file.collection.head_url(fog_file.key, expire_at)
- end
-
- def head_request_on_aws_file?(file, supports_direct_download)
- Gitlab.config.packages.object_store.enabled &&
- supports_direct_download &&
- file.class.direct_download_enabled? &&
- request.head? &&
- file.fog_credentials[:provider] == 'AWS'
- end
-
- def fetch_package(file_name:, project: nil, group: nil)
- order_by_package_file = file_name.include?(::Packages::Maven::Metadata.filename) &&
- !params[:path].include?(::Packages::Maven::FindOrCreatePackageService::SNAPSHOT_TERM)
-
- ::Packages::Maven::PackageFinder.new(
- current_user,
- project || group,
- path: params[:path],
- order_by_package_file: order_by_package_file
- ).execute
- end
-
def find_and_present_package_file(package, file_name, format, params)
project = package&.project
package_file = nil