Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e1d915e3
Commit
e1d915e3
authored
Jul 28, 2021
by
Mathieu Parent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return signature in InRelease and Release.gpg endpoints
Changelog: added
parent
a639a44d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
7 deletions
+24
-7
lib/api/concerns/packages/debian_package_endpoints.rb
lib/api/concerns/packages/debian_package_endpoints.rb
+2
-3
spec/factories/packages/debian/distribution.rb
spec/factories/packages/debian/distribution.rb
+10
-0
spec/fixtures/packages/debian/distribution/InRelease
spec/fixtures/packages/debian/distribution/InRelease
+8
-0
spec/requests/api/debian_group_packages_spec.rb
spec/requests/api/debian_group_packages_spec.rb
+2
-2
spec/requests/api/debian_project_packages_spec.rb
spec/requests/api/debian_project_packages_spec.rb
+2
-2
No files found.
lib/api/concerns/packages/debian_package_endpoints.rb
View file @
e1d915e3
...
...
@@ -71,7 +71,7 @@ module API
route_setting
:authentication
,
authenticate_non_public:
true
get
'Release.gpg'
do
not_found!
distribution_from!
(
project_or_group
).
file_signature
end
# GET {projects|groups}/:id/packages/debian/dists/*distribution/Release
...
...
@@ -91,8 +91,7 @@ module API
route_setting
:authentication
,
authenticate_non_public:
true
get
'InRelease'
do
# Signature to be added in 7.3 of https://gitlab.com/groups/gitlab-org/-/epics/6057#note_582697034
present_carrierwave_file!
(
distribution_from!
(
project_or_group
).
file
)
present_carrierwave_file!
(
distribution_from!
(
project_or_group
).
signed_file
)
end
params
do
...
...
spec/factories/packages/debian/distribution.rb
View file @
e1d915e3
...
...
@@ -13,8 +13,18 @@ FactoryBot.define do
end
trait
(
:with_file
)
do
file_signature
do
<<~
EOF
-----BEGIN PGP SIGNATURE-----
ABC
-----BEGIN PGP SIGNATURE-----
EOF
end
after
(
:build
)
do
|
distribution
,
evaluator
|
distribution
.
file
=
fixture_file_upload
(
'spec/fixtures/packages/debian/distribution/Release'
)
distribution
.
signed_file
=
fixture_file_upload
(
'spec/fixtures/packages/debian/distribution/InRelease'
)
end
end
...
...
spec/fixtures/packages/debian/distribution/InRelease
0 → 100644
View file @
e1d915e3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Codename: fixture-distribution
-----BEGIN PGP SIGNATURE-----
ABC
-----BEGIN PGP SIGNATURE-----
spec/requests/api/debian_group_packages_spec.rb
View file @
e1d915e3
...
...
@@ -15,7 +15,7 @@ RSpec.describe API::DebianGroupPackages do
describe
'GET groups/:id/-/packages/debian/dists/*distribution/Release.gpg'
do
let
(
:url
)
{
"/groups/
#{
container
.
id
}
/-/packages/debian/dists/
#{
distribution
.
codename
}
/Release.gpg"
}
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:
not_found
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:
success
,
/^-----BEGIN PGP SIGNATURE-----/
end
describe
'GET groups/:id/-/packages/debian/dists/*distribution/Release'
do
...
...
@@ -27,7 +27,7 @@ RSpec.describe API::DebianGroupPackages do
describe
'GET groups/:id/-/packages/debian/dists/*distribution/InRelease'
do
let
(
:url
)
{
"/groups/
#{
container
.
id
}
/-/packages/debian/dists/
#{
distribution
.
codename
}
/InRelease"
}
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:success
,
/^
Codename: fixture-distribution\n$
/
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:success
,
/^
-----BEGIN PGP SIGNED MESSAGE-----
/
end
describe
'GET groups/:id/-/packages/debian/dists/*distribution/:component/binary-:architecture/Packages'
do
...
...
spec/requests/api/debian_project_packages_spec.rb
View file @
e1d915e3
...
...
@@ -15,7 +15,7 @@ RSpec.describe API::DebianProjectPackages do
describe
'GET projects/:id/packages/debian/dists/*distribution/Release.gpg'
do
let
(
:url
)
{
"/projects/
#{
container
.
id
}
/packages/debian/dists/
#{
distribution
.
codename
}
/Release.gpg"
}
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:
not_found
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:
success
,
/^-----BEGIN PGP SIGNATURE-----/
end
describe
'GET projects/:id/packages/debian/dists/*distribution/Release'
do
...
...
@@ -27,7 +27,7 @@ RSpec.describe API::DebianProjectPackages do
describe
'GET projects/:id/packages/debian/dists/*distribution/InRelease'
do
let
(
:url
)
{
"/projects/
#{
container
.
id
}
/packages/debian/dists/
#{
distribution
.
codename
}
/InRelease"
}
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:success
,
/^
Codename: fixture-distribution\n$
/
it_behaves_like
'Debian repository read endpoint'
,
'GET request'
,
:success
,
/^
-----BEGIN PGP SIGNED MESSAGE-----
/
end
describe
'GET projects/:id/packages/debian/dists/*distribution/:component/binary-:architecture/Packages'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment