Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
OutOfRangeError = errors.New("out of range")
)
Functions ¶
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"` UseLocalMirror bool `json:"use_local_mirror,omitempty"` StorageType RepositoryStorageType `json:"storage_type,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 (*Config) UnmarshalJSON ¶
type KeyConfig ¶
type KeyConfig struct { // ED25519Key is a 32-byte, lowercase, hex-encoded key. ED25519Key string }
func GetRootKeys ¶
GetRootKeys returns the list of public key config objects as read from the contents of a repository's root metadata file.
func (*KeyConfig) MarshalJSON ¶
func (*KeyConfig) UnmarshalJSON ¶
type MirrorConfig ¶
type RepositoryStorageType ¶
type RepositoryStorageType uint32
The underlying type of the FIDL RepositoryStorageType is uint32, see //sdk/fidl/fuchsia.pkg/repo.fidl and https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#enums
const ( Unset RepositoryStorageType = iota Ephemeral Persistent )
func (RepositoryStorageType) MarshalJSON ¶
func (t RepositoryStorageType) MarshalJSON() ([]byte, error)
func (*RepositoryStorageType) UnmarshalJSON ¶
func (t *RepositoryStorageType) UnmarshalJSON(b []byte) error
type RootMetadata ¶
type RootMetadata struct { // RootKeys is the list of public key config objects from a package // repository. RootKeys []KeyConfig // RootVersion is the root version of the repository RootVersion uint32 // RootThreshold is how many signatures the root metadata needs before // it is considered valid. RootThreshold uint32 }
RootMetadata describes the package repository root metadata.
func GetRootMetadataInsecurely ¶
func GetRootMetadataInsecurely(ctx context.Context, repoURL string) (RootMetadata, error)
GetRootMetadataInsecurely returns the TUF root metadata. Note this is an insecure method, as it leaves the caller open to a man-in-the-middle attack.