Documentation
¶
Index ¶
- Constants
- Variables
- func CacheInstallationDirectory(cacheDirectory, kit, tag string, platform Platform) (string, error)
- func ExactTagForBuildVersion(buildVersion string) (string, error)
- func PreviewSourceCacheDirectory(cache string, selector PreviewSourceSelector) (string, error)
- type Asset
- type Attestation
- type AttestationInput
- type AttestationVerifier
- type AttestedPreviewCandidateIdentity
- type Blob
- type CandidateBuildProfile
- type Channel
- type FixtureSource
- func (source *FixtureSource) AddRelease(index Index, prerelease bool, publishedAt time.Time) error
- func (source *FixtureSource) Fetch(_ context.Context, url string, limit int64) ([]byte, error)
- func (source *FixtureSource) ListReleases(context.Context) ([]Release, error)
- func (source *FixtureSource) SetBlob(url string, data []byte)
- type GitHubSource
- type Index
- type IndexAttestationInput
- type Installer
- func (installer Installer) InspectInstalled(ctx context.Context, installDir string, ...) error
- func (installer Installer) InspectVerifiedArchive(ctx context.Context, resolution Resolution, ...) error
- func (installer Installer) Install(ctx context.Context, resolution Resolution, workspaceRoot string) (Receipt, error)
- func (installer Installer) InstallToCache(ctx context.Context, resolution Resolution, cacheDirectory string, ...) (Receipt, error)
- func (installer Installer) VerifyInstalled(ctx context.Context, installDir string) (Receipt, error)
- func (installer Installer) VerifyWorkspace(ctx context.Context, workspaceRoot, kit string, platform Platform) ([]Receipt, error)
- type Platform
- type PreviewCandidateArtifact
- type PreviewCandidateBlob
- type PreviewCandidateInput
- type PreviewCandidateProducer
- type PreviewCandidateProvenance
- type PreviewCandidateSource
- type PreviewSourceCacheProof
- type PreviewSourceSelector
- type Receipt
- type Release
- type ReleaseDescriptor
- type Resolution
- type ResolveRequest
- type Resolver
- type SigstoreVerifier
- func (verifier SigstoreVerifier) InspectPreviewSourceCache(ctx context.Context, cache string, selector PreviewSourceSelector, ...) error
- func (verifier SigstoreVerifier) InspectPreviewSourceDirectory(ctx context.Context, directory string, selector PreviewSourceSelector, ...) error
- func (verifier SigstoreVerifier) RetainPreviewSourceCache(ctx context.Context, cache, source string, selector PreviewSourceSelector, ...) error
- func (verifier SigstoreVerifier) Verify(ctx context.Context, input AttestationInput) error
- func (verifier SigstoreVerifier) VerifyIndex(ctx context.Context, input IndexAttestationInput) error
- func (verifier SigstoreVerifier) VerifyPreviewCandidate(ctx context.Context, input PreviewCandidateInput) (VerifiedPreviewCandidate, error)
- type Source
- type VerifiedArchive
- type VerifiedInstallation
- type VerifiedPreviewCandidate
Constants ¶
const ( PreviewCandidateProvenanceSchema = "stackkits.preview-candidate-provenance/v1" PreviewCandidateIndexSchema = "stackkits.preview-candidate-index/v1" PreviewCandidateIndexName = "stackkits-preview-candidate-index-v1.json" PreviewCandidatePayloadAttestationName = "payload.intoto.jsonl" )
const ( SchemaVersion = "stackkits-release-index/v1" ReceiptSchemaVersion = "stackkit.release-receipt/v1" ReleaseIndexAssetName = "stackkits-release-index-v1.json" ReleaseIndexAttestationAssetName = "stackkits-release-index-v1.json.intoto.jsonl" TrustedRootAssetName = "sigstore-trusted-root.jsonl" ReleaseReceiptName = "release-receipt.json" SPDXJSONMediaType = "application/spdx+json" InTotoJSONLMediaType = "application/vnd.in-toto+jsonl" GitHubOIDCIssuer = "https://token.actions.githubusercontent.com" GitHubAttestationPredicate = "https://slsa.dev/provenance/v1" SigstoreTrustedRootMediaType = "application/vnd.dev.sigstore.trustedroot+json;version=0.1" DefaultMaxBlobBytes int64 = 4 << 30 )
Variables ¶
var ( ErrDigestMismatch = errors.New("release blob digest mismatch") ErrNoRelease = errors.New("no matching StackKits release") )
Functions ¶
func CacheInstallationDirectory ¶ added in v0.52.6
CacheInstallationDirectory confines both existing and missing cache paths; a missing leaf under a linked ancestor is never treated as an absent cache.
func ExactTagForBuildVersion ¶
ExactTagForBuildVersion converts the release build value embedded by GoReleaser into the one exact GitHub tag that publishes it.
func PreviewSourceCacheDirectory ¶ added in v0.54.10
func PreviewSourceCacheDirectory(cache string, selector PreviewSourceSelector) (string, error)
Types ¶
type Attestation ¶
type AttestationInput ¶
type AttestationVerifier ¶
type AttestationVerifier interface {
Verify(context.Context, AttestationInput) error
VerifyIndex(context.Context, IndexAttestationInput) error
}
type AttestedPreviewCandidateIdentity ¶ added in v0.54.10
type AttestedPreviewCandidateIdentity struct {
Source PreviewCandidateSource `json:"source"`
Producer PreviewCandidateProducer `json:"producer"`
IndexSHA256 string `json:"indexSha256"`
ArchiveSHA256 string `json:"archiveSha256"`
IndexAttestationSHA256 string `json:"indexAttestationSha256,omitempty"`
PayloadAttestationSHA256 string `json:"payloadAttestationSha256,omitempty"`
TrustedRootSHA256 string `json:"trustedRootSha256,omitempty"`
SBOMSHA256 string `json:"sbomSha256,omitempty"`
BuildProfile CandidateBuildProfile `json:"buildProfile,omitempty"`
BuildTags []string `json:"buildTags,omitempty"`
}
AttestedPreviewCandidateIdentity deliberately excludes the caller-admitted artifact metadata, which the offline signature cannot authenticate.
type CandidateBuildProfile ¶ added in v0.54.10
type CandidateBuildProfile string
CandidateBuildProfile discloses the compiler variant, independently of the runtime data profile. Historical candidates without this disclosure are Standard.
const ( CandidateStandard CandidateBuildProfile = "standard" CandidateFullLocal CandidateBuildProfile = "full-local" FullLocalBuildTag = "kombify_full_local" )
type FixtureSource ¶
type FixtureSource struct {
// contains filtered or unexported fields
}
FixtureSource is a hermetic in-memory release source for contract and OSS E2E tests. Product code depends only on Source; it never branches on fixture mode.
func NewFixtureSource ¶
func NewFixtureSource() *FixtureSource
func (*FixtureSource) AddRelease ¶
func (*FixtureSource) ListReleases ¶
func (source *FixtureSource) ListReleases(context.Context) ([]Release, error)
func (*FixtureSource) SetBlob ¶
func (source *FixtureSource) SetBlob(url string, data []byte)
type GitHubSource ¶
func NewGitHubFixtureSource ¶
func NewGitHubFixtureSource(client *http.Client, apiBaseURL string) (*GitHubSource, error)
NewGitHubFixtureSource creates the hermetic HTTP adapter used by the standalone OSS E2E. It deliberately accepts only loopback and the reserved .localhost namespace; public release URLs retain the GitHub-only policy.
func NewGitHubSource ¶
func NewGitHubSource(client *http.Client) *GitHubSource
func (*GitHubSource) GetRelease ¶ added in v0.52.6
GetRelease resolves one exact tag independently of the newest release page. It provides metadata only: Resolver and Installer still authenticate every index, archive and cached receipt before an executable can be used.
func (*GitHubSource) ListReleases ¶
func (source *GitHubSource) ListReleases(ctx context.Context) ([]Release, error)
type Index ¶
type Index struct {
SchemaVersion string `json:"schemaVersion"`
Release ReleaseDescriptor `json:"release"`
Assets []Asset `json:"assets"`
}
type IndexAttestationInput ¶
type Installer ¶
type Installer struct {
Source Source
Attestations AttestationVerifier
MaxBlobBytes int64
Now func() time.Time
}
func (Installer) InspectInstalled ¶
func (installer Installer) InspectInstalled( ctx context.Context, installDir string, inspect func(VerifiedInstallation) error, ) error
InspectInstalled re-verifies an installed release and returns an immutable proof containing the exact bounded archive bytes verified in this operation.
func (Installer) InspectVerifiedArchive ¶
func (installer Installer) InspectVerifiedArchive(ctx context.Context, resolution Resolution, inspect func(VerifiedArchive) error) error
InspectVerifiedArchive downloads and verifies one resolved release in a process-owned temporary directory without installing or caching anything in the Stack workspace. The callback cannot retain the paths after it returns.
func (Installer) InstallToCache ¶ added in v0.52.6
func (installer Installer) InstallToCache(ctx context.Context, resolution Resolution, cacheDirectory string, inspect func(VerifiedInstallation) error) (Receipt, error)
InstallToCache uses the same public trust chain and canonical receipt, with an explicitly selected cache directory independent of a runtime workspace.
func (Installer) VerifyInstalled ¶
func (Installer) VerifyWorkspace ¶
func (installer Installer) VerifyWorkspace(ctx context.Context, workspaceRoot, kit string, platform Platform) ([]Receipt, error)
VerifyWorkspace re-verifies every cached release receipt for one kit and platform without consulting the release source or making network requests.
type PreviewCandidateArtifact ¶ added in v0.54.10
type PreviewCandidateBlob ¶ added in v0.54.10
type PreviewCandidateInput ¶ added in v0.54.10
type PreviewCandidateInput struct {
Expected PreviewCandidateProvenance
Kit string
Platform Platform
ArchiveSHA256 string
Index, IndexAttestation, PayloadAttestation, TrustedRoot []byte
Archive, SBOM []byte
}
PreviewCandidateInput requires the exact index and selected payload bytes. Expected is selected only from the authenticated installed Stage admission, never from the downloaded index or an arbitrary caller-supplied receipt.
type PreviewCandidateProducer ¶ added in v0.54.10
type PreviewCandidateProvenance ¶ added in v0.54.10
type PreviewCandidateProvenance struct {
SchemaVersion string `json:"schemaVersion"`
IndexSHA256 string `json:"indexSha256"`
IndexAttestationSHA256 string `json:"indexAttestationSha256"`
PayloadAttestationSHA256 string `json:"payloadAttestationSha256"`
TrustedRootSHA256 string `json:"trustedRootSha256"`
Artifact PreviewCandidateArtifact `json:"artifact"`
Source PreviewCandidateSource `json:"source"`
Producer PreviewCandidateProducer `json:"producer"`
}
PreviewCandidateProvenance is the frozen cross-product identity. It carries no installation permission. Its artifact identity must come from separately authenticated GitHub metadata retained by the signed Stage admission.
func DecodePreviewCandidateProvenance ¶ added in v0.54.10
func DecodePreviewCandidateProvenance(raw []byte) (PreviewCandidateProvenance, error)
DecodePreviewCandidateProvenance is the strict JSON boundary for installed signed admissions. It authenticates no metadata by itself.
func (PreviewCandidateProvenance) Validate ¶ added in v0.54.10
func (provenance PreviewCandidateProvenance) Validate() error
type PreviewCandidateSource ¶ added in v0.54.10
type PreviewSourceCacheProof ¶ added in v0.54.10
type PreviewSourceCacheProof struct {
SchemaVersion string `json:"schemaVersion"`
Kit string `json:"kit"`
Version string `json:"version"`
Platform Platform `json:"platform"`
IndexSHA256 string `json:"indexSha256"`
ArchiveSHA256 string `json:"archiveSha256"`
CLISHA256 string `json:"cliSha256"`
IndexAttestationSHA256 string `json:"indexAttestationSha256"`
PayloadAttestationSHA256 string `json:"payloadAttestationSha256"`
TrustedRootSHA256 string `json:"trustedRootSha256"`
SBOMSHA256 string `json:"sbomSha256"`
Source PreviewCandidateSource `json:"source"`
Producer PreviewCandidateProducer `json:"producer"`
BuildProfile CandidateBuildProfile `json:"buildProfile,omitempty"`
BuildTags []string `json:"buildTags,omitempty"`
}
type PreviewSourceSelector ¶ added in v0.54.10
type PreviewSourceSelector struct {
Kit, Version string
Platform Platform
IndexSHA256, ArchiveSHA256, CLISHA256 string
}
PreviewSourceSelector selects bytes, never installation authority. Every readback re-verifies the canonical offline signature policy. Artifact IDs retained beside those bytes remain untrusted and are not exported as proof.
func PreviewSourceSelectorFromIndex ¶ added in v0.54.10
func PreviewSourceSelectorFromIndex(raw []byte, version string, platform Platform, indexSHA256, archiveSHA256, cliSHA256 string) (PreviewSourceSelector, error)
PreviewSourceSelectorFromIndex resolves metadata only. A deployment's kit label is not necessarily the packaged bootstrap archive's kit. The exact independently selected index/archive digests choose one asset; the opaque Sigstore verifier and executable equality still decide whether it is proof.
type Receipt ¶
type Receipt struct {
SchemaVersion string `json:"schemaVersion"`
Kit string `json:"kit"`
Version string `json:"version"`
Channel Channel `json:"channel"`
Platform Platform `json:"platform"`
ArchiveSHA256 string `json:"archiveSha256"`
SBOMSHA256 string `json:"sbomSha256"`
AttestationSHA256 string `json:"attestationSha256"`
AttestationIssuer string `json:"attestationIssuer"`
AttestationSubject string `json:"attestationSubject"`
TrustedRootSHA256 string `json:"trustedRootSha256"`
IndexSHA256 string `json:"indexSha256"`
IndexAttestationSHA256 string `json:"indexAttestationSha256"`
VerifiedAt time.Time `json:"verifiedAt"`
InstallDir string `json:"installDir"`
}
type ReleaseDescriptor ¶
type Resolution ¶
type Resolver ¶
type Resolver struct {
Source Source
Attestations AttestationVerifier
}
func (Resolver) Resolve ¶
func (resolver Resolver) Resolve(ctx context.Context, request ResolveRequest) (Resolution, error)
type SigstoreVerifier ¶
type SigstoreVerifier struct {
// contains filtered or unexported fields
}
SigstoreVerifier verifies a cached GitHub artifact-attestation bundle against the exact cached trusted root, archive digest, GitHub OIDC issuer, workflow identity, predicate type, and subject name declared by the release index. It performs no network requests.
trustedRootDocumentSHA256 exists for same-package hermetic tests. Production callers cannot set it and are bound to the versioned policy embedded in the binary.
func (SigstoreVerifier) InspectPreviewSourceCache ¶ added in v0.54.10
func (verifier SigstoreVerifier) InspectPreviewSourceCache(ctx context.Context, cache string, selector PreviewSourceSelector, inspect func(VerifiedPreviewCandidate) error) error
func (SigstoreVerifier) InspectPreviewSourceDirectory ¶ added in v0.54.10
func (verifier SigstoreVerifier) InspectPreviewSourceDirectory(ctx context.Context, directory string, selector PreviewSourceSelector, inspect func(VerifiedPreviewCandidate) error) error
func (SigstoreVerifier) RetainPreviewSourceCache ¶ added in v0.54.10
func (verifier SigstoreVerifier) RetainPreviewSourceCache(ctx context.Context, cache, source string, selector PreviewSourceSelector, inspect func(VerifiedPreviewCandidate) error) error
RetainPreviewSourceCache acquires only verified immutable bytes. The caller's callback must match the archive executable against its exact source selector. Existing entries are verified and refused on corruption, never overwritten.
func (SigstoreVerifier) Verify ¶
func (verifier SigstoreVerifier) Verify(ctx context.Context, input AttestationInput) error
func (SigstoreVerifier) VerifyIndex ¶
func (verifier SigstoreVerifier) VerifyIndex(ctx context.Context, input IndexAttestationInput) error
func (SigstoreVerifier) VerifyPreviewCandidate ¶ added in v0.54.10
func (verifier SigstoreVerifier) VerifyPreviewCandidate(ctx context.Context, input PreviewCandidateInput) (VerifiedPreviewCandidate, error)
VerifyPreviewCandidate preserves the public tag trust policy. Candidate identity is explicit and adds certificate-bound source, signer, hosted runner and exact run invocation requirements to the same pinned-root verifier.
type VerifiedArchive ¶
type VerifiedArchive struct {
ArchivePath string
SBOMPath string
AttestationPath string
TrustedRootPath string
}
VerifiedArchive is a short-lived, fully verified release payload. Paths are valid only for the duration of InspectVerifiedArchive's callback.
type VerifiedInstallation ¶
type VerifiedInstallation struct {
// contains filtered or unexported fields
}
VerifiedInstallation is an immutable proof of one offline-verified cached release. Its private token and fields make the zero value invalid and prevent another package from fabricating or mutating release authority.
type VerifiedPreviewCandidate ¶ added in v0.54.10
type VerifiedPreviewCandidate struct {
// contains filtered or unexported fields
}
VerifiedPreviewCandidate proves only the offline private build provenance. It is deliberately unrelated to VerifiedInstallation and the public Receipt. Stage installation still needs authenticated assignment/Guard custody. The imagepreparation owner may separately admit a fresh neutral bundle only after full profile, process, five-tool, provider, image and model verification.
func (VerifiedPreviewCandidate) Inspect ¶ added in v0.54.10
func (candidate VerifiedPreviewCandidate) Inspect(inspect func(AttestedPreviewCandidateIdentity, string, string, Platform, io.Reader) error) error
func (VerifiedPreviewCandidate) SourceCacheProof ¶ added in v0.54.10
func (candidate VerifiedPreviewCandidate) SourceCacheProof(cliSHA256 string) (PreviewSourceCacheProof, error)