Commit 226b0c20 authored by Mathieu Parent's avatar Mathieu Parent

Remove "-/" section from the debian routes

See https://gitlab.com/gitlab-org/gitlab-workhorse/-/issues/343
parent c4536b63
...@@ -13,7 +13,7 @@ module API ...@@ -13,7 +13,7 @@ module API
authorize_read_package!(user_group) authorize_read_package!(user_group)
end end
namespace ':id/-/packages/debian' do namespace ':id/packages/debian' do
include DebianPackageEndpoints include DebianPackageEndpoints
end end
end end
......
...@@ -51,7 +51,7 @@ module API ...@@ -51,7 +51,7 @@ module API
end end
namespace 'dists/*distribution', requirements: DISTRIBUTION_REQUIREMENTS do namespace 'dists/*distribution', requirements: DISTRIBUTION_REQUIREMENTS do
# GET {projects|groups}/:id/-/packages/debian/dists/*distribution/Release.gpg # GET {projects|groups}/:id/packages/debian/dists/*distribution/Release.gpg
desc 'The Release file signature' do desc 'The Release file signature' do
detail 'This feature was introduced in GitLab 13.5' detail 'This feature was introduced in GitLab 13.5'
end end
...@@ -61,7 +61,7 @@ module API ...@@ -61,7 +61,7 @@ module API
not_found! not_found!
end end
# GET {projects|groups}/:id/-/packages/debian/dists/*distribution/Release # GET {projects|groups}/:id/packages/debian/dists/*distribution/Release
desc 'The unsigned Release file' do desc 'The unsigned Release file' do
detail 'This feature was introduced in GitLab 13.5' detail 'This feature was introduced in GitLab 13.5'
end end
...@@ -72,7 +72,7 @@ module API ...@@ -72,7 +72,7 @@ module API
'TODO Release' 'TODO Release'
end end
# GET {projects|groups}/:id/-/packages/debian/dists/*distribution/InRelease # GET {projects|groups}/:id/packages/debian/dists/*distribution/InRelease
desc 'The signed Release file' do desc 'The signed Release file' do
detail 'This feature was introduced in GitLab 13.5' detail 'This feature was introduced in GitLab 13.5'
end end
...@@ -88,7 +88,7 @@ module API ...@@ -88,7 +88,7 @@ module API
end end
namespace ':component/binary-:architecture', requirements: COMPONENT_ARCHITECTURE_REQUIREMENTS do namespace ':component/binary-:architecture', requirements: COMPONENT_ARCHITECTURE_REQUIREMENTS do
# GET {projects|groups}/:id/-/packages/debian/dists/*distribution/:component/binary-:architecture/Packages # GET {projects|groups}/:id/packages/debian/dists/*distribution/:component/binary-:architecture/Packages
desc 'The binary files index' do desc 'The binary files index' do
detail 'This feature was introduced in GitLab 13.5' detail 'This feature was introduced in GitLab 13.5'
end end
...@@ -108,7 +108,7 @@ module API ...@@ -108,7 +108,7 @@ module API
end end
namespace 'pool/:component/:letter/:source_package', requirements: COMPONENT_LETTER_SOURCE_PACKAGE_REQUIREMENTS do namespace 'pool/:component/:letter/:source_package', requirements: COMPONENT_LETTER_SOURCE_PACKAGE_REQUIREMENTS do
# GET {projects|groups}/:id/-/packages/debian/pool/:component/:letter/:source_package/:file_name # GET {projects|groups}/:id/packages/debian/pool/:component/:letter/:source_package/:file_name
params do params do
requires :file_name, type: String, desc: 'The Debian File Name' requires :file_name, type: String, desc: 'The Debian File Name'
end end
......
...@@ -13,7 +13,7 @@ module API ...@@ -13,7 +13,7 @@ module API
authorize_read_package! authorize_read_package!
end end
namespace ':id/-/packages/debian' do namespace ':id/packages/debian' do
include DebianPackageEndpoints include DebianPackageEndpoints
params do params do
...@@ -23,7 +23,7 @@ module API ...@@ -23,7 +23,7 @@ module API
namespace 'incoming/:file_name', requirements: FILE_NAME_REQUIREMENTS do namespace 'incoming/:file_name', requirements: FILE_NAME_REQUIREMENTS do
content_type :json, Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE content_type :json, Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE
# PUT {projects|groups}/:id/-/packages/debian/incoming/:file_name # PUT {projects|groups}/:id/packages/debian/incoming/:file_name
params do params do
requires :file, type: ::API::Validations::Types::WorkhorseFile, desc: 'The package file to be published (generated by Multipart middleware)' requires :file, type: ::API::Validations::Types::WorkhorseFile, desc: 'The package file to be published (generated by Multipart middleware)'
end end
...@@ -42,7 +42,7 @@ module API ...@@ -42,7 +42,7 @@ module API
forbidden! forbidden!
end end
# PUT {projects|groups}/:id/-/packages/debian/incoming/:file_name/authorize # PUT {projects|groups}/:id/packages/debian/incoming/:file_name/authorize
route_setting :authentication, deploy_token_allowed: true, basic_auth_personal_access_token: true, job_token_allowed: :basic_auth route_setting :authentication, deploy_token_allowed: true, basic_auth_personal_access_token: true, job_token_allowed: :basic_auth
put 'authorize' do put 'authorize' do
authorize_workhorse!( authorize_workhorse!(
......
...@@ -6,32 +6,32 @@ RSpec.describe API::DebianGroupPackages do ...@@ -6,32 +6,32 @@ RSpec.describe API::DebianGroupPackages do
include WorkhorseHelpers include WorkhorseHelpers
include_context 'Debian repository shared context', :group do include_context 'Debian repository shared context', :group do
describe 'GET groups/:id/-/packages/debian/dists/*distribution/Release.gpg' do describe 'GET groups/:id/packages/debian/dists/*distribution/Release.gpg' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/Release.gpg" } let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/Release.gpg" }
it_behaves_like 'Debian group repository GET endpoint', :not_found, nil it_behaves_like 'Debian group repository GET endpoint', :not_found, nil
end end
describe 'GET groups/:id/-/packages/debian/dists/*distribution/Release' do describe 'GET groups/:id/packages/debian/dists/*distribution/Release' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/Release" } let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/Release" }
it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO Release' it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO Release'
end end
describe 'GET groups/:id/-/packages/debian/dists/*distribution/InRelease' do describe 'GET groups/:id/packages/debian/dists/*distribution/InRelease' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/InRelease" } let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/InRelease" }
it_behaves_like 'Debian group repository GET endpoint', :not_found, nil it_behaves_like 'Debian group repository GET endpoint', :not_found, nil
end end
describe 'GET groups/:id/-/packages/debian/dists/*distribution/:component/binary-:architecture/Packages' do describe 'GET groups/:id/packages/debian/dists/*distribution/:component/binary-:architecture/Packages' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/#{component}/binary-#{architecture}/Packages" } let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/#{component}/binary-#{architecture}/Packages" }
it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO Packages' it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO Packages'
end end
describe 'GET groups/:id/-/packages/debian/pool/:component/:letter/:source_package/:file_name' do describe 'GET groups/:id/packages/debian/pool/:component/:letter/:source_package/:file_name' do
let(:url) { "/groups/#{group.id}/-/packages/debian/pool/#{component}/#{letter}/#{source_package}/#{package_name}_#{package_version}_#{architecture}.deb" } let(:url) { "/groups/#{group.id}/packages/debian/pool/#{component}/#{letter}/#{source_package}/#{package_name}_#{package_version}_#{architecture}.deb" }
it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO File' it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO File'
end end
......
...@@ -6,46 +6,46 @@ RSpec.describe API::DebianProjectPackages do ...@@ -6,46 +6,46 @@ RSpec.describe API::DebianProjectPackages do
include WorkhorseHelpers include WorkhorseHelpers
include_context 'Debian repository shared context', :project do include_context 'Debian repository shared context', :project do
describe 'GET projects/:id/-/packages/debian/dists/*distribution/Release.gpg' do describe 'GET projects/:id/packages/debian/dists/*distribution/Release.gpg' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/Release.gpg" } let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/Release.gpg" }
it_behaves_like 'Debian project repository GET endpoint', :not_found, nil it_behaves_like 'Debian project repository GET endpoint', :not_found, nil
end end
describe 'GET projects/:id/-/packages/debian/dists/*distribution/Release' do describe 'GET projects/:id/packages/debian/dists/*distribution/Release' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/Release" } let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/Release" }
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Release' it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Release'
end end
describe 'GET projects/:id/-/packages/debian/dists/*distribution/InRelease' do describe 'GET projects/:id/packages/debian/dists/*distribution/InRelease' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/InRelease" } let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/InRelease" }
it_behaves_like 'Debian project repository GET endpoint', :not_found, nil it_behaves_like 'Debian project repository GET endpoint', :not_found, nil
end end
describe 'GET projects/:id/-/packages/debian/dists/*distribution/:component/binary-:architecture/Packages' do describe 'GET projects/:id/packages/debian/dists/*distribution/:component/binary-:architecture/Packages' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/#{component}/binary-#{architecture}/Packages" } let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/#{component}/binary-#{architecture}/Packages" }
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Packages' it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Packages'
end end
describe 'GET projects/:id/-/packages/debian/pool/:component/:letter/:source_package/:file_name' do describe 'GET projects/:id/packages/debian/pool/:component/:letter/:source_package/:file_name' do
let(:url) { "/projects/#{project.id}/-/packages/debian/pool/#{component}/#{letter}/#{source_package}/#{package_name}_#{package_version}_#{architecture}.deb" } let(:url) { "/projects/#{project.id}/packages/debian/pool/#{component}/#{letter}/#{source_package}/#{package_name}_#{package_version}_#{architecture}.deb" }
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO File' it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO File'
end end
describe 'PUT projects/:id/-/packages/debian/incoming/:file_name' do describe 'PUT projects/:id/packages/debian/incoming/:file_name' do
let(:method) { :put } let(:method) { :put }
let(:url) { "/projects/#{project.id}/-/packages/debian/incoming/#{file_name}" } let(:url) { "/projects/#{project.id}/packages/debian/incoming/#{file_name}" }
it_behaves_like 'Debian project repository PUT endpoint', :created, nil it_behaves_like 'Debian project repository PUT endpoint', :created, nil
end end
describe 'PUT projects/:id/-/packages/debian/incoming/:file_name/authorize' do describe 'PUT projects/:id/packages/debian/incoming/:file_name/authorize' do
let(:method) { :put } let(:method) { :put }
let(:url) { "/projects/#{project.id}/-/packages/debian/incoming/#{file_name}/authorize" } let(:url) { "/projects/#{project.id}/packages/debian/incoming/#{file_name}/authorize" }
it_behaves_like 'Debian project repository PUT endpoint', :created, nil, is_authorize: true it_behaves_like 'Debian project repository PUT endpoint', :created, nil, is_authorize: true
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment