summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/convert/convert.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-03-22 11:43:54 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-22 18:43:54 +0800
commit14fe9010ae8aecc0bcd38059b4c71256524b5341 (patch)
tree6a4740387d288ea8cd433412d36624e30912d5ee /routers/api/v1/convert/convert.go
parent9224405155322e096e7f2d0f9eed35633b937951 (diff)
downloadgitea-14fe9010ae8aecc0bcd38059b4c71256524b5341.tar.gz
gitea-14fe9010ae8aecc0bcd38059b4c71256524b5341.zip
GPG commit validation (#1150)
* GPG commit validation * Add translation + some little fix * Move hash calc after retrieving of potential key + missing translation * Add some little test
Diffstat (limited to 'routers/api/v1/convert/convert.go')
-rw-r--r--routers/api/v1/convert/convert.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/api/v1/convert/convert.go b/routers/api/v1/convert/convert.go
index 7485ac9e2a..153993ce82 100644
--- a/routers/api/v1/convert/convert.go
+++ b/routers/api/v1/convert/convert.go
@@ -44,6 +44,7 @@ func ToCommit(c *git.Commit) *api.PayloadCommit {
if err == nil {
committerUsername = committer.Name
}
+ verif := models.ParseCommitWithSignature(c)
return &api.PayloadCommit{
ID: c.ID.String(),
Message: c.Message(),
@@ -59,6 +60,12 @@ func ToCommit(c *git.Commit) *api.PayloadCommit {
UserName: committerUsername,
},
Timestamp: c.Author.When,
+ Verification: &api.PayloadCommitVerification{
+ Verified: verif.Verified,
+ Reason: verif.Reason,
+ Signature: c.Signature.Signature,
+ Payload: c.Signature.Payload,
+ },
}
}