Documentation
¶
Index ¶
- func CompressFS(fsys fs.FS, buf io.Writer, skipDirs map[string]bool) error
- func FromContextOrDefaults(ctx context.Context) time.Duration
- func GetTrustedRoot(ctx context.Context) (*root.TrustedRoot, error)
- func ToContext(ctx context.Context, duration time.Duration) context.Context
- func Uncompress(src io.Reader, dst string) error
- func UncompressMemFS(src io.Reader, stripPrefix string) (fs.FS, error)
- type TUFClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContextOrDefaults ¶ added in v0.13.0
FromContextOrDefaults returns a stored trustrootResyncPeriod if attached. If not found, it returns a default duration
func GetTrustedRoot ¶ added in v0.13.0
func GetTrustedRoot(ctx context.Context) (*root.TrustedRoot, error)
GetTrustedRoot returns the trusted root for the TUF repository.
Types ¶
type TUFClient ¶ added in v0.15.1
type TUFClient struct {
// contains filtered or unexported fields
}
TUFClient wraps a sigstore-go TUF client for delegation-aware target retrieval and provides lazy access to a raw go-tuf v2 updater for legacy target enumeration via GetTopLevelTargets.
func ClientFromRemote ¶
func ClientFromRemote(_ context.Context, mirror string, rootJSON []byte, targets string) (*TUFClient, error)
ClientFromRemote will construct a TUF client from a root and mirror.
func ClientFromSerializedMirror ¶
func ClientFromSerializedMirror(_ context.Context, repo, rootJSON []byte, targets, stripPrefix string) (*TUFClient, error)
ClientFromSerializedMirror will construct a TUF client by unzip/untar the repository and constructing an in-memory TUF client for it.
func (*TUFClient) GetTarget ¶ added in v0.15.1
GetTarget downloads a target by name, correctly traversing TUF delegations.
func (*TUFClient) GetTopLevelTargets ¶ added in v0.15.1
func (c *TUFClient) GetTopLevelTargets() (map[string]*metadata.TargetFiles, error)
GetTopLevelTargets returns the top-level target files metadata. This does not traverse delegations and should only be used for legacy fallback paths. The raw updater is lazily initialized on first call to avoid a double TUF refresh when only GetTarget is needed.