Move commits signature and verify functions to service layers (#33605)
No logic change, just move functions.
This commit is contained in:
parent
62389dd08b
commit
58c124cc4f
21 changed files with 546 additions and 511 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue