Documentation ¶
Index ¶
- Constants
- func DefaultRoot() []byte
- func StagingRoot() []byte
- func URLToPath(url string) string
- type Client
- type Config
- type Options
- func (o *Options) WithCachePath(path string) *Options
- func (o *Options) WithCacheValidity(days int) *Options
- func (o *Options) WithDisableConsistentSnapshot() *Options
- func (o *Options) WithDisableLocalCache() *Options
- func (o *Options) WithFetcher(f fetcher.Fetcher) *Options
- func (o *Options) WithForceCache() *Options
- func (o *Options) WithRepositoryBaseURL(url string) *Options
- func (o *Options) WithRoot(root []byte) *Options
Constants ¶
const ( DefaultMirror = "https://tuf-repo-cdn.sigstore.dev" StagingMirror = "https://tuf-repo-cdn.sigstage.dev" // The following caching values can be used for the CacheValidity option NoCache = 0 MaxCache = math.MaxInt )
Variables ¶
This section is empty.
Functions ¶
func DefaultRoot ¶ added in v0.2.0
func DefaultRoot() []byte
DefaultRoot returns the root.json for the public good instance
func StagingRoot ¶ added in v0.4.0
func StagingRoot() []byte
StagingRoot returns the root.json for the staging instance
Types ¶
type Client ¶ added in v0.2.0
type Client struct {
// contains filtered or unexported fields
}
Client is a Sigstore TUF client
func DefaultClient ¶ added in v0.2.0
DefaultClient returns a Sigstore TUF client for the public good instance
type Config ¶ added in v0.2.0
func LoadConfig ¶ added in v0.2.0
type Options ¶ added in v0.2.0
type Options struct { // CacheValidity period in days (default 0). The client will persist a // timestamp with the cache after refresh. Note that the client will // always refresh the cache if the metadata is expired or if the client is // unable to find a persisted timestamp, so this is not an optimal control // for air-gapped environments. Use const MaxCache to update the cache when // the metadata is expired, though the first initialization will still // refresh the cache. CacheValidity int // ForceCache controls if the cache should be used without update // as long as the metadata is valid. Use ForceCache over CacheValidity // if you want to always use the cache up until its expiration. Note that // the client will refresh the cache once the metadata has expired, so this // is not an optimal control for air-gapped environments. Clients instead // should provide a trust root file directly to the client to bypass TUF. ForceCache bool // Root is the TUF trust anchor Root []byte // CachePath is the location on disk for TUF cache // (default $HOME/.sigstore/tuf) CachePath string // RepositoryBaseURL is the TUF repository location URL // (default https://tuf-repo-cdn.sigstore.dev) RepositoryBaseURL string // DisableLocalCache mode allows a client to work on a read-only // files system if this is set, cache path is ignored. DisableLocalCache bool // DisableConsistentSnapshot DisableConsistentSnapshot bool // Fetcher is the metadata fetcher Fetcher fetcher.Fetcher }
Options represent the various options for a Sigstore TUF Client
func DefaultOptions ¶ added in v0.2.0
func DefaultOptions() *Options
DefaultOptions returns an options struct for the public good instance
func (*Options) WithCachePath ¶ added in v0.2.0
WithCachePath sets the location on disk for TUF cache
func (*Options) WithCacheValidity ¶ added in v0.2.0
WithCacheValidity sets the cache validity period in days
func (*Options) WithDisableConsistentSnapshot ¶ added in v0.2.0
WithDisableConsistentSnapshot sets the client to disable consistent snapshot
func (*Options) WithDisableLocalCache ¶ added in v0.2.0
WithDisableLocalCache sets the client to work on a read-only file system
func (*Options) WithFetcher ¶ added in v0.2.0
WithFetcher sets the metadata fetcher
func (*Options) WithForceCache ¶ added in v0.2.0
WithForceCache forces the client to use the cache without updating
func (*Options) WithRepositoryBaseURL ¶ added in v0.2.0
WithRepositoryBaseURL sets the TUF repository location URL