verifiers

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package verifiers holds the registry of VSA issuers the verifier can bind to their signing identity: for each known verifier.id, who must have signed the VSA for the id to count as proven rather than merely claimed. It is the counterpart of the builder registry for the verifier named in a Verification Summary Attestation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is an ordered set of verifiers. Exact-id entries take precedence over prefix entries in lookups.

func Load

func Load(path string) (*Registry, error)

Load reads a registry from a YAML file or a directory of YAML files.

func LoadEmbedded

func LoadEmbedded() (*Registry, error)

LoadEmbedded loads the verifiers compiled into the binary: the official SLSA source workflow under its current and legacy ids.

func New

func New(verifiers ...*Verifier) (*Registry, error)

New returns a registry holding the given verifiers, validated. A later entry with the same id and idMatch replaces an earlier one.

func Parse

func Parse(data []byte) (*Registry, error)

Parse reads a registry file's YAML.

func (*Registry) Add

func (r *Registry) Add(v *Verifier) error

Add validates v and adds it to the registry, replacing an entry with the same id and idMatch.

func (*Registry) Len

func (r *Registry) Len() int

Len returns the number of entries.

func (*Registry) Lookup

func (r *Registry) Lookup(verifierID string) *Verifier

Lookup returns the verifier that verifierID names, or nil when the registry does not know it.

func (*Registry) Merge

func (r *Registry) Merge(other *Registry) error

Merge adds every verifier of other into r, with other's entries replacing r's on the same id.

func (*Registry) Verifiers

func (r *Registry) Verifiers() []*Verifier

Verifiers returns the entries, exact ids first.

type Verifier

type Verifier struct {
	// ID is the verifier id as VSAs record it in verifier.id.
	ID string `yaml:"id"`
	// IDMatch is how ID is compared with verifier.id; exact by default.
	IDMatch builders.IDMatch `yaml:"idMatch,omitempty"`
	// Title names the verifier for people.
	Title string `yaml:"title,omitempty"`
	// Description explains what the verifier is and how it is bound.
	Description string `yaml:"description,omitempty"`
	// Issuer is the OIDC issuer of the verifier's signing certificate.
	// With Signer unset, the signer identity is derived from it and
	// ID: a sigstore identity from Issuer whose subject starts with
	// ID followed by a slash — any workflow of the repository the id
	// names, for verifiers whose id is their repository URL.
	Issuer string `yaml:"issuer,omitempty"`
	// Signer is the identity spec (see sapi.NewIdentityFromSpec) the
	// VSA must be signed by, when it cannot be derived from Issuer and
	// ID. Naming the exact workflow is the stronger binding.
	Signer string `yaml:"signer,omitempty"`
	// Ref constrains the ref carried by the signer identity; any by
	// default.
	Ref builders.RefPolicy `yaml:"ref,omitempty"`
	// contains filtered or unexported fields
}

Verifier describes a VSA issuer and the identity that signs the VSAs it issues.

func (*Verifier) AllowsSigner

func (v *Verifier) AllowsSigner(signer *sapi.Identity) bool

AllowsSigner reports whether signer is this verifier's signer at a ref its policy allows.

func (*Verifier) Identity

func (v *Verifier) Identity() *sapi.Identity

Identity returns the parsed signer identity. Nil before Validate.

func (*Verifier) MatchesID

func (v *Verifier) MatchesID(verifierID string) bool

MatchesID reports whether verifierID names this verifier.

func (*Verifier) MatchesSigner

func (v *Verifier) MatchesSigner(signer *sapi.Identity) bool

MatchesSigner reports whether signer, an identity recorded on a verified signature, is this verifier's signer.

func (*Verifier) SignerSpec

func (v *Verifier) SignerSpec() string

SignerSpec returns the identity spec the verifier's VSAs must be signed by: Signer when set, else one derived from Issuer and ID.

func (*Verifier) Validate

func (v *Verifier) Validate() error

Validate checks the entry is complete and its signer identity parses.

Jump to

Keyboard shortcuts

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