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
authorize_read_package!(user_group)
end
namespace ':id/-/packages/debian' do
namespace ':id/packages/debian' do
include DebianPackageEndpoints
end
end
......
......@@ -51,7 +51,7 @@ module API
end
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
detail 'This feature was introduced in GitLab 13.5'
end
......@@ -61,7 +61,7 @@ module API
not_found!
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
detail 'This feature was introduced in GitLab 13.5'
end
......@@ -72,7 +72,7 @@ module API
'TODO Release'
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
detail 'This feature was introduced in GitLab 13.5'
end
......@@ -88,7 +88,7 @@ module API
end
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
detail 'This feature was introduced in GitLab 13.5'
end
......@@ -108,7 +108,7 @@ module API
end
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
requires :file_name, type: String, desc: 'The Debian File Name'
end
......
......@@ -13,7 +13,7 @@ module API
authorize_read_package!
end
namespace ':id/-/packages/debian' do
namespace ':id/packages/debian' do
include DebianPackageEndpoints
params do
......@@ -23,7 +23,7 @@ module API
namespace 'incoming/:file_name', requirements: FILE_NAME_REQUIREMENTS do
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
requires :file, type: ::API::Validations::Types::WorkhorseFile, desc: 'The package file to be published (generated by Multipart middleware)'
end
......@@ -42,7 +42,7 @@ module API
forbidden!
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
put 'authorize' do
authorize_workhorse!(
......
......@@ -6,32 +6,32 @@ RSpec.describe API::DebianGroupPackages do
include WorkhorseHelpers
include_context 'Debian repository shared context', :group do
describe 'GET groups/:id/-/packages/debian/dists/*distribution/Release.gpg' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/Release.gpg" }
describe 'GET groups/:id/packages/debian/dists/*distribution/Release.gpg' do
let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/Release.gpg" }
it_behaves_like 'Debian group repository GET endpoint', :not_found, nil
end
describe 'GET groups/:id/-/packages/debian/dists/*distribution/Release' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/Release" }
describe 'GET groups/:id/packages/debian/dists/*distribution/Release' do
let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/Release" }
it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO Release'
end
describe 'GET groups/:id/-/packages/debian/dists/*distribution/InRelease' do
let(:url) { "/groups/#{group.id}/-/packages/debian/dists/#{distribution}/InRelease" }
describe 'GET groups/:id/packages/debian/dists/*distribution/InRelease' do
let(:url) { "/groups/#{group.id}/packages/debian/dists/#{distribution}/InRelease" }
it_behaves_like 'Debian group repository GET endpoint', :not_found, nil
end
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" }
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" }
it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO Packages'
end
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" }
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" }
it_behaves_like 'Debian group repository GET endpoint', :success, 'TODO File'
end
......
......@@ -6,46 +6,46 @@ RSpec.describe API::DebianProjectPackages do
include WorkhorseHelpers
include_context 'Debian repository shared context', :project do
describe 'GET projects/:id/-/packages/debian/dists/*distribution/Release.gpg' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/Release.gpg" }
describe 'GET projects/:id/packages/debian/dists/*distribution/Release.gpg' do
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/Release.gpg" }
it_behaves_like 'Debian project repository GET endpoint', :not_found, nil
end
describe 'GET projects/:id/-/packages/debian/dists/*distribution/Release' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/Release" }
describe 'GET projects/:id/packages/debian/dists/*distribution/Release' do
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/Release" }
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Release'
end
describe 'GET projects/:id/-/packages/debian/dists/*distribution/InRelease' do
let(:url) { "/projects/#{project.id}/-/packages/debian/dists/#{distribution}/InRelease" }
describe 'GET projects/:id/packages/debian/dists/*distribution/InRelease' do
let(:url) { "/projects/#{project.id}/packages/debian/dists/#{distribution}/InRelease" }
it_behaves_like 'Debian project repository GET endpoint', :not_found, nil
end
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" }
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" }
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO Packages'
end
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" }
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" }
it_behaves_like 'Debian project repository GET endpoint', :success, 'TODO File'
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(: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
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(: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
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