Help us shape the future of Go! Take the 2026 Go Developer Survey

commitverification

package
v1.72.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitVerification

type CommitVerification struct {
	// Whether verification was attempted
	Attempted bool
	// Verification status
	Status VerificationStatus
	// Human-readable reason for the status
	Reason string
	// Platform that performed the verification (e.g., "github", "gitlab")
	Platform string
	// Optional: The signing key ID if verified
	KeyID string
	// Optional: The signature algorithm used
	SignatureAlgorithm string
}

CommitVerification represents the result of a commit signature verification

func VerifyGitHubCommit

func VerifyGitHubCommit(ctx context.Context, owner, repo, commitHash, token string, logger *zerolog.Logger) *CommitVerification

VerifyGitHubCommit verifies a commit signature using the GitHub API

func VerifyGitLabCommit

func VerifyGitLabCommit(ctx context.Context, baseURL, projectPath, commitHash, token string, logger *zerolog.Logger) *CommitVerification

VerifyGitLabCommit verifies a commit signature using the GitLab API

type VerificationStatus

type VerificationStatus int

VerificationStatus represents the status of a commit signature verification

const (
	// VerificationStatusUnspecified indicates an unspecified status
	VerificationStatusUnspecified VerificationStatus = iota
	// VerificationStatusVerified indicates the signature was successfully verified
	VerificationStatusVerified
	// VerificationStatusUnverified indicates the signature check failed or is invalid
	VerificationStatusUnverified
	// VerificationStatusUnavailable indicates verification could not be performed
	VerificationStatusUnavailable
	// VerificationStatusNotApplicable indicates no signature present or platform doesn't support it
	VerificationStatusNotApplicable
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL