mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-22 08:59:01 +00:00
cd19564acc
This is, in large part, a refactoring: we rename `CommitVerification` to `ObjectVerification`, and adjust `ParseObjectWithSignature` (previously `ParseCommitWithSignature`) to work on an object, rather than a commit. This in turn, lets us implement `ParseTagWithSignature` on top of it, so commit & tag signature verification will share most of the code. Work sponsored by @glts. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
16 lines
371 B
Go
16 lines
371 B
Go
// Copyright 2024 The Forgejo Authors c/o Codeberg e.V.. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package asymkey
|
|
|
|
import (
|
|
"context"
|
|
|
|
"code.gitea.io/gitea/modules/git"
|
|
)
|
|
|
|
func ParseTagWithSignature(ctx context.Context, gitRepo *git.Repository, t *git.Tag) *ObjectVerification {
|
|
o := tagToGitObject(t, gitRepo)
|
|
return ParseObjectWithSignature(ctx, &o)
|
|
}
|