Documentation
¶
Overview ¶
Package upgrade implements self-update from GitHub releases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
}
Asset is a single file attached to a GitHub release.
type CheckResult ¶
CheckResult is the result of a version check.
func Check ¶
func Check(current string) (*CheckResult, error)
Check compares current against the latest GitHub release tag and returns a CheckResult describing whether an update is available.
type Options ¶ added in v0.0.2
type Options struct {
// SkipVerify installs without proving the archive's provenance.
//
// It exists for air-gapped mirrors that cannot reach Sigstore, and for
// nothing else. It does not disable the checksum: that still runs, and
// still proves only that the download arrived intact — checksums.txt is
// served from the same release as the archive, so an attacker who can
// replace one replaces the other.
SkipVerify bool
// Verifier overrides the provenance verifier. Tests set it.
Verifier *provenance.Verifier
}
Options controls how an upgrade verifies what it is about to install.
The zero value verifies, deliberately: a security check whose default depends on a caller remembering to enable it is one that will eventually be forgotten at some call site nobody is looking at.
Click to show internal directories.
Click to hide internal directories.