diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-04 01:44:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-04 01:44:35 +0300 |
commit | 96722e6de1c1f91f62f9ee645c5ad3ec7b05282c (patch) | |
tree | d80ec8b3505fc3055cc8d7ed7f864edc831b7119 /lib/api | |
parent | b2a2fb69e663aabd66fe2fe8696c49e68c2fbe02 (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-ee
Diffstat (limited to 'lib/api')
-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)) |