filesystem

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package filesystem implements an attestation collector from a fs.FS

Index

Constants

View Source
const SignaturePredicateType = attestation.PredicateType("https://carabiner.dev/ampel/signature/v1")

SignaturePredicateType is the predicate type for virtual signature attestations.

Variables

View Source
var Build = func(istr string) (attestation.Repository, error) {
	return New(WithInitString(istr))
}

Implement the factory function

View Source
var TypeMoniker = "fs"
View Source
var WithFS = func(iofs fs.FS) fnOpts {
	return func(c *Collector) error {
		c.FS = iofs
		return nil
	}
}
View Source
var WithInitString = func(s string) fnOpts {
	return func(c *Collector) error {
		c.FS = os.DirFS(s)
		return nil
	}
}
View Source
var WithKey = func(keys ...key.PublicKeyProvider) fnOpts {
	return func(c *Collector) error {
		c.Keys = append(c.Keys, keys...)
		return nil
	}
}
View Source
var WithPath = func(path string) fnOpts {
	return func(c *Collector) error {
		c.Path = strings.TrimPrefix(path, "/")
		if c.Path == "" {
			c.Path = "."
		}
		return nil
	}
}
View Source
var WithSignatureExtensions = func(exts []string) fnOpts {
	return func(c *Collector) error {
		c.SignatureExtensions = exts
		return nil
	}
}
View Source
var WithSigstoreBundleExtensions = func(exts []string) fnOpts {
	return func(c *Collector) error {
		c.SigstoreBundleExtensions = exts
		return nil
	}
}

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Extensions               []string
	SignatureExtensions      []string
	SigstoreBundleExtensions []string
	IgnoreOtherFiles         bool
	Path                     string
	FS                       fs.FS
	Keys                     []key.PublicKeyProvider
}

Collector is the filesystem collector

func New

func New(opts ...fnOpts) (*Collector, error)

func (*Collector) Fetch

Fetch queries the repository and retrieves any attestations matching the query

func (*Collector) FetchByPredicateType

func (c *Collector) FetchByPredicateType(ctx context.Context, opts attestation.FetchOptions, pts []attestation.PredicateType) ([]attestation.Envelope, error)

func (*Collector) FetchBySubject

func (c *Collector) FetchBySubject(ctx context.Context, opts attestation.FetchOptions, subj []attestation.Subject) ([]attestation.Envelope, error)

func (*Collector) SetKeys added in v0.3.0

func (c *Collector) SetKeys(keys []key.PublicKeyProvider)

SetKeys sets the verification keys used by the collector.

Jump to

Keyboard shortcuts

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