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

resolver

package
v0.29.0 Latest Latest
Warning

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

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

Documentation

Overview

Package resolver implements the 8-stage Strata resolution pipeline.

The resolver transforms a *spec.Profile into a *spec.LockFile. It wires registry.Client, probe.Client, and trust.RekorClient together into a deterministic, fail-fast pipeline.

No partial lockfiles: every stage is a clean pass or a hard stop with an actionable error. Callers either receive a fully populated LockFile or a *ResolutionError with stage, code, and a message pointing to the fix.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Registry is the layer catalog client. Required.
	Registry registry.Client

	// Probe resolves OS aliases to AMI IDs and BaseCapabilities. Required.
	Probe *probe.Client

	// Rekor is the transparency log client for Sigstore verification.
	// Optional: when nil, bundle and Rekor entry presence are still required
	// but no live API verification is performed.
	Rekor trust.RekorClient

	// StrataVersion is written into the resolved LockFile.
	StrataVersion string

	// Warnings is an optional writer for non-fatal diagnostic messages.
	// If nil, warnings are silently discarded.
	Warnings io.Writer

	// AllowUnsignedOffline permits stage 7 to accept a layer with no Sigstore
	// bundle or Rekor entry, warning instead of refusing. It exists for one
	// caller: a resolve against the embedded, unsigned offline catalog (no
	// registry configured), where refusing every layer means the shipped
	// formations cannot be resolved even for local, non-trust use (#108). It is
	// set only on that path; a resolve against a real registry leaves it false and
	// stage 7 refuses an unsigned layer as before. An offline resolve is not a
	// trust decision and the lockfile it produces is not signed.
	AllowUnsignedOffline bool
}

Config holds the external dependencies for a Resolver.

type ResolutionError

type ResolutionError struct {
	Stage     string
	Code      string
	Message   string
	Available []string // e.g. available versions when a layer is not found
}

ResolutionError is a structured error produced by the resolver pipeline. It carries actionable context so users know exactly what failed and how to fix it.

func (*ResolutionError) Error

func (e *ResolutionError) Error() string

type Resolver

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

Resolver transforms a *spec.Profile into a *spec.LockFile via an 8-stage deterministic pipeline.

func New

func New(cfg Config) (*Resolver, error)

New creates a Resolver and validates that required config fields are set.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, profile *spec.Profile) (*spec.LockFile, error)

Resolve transforms profile into a fully resolved LockFile. If any stage fails the entire resolution fails — no partial lockfiles are returned.

Jump to

Keyboard shortcuts

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