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:
committed by
Lunny Xiao
parent
9224405155
commit
14fe9010ae
@@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user