sigstore

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRoots []byte

Functions

This section is empty.

Types

type CaCertMatcher

type CaCertMatcher func()

type CredentialProvider added in v0.5.0

type CredentialProvider struct {
	// Instance holds the sigstore configuration (TUF options, signing config,
	// OIDC client config, verifier config).
	Instance *Instance

	// DisableSTS skips the ambient credential providers.
	DisableSTS bool

	// Token is an optional pre-provided OIDC ID token. When set, Prepare skips
	// the ambient STS providers; the token still flows through OIDConnect so
	// that it is parsed/validated the same way as a freshly issued one.
	Token *oauthflow.OIDCIDToken
	// contains filtered or unexported fields
}

CredentialProvider implements bundle.CredentialProvider and binds a sigstore instance (OIDC provider + Fulcio) to a signer.

func NewCredentialProvider added in v0.5.0

func NewCredentialProvider(instance *Instance) *CredentialProvider

NewCredentialProvider creates a sigstore CredentialProvider for the given Instance.

func (*CredentialProvider) CertificateProvider added in v0.5.0

CertificateProvider returns the Fulcio provider and the OIDC ID token that authenticates the signing cert request.

func (*CredentialProvider) Intermediates added in v0.5.0

func (p *CredentialProvider) Intermediates() []*x509.Certificate

Intermediates returns nil. The Fulcio chain is reconstructed at verify time from the sigstore TUF root, so no intermediates are embedded in the bundle's VerificationMaterial.

func (*CredentialProvider) Keypair added in v0.5.0

func (p *CredentialProvider) Keypair() sign.Keypair

Keypair returns the ephemeral keypair bound to the Fulcio certificate.

func (*CredentialProvider) Prepare added in v0.5.0

func (p *CredentialProvider) Prepare(ctx context.Context) error

Prepare runs the OIDC flow, ensures TUF roots are on disk, generates an ephemeral keypair, and builds the Fulcio certificate provider. Subsequent calls are no-ops.

type Instance added in v0.3.2

type Instance struct {
	// Embed the tuf options struct
	tuf.TufOptions

	// SigningConfig holds the official sigstore signing configuration
	// (application/vnd.dev.sigstore.signingconfig.v0.2+json).
	SigningConfig *root.SigningConfig `json:"-"`

	Timestamp bool

	// AppendToRekor controls if the signing operation is recorded into the
	// transparency log.
	AppendToRekor bool `json:"rekor-append"`
	DisableSTS    bool

	// Hide the OIDC options in the CLI --help
	HideOIDCOptions bool
	// FlagPrefix adds a prefix to the CLI strings, these help grouping them
	FlagPrefix string

	// OIDCConfig holds the client-side OIDC configuration.
	OIDCConfig OIDCConfig `json:"oidc-config"`

	// VerifierConfig holds the verification policy options.
	VerifierConfig VerifierConfig `json:"verifier-config"`
}

Instance captures the configuration required to talk to a sigstore instance.

func (*Instance) FulcioURL added in v0.3.2

func (i *Instance) FulcioURL() string

FulcioURL returns the Fulcio CA URL from the signing config.

func (*Instance) OidcIssuerURL added in v0.4.0

func (i *Instance) OidcIssuerURL() string

OidcIssuerURL returns the OIDC issuer URL from the signing config.

func (*Instance) RekorURL added in v0.3.2

func (i *Instance) RekorURL() string

RekorURL returns the Rekor transparency log URL from the signing config.

func (*Instance) ValidateOIDC added in v0.3.2

func (i *Instance) ValidateOIDC() error

ValidateOIDC checks that the OIDC properties are correct

func (*Instance) ValidateSigner added in v0.3.2

func (i *Instance) ValidateSigner() error

func (*Instance) ValidateSigningConfig added in v0.4.0

func (i *Instance) ValidateSigningConfig() error

ValidateSigningConfig checks that the instance has a valid signing config.

func (*Instance) ValidateTimestamps added in v0.3.2

func (i *Instance) ValidateTimestamps() error

ValidateTimestamps checks that at least one timestamp verification method is set.

func (*Instance) ValidateVerifier added in v0.3.2

func (i *Instance) ValidateVerifier() error

type InstanceConfig

type InstanceConfig struct {
	ID               string          `json:"id"`
	IssuerOrg        string          `json:"issuer-org"`
	SigningConfigRaw json.RawMessage `json:"signing-config"`
	Instance
}

type OIDCConfig added in v0.4.0

type OIDCConfig struct {
	// RedirectURL defines the URL that the browser will redirect to.
	// If the port is set to 0, it will be randomized to a high number
	// port before starting the OIDC flow.
	RedirectURL string `json:"redirect-url"`

	// ClientID is the OIDC client ID to stamp on the tokens.
	ClientID string `json:"client-id"`

	// ClientSecret is the OIDC client secret.
	ClientSecret string `json:"client-secret"`
}

OIDCConfig captures the client-side OIDC configuration for a sigstore instance.

func (*OIDCConfig) Validate added in v0.4.0

func (oc *OIDCConfig) Validate() error

Validate checks that the required OIDC client fields are set.

type SigstoreRoots

type SigstoreRoots struct {
	Roots []InstanceConfig `json:"roots"`
}

func ParseRoots

func ParseRoots(data []byte) (*SigstoreRoots, error)

ParseRoots parses a roots file

func ParseRootsFile

func ParseRootsFile(path string) (*SigstoreRoots, error)

ParseRootsFile parses a sigstore roots file

type VerifierConfig added in v0.4.0

type VerifierConfig struct {
	// Look for a signed timestamp in the cert and verify with the CTLog Auth
	RequireCTlog bool `json:"require-ct-log"`
	// Verify the cert validity in the transparency log
	RequireTlog bool `json:"require-tlog"`
	// Verify the certificate validity time with a signed timestamp
	RequireSignedTimestamps bool `json:"require-signed-timestamps"`
	// Require an observer timestamp for verification
	RequireObserverTimestamp bool `json:"require-observer-timestamp"`
}

VerifierConfig captures the verification policy for a sigstore instance.

func (*VerifierConfig) Validate added in v0.4.0

func (vc *VerifierConfig) Validate() error

Validate checks that at least one timestamp verification method is set.

Jump to

Keyboard shortcuts

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