widgetpack

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstallFailed = errors.New("widgetpack: install failed")

ErrInstallFailed is returned when pack installation fails.

View Source
var ErrPackNotFound = errors.New("widgetpack: not found")

ErrPackNotFound is returned when a pack is not found.

Functions

This section is empty.

Types

type InstallRequest

type InstallRequest struct {
	Ref     string // OCI reference, e.g. "registry.example.com/bar-widgets:1.0.0"
	Name    string
	Version string
}

InstallRequest carries the parameters for a pack installation.

type InstalledPack

type InstalledPack struct {
	Name            string
	Version         string
	SHA256          string
	SignatureStatus string // "verified", "unsigned", "invalid", "expired"
}

InstalledPack describes an installed widget pack.

type Installer

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

Installer handles OCI pull + verify + store. OCI pull and cosign verification are deferred to a future implementation; this stub registers the pack metadata immediately.

func NewInstaller

func NewInstaller(store *Store) *Installer

NewInstaller creates a new pack installer.

func (*Installer) Install

func (i *Installer) Install(ctx context.Context, req InstallRequest) (*InstalledPack, error)

Install registers a widget pack. Currently a stub — real OCI/cosign implementation deferred.

type Store

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

Store manages the on-disk widget pack registry. The current implementation is in-memory; production will use SQLite.

func NewStore

func NewStore() *Store

NewStore creates a new in-memory store.

func (*Store) Add

func (s *Store) Add(_ context.Context, pack InstalledPack) error

Add registers an installed pack.

func (*Store) Get

func (s *Store) Get(_ context.Context, name, version string) (*InstalledPack, error)

Get retrieves an installed pack by name and version.

func (*Store) List

func (s *Store) List(_ context.Context) ([]InstalledPack, error)

List returns all installed packs.

func (*Store) Remove

func (s *Store) Remove(_ context.Context, name, version string) error

Remove unregisters a pack.

type TrustPolicy

type TrustPolicy struct {
	AllowedSigners []string
	AllowUnsigned  bool
}

TrustPolicy defines which pack signers are trusted.

func (*TrustPolicy) Verify

func (tp *TrustPolicy) Verify(status string, _ []string) bool

Verify checks whether a pack's signature satisfies the trust policy. signers is the list of verified signer identities from the pack's signature envelope.

Jump to

Keyboard shortcuts

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