Documentation
¶
Overview ¶
Package manifest reads and validates pin.yaml.
Index ¶
Constants ¶
const ( ForgeGitHub = "github" ForgeGitLab = "gitlab" ForgeGitea = "gitea" ForgeCodeberg = "codeberg" ForgeBitbucket = "bitbucket" ForgeGit = "git" )
const DefaultMinReleaseAge = 48 * time.Hour
DefaultMinReleaseAge: 48h catches most malicious npm publishes (typically detected within 24–48h) while keeping the bleeding-edge lag bounded. Opt out per entry or globally with `min_release_age: 0`.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
RawSource string `yaml:"source"`
Files []string `yaml:"files"`
Format string `yaml:"format"`
MinReleaseAge *Duration `yaml:"min_release_age"`
Trust *Trust `yaml:"trust"`
StripSourcemap bool `yaml:"strip_sourcemap"`
// RegistryURL overrides the default npm registry for this entry.
// Honoured by the npm source kind; encoded as a `repository_url`
// qualifier on the resolved purl so it round-trips into pin.lock.
RegistryURL string `yaml:"registry_url"`
// contains filtered or unexported fields
}
type Manifest ¶
type Manifest struct {
Out string `yaml:"out"`
Layout Layout `yaml:"layout"`
MinReleaseAge *Duration `yaml:"min_release_age"`
Trust *Trust `yaml:"trust"`
Assets []Entry `yaml:"assets"`
}
func (*Manifest) Cooldown ¶
Cooldown builds a cooldown.Config from the manifest's min_release_age. Default falls back to DefaultMinReleaseAge. Per-entry overrides become Packages entries keyed by the entry's package purl without a version.
func (*Manifest) EffectiveTrust ¶
EffectiveTrust: per-entry scalars override manifest scalars; TrustedWorkflows merges across both, deduped.
type Source ¶
func ParseSource ¶
type SourceKind ¶
type SourceKind string
const ( SourceNPM SourceKind = "npm" SourceForge SourceKind = "forge" SourceURL SourceKind = "url" )
type Trust ¶
type Trust struct {
RequireProvenance *bool `yaml:"require_provenance"`
RequirePublisherMatchesRepository *bool `yaml:"require_publisher_matches_repository"`
TrustedWorkflows []string `yaml:"trusted_workflows"`
}
Trust. Nil pointers let the manifest default propagate; nil TrustedWorkflows means "inherit from parent" rather than "empty".