Documentation ¶
Index ¶
- Constants
- func RegisterAttestation(name, uri string, run RunType, factoryFunc AttestorFactory)
- type AttestationContext
- func (ctx *AttestationContext) CompletedAttestors() []Attestor
- func (ctx *AttestationContext) Context() context.Context
- func (ctx *AttestationContext) Hashes() []crypto.Hash
- func (ctx *AttestationContext) Materials() map[string]cryptoutil.DigestSet
- func (ctx *AttestationContext) Products() map[string]Product
- func (ctx *AttestationContext) RunAttestors() error
- func (ctx *AttestationContext) WorkingDir() string
- type AttestationContextOption
- func WithCommandAttestor(attestor Attestor) AttestationContextOption
- func WithContext(ctx context.Context) AttestationContextOption
- func WithHashes(hashes []crypto.Hash) AttestationContextOption
- func WithMaterialAttestor(attestor Attestor) AttestationContextOption
- func WithProductAttestor(attestor Attestor) AttestationContextOption
- func WithWorkingDir(workingDir string) AttestationContextOption
- type Attestor
- type AttestorFactory
- type Collection
- type CollectionAttestation
- type ErrAttestationNotFound
- type ErrInvalidOption
- type Materialer
- type Producer
- type Product
- type RunType
- type Subjecter
Constants ¶
View Source
const CollectionType = "https://witness.testifysec.com/attestation-collection/v0.1"
Variables ¶
This section is empty.
Functions ¶
func RegisterAttestation ¶
func RegisterAttestation(name, uri string, run RunType, factoryFunc AttestorFactory)
Types ¶
type AttestationContext ¶
type AttestationContext struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(attestors []Attestor, opts ...AttestationContextOption) (*AttestationContext, error)
func (*AttestationContext) CompletedAttestors ¶
func (ctx *AttestationContext) CompletedAttestors() []Attestor
func (*AttestationContext) Context ¶
func (ctx *AttestationContext) Context() context.Context
func (*AttestationContext) Hashes ¶
func (ctx *AttestationContext) Hashes() []crypto.Hash
func (*AttestationContext) Materials ¶
func (ctx *AttestationContext) Materials() map[string]cryptoutil.DigestSet
func (*AttestationContext) Products ¶
func (ctx *AttestationContext) Products() map[string]Product
func (*AttestationContext) RunAttestors ¶
func (ctx *AttestationContext) RunAttestors() error
func (*AttestationContext) WorkingDir ¶
func (ctx *AttestationContext) WorkingDir() string
type AttestationContextOption ¶
type AttestationContextOption func(ctx *AttestationContext)
func WithCommandAttestor ¶
func WithCommandAttestor(attestor Attestor) AttestationContextOption
func WithContext ¶
func WithContext(ctx context.Context) AttestationContextOption
func WithHashes ¶
func WithHashes(hashes []crypto.Hash) AttestationContextOption
func WithMaterialAttestor ¶
func WithMaterialAttestor(attestor Attestor) AttestationContextOption
func WithProductAttestor ¶
func WithProductAttestor(attestor Attestor) AttestationContextOption
func WithWorkingDir ¶
func WithWorkingDir(workingDir string) AttestationContextOption
type Attestor ¶
type Attestor interface { Name() string Type() string RunType() RunType Attest(ctx *AttestationContext) error }
type AttestorFactory ¶
type AttestorFactory func() Attestor
func FactoryByName ¶
func FactoryByName(name string) (AttestorFactory, bool)
func FactoryByType ¶
func FactoryByType(uri string) (AttestorFactory, bool)
type Collection ¶
type Collection struct { Name string `json:"name"` Attestations []CollectionAttestation `json:"attestations"` }
func NewCollection ¶
func NewCollection(name string, attestors []Attestor) Collection
func (*Collection) Artifacts ¶
func (c *Collection) Artifacts() map[string]cryptoutil.DigestSet
Artifacts returns a map of digestsets that describe the union of the materials and products from the collection. This essentially gives a view of end state of the files after all the attestors in the collection ran.
func (*Collection) Materials ¶
func (c *Collection) Materials() map[string]cryptoutil.DigestSet
func (*Collection) Subjects ¶
func (c *Collection) Subjects() map[string]cryptoutil.DigestSet
type CollectionAttestation ¶
type CollectionAttestation struct { Type string `json:"type"` Attestation Attestor `json:"attestation"` }
func NewCollectionAttestation ¶
func NewCollectionAttestation(attestor Attestor) CollectionAttestation
func (*CollectionAttestation) UnmarshalJSON ¶
func (c *CollectionAttestation) UnmarshalJSON(data []byte) error
type ErrAttestationNotFound ¶
type ErrAttestationNotFound string
func (ErrAttestationNotFound) Error ¶
func (e ErrAttestationNotFound) Error() string
type ErrInvalidOption ¶
func (ErrInvalidOption) Error ¶
func (e ErrInvalidOption) Error() string
type Materialer ¶
type Materialer interface {
Materials() map[string]cryptoutil.DigestSet
}
type Product ¶
type Product struct { MimeType string `json:"mime_type"` Digest cryptoutil.DigestSet `json:"digest"` }
type Subjecter ¶
type Subjecter interface {
Subjects() map[string]cryptoutil.DigestSet
}
Click to show internal directories.
Click to hide internal directories.