1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
This commit is contained in:
Antoine GIRARD
2017-03-22 11:43:54 +01:00
committed by Lunny Xiao
parent 9224405155
commit 14fe9010ae
14 changed files with 480 additions and 21 deletions

View File

@@ -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,
},
}
}