repo

package
v0.0.0-...-2208570 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-2-Clause Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFromConfig

func AddFromConfig(ctx context.Context, client *sshutil.Client, config *Config) error

AddFromConfig writes the given config to the given remote install path and adds it as an update source.

Types

type Config

type Config struct {
	URL              string         `json:"repo_url"`
	RootKeys         []KeyConfig    `json:"root_keys"`
	Mirrors          []MirrorConfig `json:"mirrors"`
	RootVersion      uint32         `json:"root_version"`
	RootThreshold    uint32         `json:"root_threshold"`
	UpdatePackageURL string         `json:"update_package_url,omitempty"`
}

Config is a struct that mirrors an associated FIDL table definition in //sdk/fidl/fuchsia.pkg/repo.fidl. Documentation is as in that file. Ditto for the types that comprise its definition.

Keep these in sync with their repo.fidl counterparts as well as the custom

func (*Config) MarshalJSON

func (cfg *Config) MarshalJSON() ([]byte, error)

func (*Config) UnmarshalJSON

func (cfg *Config) UnmarshalJSON(data []byte) error

type KeyConfig

type KeyConfig struct {
	// ED25519Key is a 32-byte, lowercase, hex-encoded key.
	ED25519Key string
}

func GetRootKeys

func GetRootKeys(root *tuf_data.Root) ([]KeyConfig, error)

GetRootKeys returns the list of public key config objects as read from the contents of a repository's root metadata file.

func GetRootKeysInsecurely

func GetRootKeysInsecurely(ctx context.Context, repoURL string) ([]KeyConfig, error)

GetRootKeysInsecurely returns the list of public key config objects from a package repository. Note this is an insecure method, as it leaves the caller open to a man-in-the-middle attack.

func (*KeyConfig) MarshalJSON

func (key *KeyConfig) MarshalJSON() ([]byte, error)

func (*KeyConfig) UnmarshalJSON

func (key *KeyConfig) UnmarshalJSON(data []byte) error

type MirrorConfig

type MirrorConfig struct {
	URL       string `json:"mirror_url"`
	Subscribe bool   `json:"subscribe"`
	BlobURL   string `json:"blob_mirror_url,omitempty"`
}

Jump to

Keyboard shortcuts

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