update

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package update verifies signed release metadata and performs recoverable executable replacement. It never trusts a checksum that was not covered by the release signature.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePublicKey

func ParsePublicKey(encoded string) (ed25519.PublicKey, error)

func SigningPayload

func SigningPayload(manifest Manifest) ([]byte, error)

func Verify

func Verify(manifest Manifest, publicKey ed25519.PublicKey) error

Types

type Asset

type Asset struct {
	URL    string `json:"url"`
	SHA256 string `json:"sha256"`
	Size   int64  `json:"size"`
}

type Client

type Client struct {
	PublicKey ed25519.PublicKey
	HTTP      *http.Client
	GOOS      string
	GOARCH    string
}

func (Client) Apply

func (c Client) Apply(ctx context.Context, manifest Manifest, executable string) (Result, error)

func (Client) FetchManifest

func (c Client) FetchManifest(ctx context.Context, rawURL string) (Manifest, error)

type Manifest

type Manifest struct {
	SchemaVersion int              `json:"schemaVersion"`
	Version       string           `json:"version"`
	PublishedAt   string           `json:"publishedAt"`
	Assets        map[string]Asset `json:"assets"`
	Signature     string           `json:"signature"`
}

type Result

type Result struct {
	Version      string `json:"version"`
	PreviousPath string `json:"previousPath,omitempty"`
	Updated      bool   `json:"updated"`
}

func Rollback

func Rollback(executable string) (Result, error)

Jump to

Keyboard shortcuts

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