diff options
Diffstat (limited to 'lib/api/pypi_packages.rb')
-rw-r--r-- | lib/api/pypi_packages.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/pypi_packages.rb b/lib/api/pypi_packages.rb index f9470ce1cb6..8c4203d8819 100644 --- a/lib/api/pypi_packages.rb +++ b/lib/api/pypi_packages.rb @@ -99,6 +99,12 @@ module API find_project(params[:id]) || not_found! authorized_user_project(action: action) end + + def validate_fips! + unprocessable_entity! if declared_params[:sha256_digest].blank? + + true + end end params do @@ -284,7 +290,7 @@ module API track_package_event('push_package', :pypi, project: project, user: current_user, namespace: project.namespace) - unprocessable_entity! if Gitlab::FIPS.enabled? && declared_params[:md5_digest].present? + validate_fips! if Gitlab::FIPS.enabled? ::Packages::Pypi::CreatePackageService .new(project, current_user, declared_params.merge(build: current_authenticated_job)) |