uptane

package
v0.56.0-devel Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package uptane contains the logic needed to perform the Uptane verification checks against stored TUF metadata and the associated config files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Client is an uptane client

func NewClient

func NewClient(cacheDB *bbolt.DB, orgUUIDProvider OrgUUIDProvider, options ...ClientOption) (c *Client, err error)

NewClient creates a new uptane client

func (*Client) DirectorRoot

func (c *Client) DirectorRoot(version uint64) ([]byte, error)

DirectorRoot returns a director root

func (*Client) State

func (c *Client) State() (State, error)

State returns the state of the uptane client

func (*Client) StoredOrgUUID

func (c *Client) StoredOrgUUID() (string, error)

StoredOrgUUID returns the org UUID given by the backend

func (*Client) TUFVersionState

func (c *Client) TUFVersionState() (TUFVersions, error)

TUFVersionState TODO <remote-config>

func (*Client) TargetFile

func (c *Client) TargetFile(path string) ([]byte, error)

TargetFile returns the content of a target if the repository is in a verified state

func (*Client) Targets

func (c *Client) Targets() (data.TargetFiles, error)

Targets returns the current targets of this uptane client

func (*Client) TargetsCustom

func (c *Client) TargetsCustom() ([]byte, error)

TargetsCustom returns the current targets custom of this uptane client

func (*Client) TargetsMeta

func (c *Client) TargetsMeta() ([]byte, error)

TargetsMeta returns the current raw targets.json meta of this uptane client

func (*Client) Update

func (c *Client) Update(response *pbgo.LatestConfigsResponse) error

Update updates the uptane client and rollbacks in case of error

type ClientOption

type ClientOption func(c *Client)

ClientOption describes a function in charge of changing the uptane client

func WithConfigRootOverride

func WithConfigRootOverride(site string, configRootOverride string) ClientOption

WithConfigRootOverride overrides config root

func WithDirectorRootOverride

func WithDirectorRootOverride(site string, directorRootOverride string) ClientOption

WithDirectorRootOverride overrides director root

func WithOrgIDCheck

func WithOrgIDCheck(orgID int64) ClientOption

WithOrgIDCheck sets the org ID

type MetaState

type MetaState struct {
	Version uint64
	Hash    string
}

MetaState represents the state of a tuf file

type OrgUUIDProvider

type OrgUUIDProvider func() (string, error)

OrgUUIDProvider is a provider of the agent org UUID

type State

type State struct {
	ConfigState     map[string]MetaState
	DirectorState   map[string]MetaState
	TargetFilenames map[string]string
}

State represents the state of an uptane client

func (*State) ConfigRootVersion

func (s *State) ConfigRootVersion() uint64

ConfigRootVersion returns the version of the config root.json file

func (*State) ConfigSnapshotVersion

func (s *State) ConfigSnapshotVersion() uint64

ConfigSnapshotVersion returns the version of the config snapshot.json file

func (*State) DirectorRootVersion

func (s *State) DirectorRootVersion() uint64

DirectorRootVersion returns the version of the director root.json file

func (*State) DirectorTargetsVersion

func (s *State) DirectorTargetsVersion() uint64

DirectorTargetsVersion returns the version of the director targets.json file

type TUFVersions

type TUFVersions struct {
	DirectorRoot    uint64
	DirectorTargets uint64
	ConfigRoot      uint64
	ConfigSnapshot  uint64
}

TUFVersions TODO <remote-config>

Jump to

Keyboard shortcuts

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