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
034d1d02
Commit
034d1d02
authored
Feb 07, 2019
by
Balasankar "Balu" C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add API endpoint to get a commit's GPG signature
parent
c6016ac8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
lib/api/commits.rb
lib/api/commits.rb
+16
-0
lib/api/entities.rb
lib/api/entities.rb
+7
-0
No files found.
lib/api/commits.rb
View file @
034d1d02
...
...
@@ -323,6 +323,22 @@ module API
present
paginate
(
commit
.
merge_requests
),
with:
Entities
::
MergeRequestBasic
end
desc
"Get a commit's GPG signature"
do
success
Entities
::
CommitSignature
end
params
do
requires
:sha
,
type:
String
,
desc:
'A commit sha, or the name of a branch or tag'
end
get
':id/repository/commits/:sha/signature'
,
requirements:
API
::
COMMIT_ENDPOINT_REQUIREMENTS
do
commit
=
user_project
.
commit
(
params
[
:sha
])
not_found!
'Commit'
unless
commit
signature
=
commit
.
signature
not_found!
'GPG Signature'
unless
signature
present
signature
,
with:
Entities
::
CommitSignature
end
end
end
end
lib/api/entities.rb
View file @
034d1d02
...
...
@@ -392,6 +392,13 @@ module API
expose
:project_id
end
class
CommitSignature
<
Grape
::
Entity
expose
:gpg_key_id
expose
:gpg_key_primary_keyid
,
:gpg_key_user_name
,
:gpg_key_user_email
expose
:verification_status
expose
:gpg_key_subkey_id
end
class
BasicRef
<
Grape
::
Entity
expose
:type
,
:name
end
...
...
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