gitsign

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryObject

func NewMemoryObject() *plumbing.MemoryObject

NewMemoryObject returns a new plumbing.MemoryObject for use with EncodeWithoutSignature.

func OpenRepository

func OpenRepository(path string) (*git.Repository, error)

OpenRepository opens a git repository at the given path.

Types

type VerificationResult

type VerificationResult struct {
	CommitHash           string    `json:"commit"`
	Verified             bool      `json:"verified"`
	TransparencyVerified bool      `json:"transparency_verified"`
	Signer               string    `json:"signer,omitempty"`
	Issuer               string    `json:"issuer,omitempty"`
	CertFingerprint      string    `json:"cert_fingerprint,omitempty"`
	Timestamp            time.Time `json:"timestamp,omitempty"`
	RekorLogIndex        int64     `json:"rekor_log_index,omitempty"`
	ErrorMsg             string    `json:"error,omitempty"`
	Unsigned             bool      `json:"unsigned,omitempty"`
}

VerificationResult holds the outcome of verifying a single commit.

Verified is true only when the gitsign signature is both cryptographically valid (cert chain pinned to a trusted timestamp) AND transparency-bound: a verified RFC3161 TSA timestamp on the GitHub-internal path, or a verified Rekor inclusion proof on the public-good path. TransparencyVerified records the transparency dimension on its own so callers can tell "cms ok but not transparency-bound" apart from "cms failed"; Verified is never true while TransparencyVerified is false.

func VerifyCommit

func VerifyCommit(repo *git.Repository, revision string, opts VerifyOptions) (*VerificationResult, error)

VerifyCommit verifies a single commit's gitsign signature. Returns a VerificationResult regardless of signed/unsigned status. Only returns an error for infrastructure failures (repo access, bad revision).

func VerifyCommitRange

func VerifyCommitRange(repo *git.Repository, from, to string, opts VerifyOptions) ([]*VerificationResult, error)

VerifyCommitRange verifies all commits in the range [from..to] (both inclusive). Unsigned commits are included in results with Unsigned=true, not as errors.

type VerifyOptions

type VerifyOptions struct {
	// CertIdentity is the expected OIDC subject (email or URI) in the certificate SAN.
	CertIdentity string
	// CertIssuer is the expected OIDC issuer URL.
	CertIssuer string
}

VerifyOptions configures gitsign commit verification.

Directories

Path Synopsis
Package cmstest provides test-only helpers for building structurally valid CMS-signed git commits.
Package cmstest provides test-only helpers for building structurally valid CMS-signed git commits.

Jump to

Keyboard shortcuts

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