2021-05-14 08:10:58 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Packages
|
|
|
|
module Pypi
|
|
|
|
class PackageFinder < ::Packages::GroupOrProjectPackageFinder
|
|
|
|
def execute
|
|
|
|
packages.by_file_name_and_sha256(@params[:filename], @params[:sha256])
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def packages
|
2021-05-17 11:10:15 -04:00
|
|
|
base.pypi.has_version
|
2021-05-14 08:10:58 -04:00
|
|
|
end
|
2021-05-25 11:10:33 -04:00
|
|
|
|
|
|
|
def group_packages
|
|
|
|
# PyPI finds packages without checking permissions.
|
|
|
|
# The package download endpoint uses obfuscation to secure the file
|
|
|
|
# instead of authentication. This is behavior the PyPI package
|
|
|
|
# manager defines and is not something GitLab controls.
|
|
|
|
::Packages::Package.for_projects(
|
|
|
|
@project_or_group.all_projects.select(:id)
|
|
|
|
).installable
|
|
|
|
end
|
2021-05-14 08:10:58 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|