mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 23:16:52 +02:00
Move commits signature and verify functions to service layers (#33605)
No logic change, just move functions.
This commit is contained in:
1 parent
62389dd08b
commit
58c124cc4f
21 files changed
+546
-511
No files matched your search
@@ -10,9 +10,9 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
asymkey_service "code.gitea.io/gitea/services/asymkey"
|
||||
)
|
||||
|
||||
// This file contains commit verification functions for refs passed across in hooks
|
||||
@@ -96,7 +96,7 @@ func readAndVerifyCommit(sha string, repo *git.Repository, env []string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
verification := asymkey_model.ParseCommitWithSignature(ctx, commit)
|
||||
verification := asymkey_service.ParseCommitWithSignature(ctx, commit)
|
||||
if !verification.Verified {
|
||||
cancel()
|
||||
return &errUnverifiedCommit{
|
||||
|
||||
Reference in new issue
Block a user