Documentation
¶
Index ¶
- Constants
- Variables
- type Metadata
- type Options
- type ParseOptions
- type Snapper
- type SnapperImplementation
- type Snapshot
- func (s *Snapshot) AsStatement() attestation.Statement
- func (s *Snapshot) GetData() []byte
- func (s *Snapshot) GetParsed() any
- func (s *Snapshot) GetSource() attestation.Subject
- func (s *Snapshot) GetType() attestation.PredicateType
- func (s *Snapshot) GetVerifications() []*attestation.SignatureVerification
- func (s *Snapshot) SetSource(attestation.Subject)
- func (s *Snapshot) SetType(t attestation.PredicateType) error
- type Spec
- type SpecParser
Constants ¶
View Source
const ( PayloadTypeStruct = "struct" PayloadTypeArray = "array" )
Variables ¶
View Source
var PayloadTypes = []string{PayloadTypeStruct, PayloadTypeArray}
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// ResponseHeaders is the list of response headers the snapper will record
ResponseHeaders []string
}
type ParseOptions ¶
type SnapperImplementation ¶
type Snapshot ¶
type Snapshot struct {
ID string `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
Type string `json:"type"`
Metadata Metadata `json:"metadata"`
Headers map[string]string `json:"headers"`
Values any `json:"values"`
}
func (*Snapshot) AsStatement ¶
func (s *Snapshot) AsStatement() attestation.Statement
AsStatement converts the snapshot to an intoto attestation
func (*Snapshot) GetSource ¶ added in v0.1.1
func (s *Snapshot) GetSource() attestation.Subject
func (*Snapshot) GetType ¶
func (s *Snapshot) GetType() attestation.PredicateType
func (*Snapshot) GetVerifications ¶ added in v0.1.1
func (s *Snapshot) GetVerifications() []*attestation.SignatureVerification
func (*Snapshot) SetSource ¶ added in v0.1.1
func (s *Snapshot) SetSource(attestation.Subject)
func (*Snapshot) SetType ¶
func (s *Snapshot) SetType(t attestation.PredicateType) error
type Spec ¶
type Spec struct {
// ID is the string that will be used to generate the subject's
// hash when generating an attestation. It should identify the
// object described by the data returned by the API call. This
// ID MUST be unique for each instance the API returns.
ID string `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
Type string `json:"type"`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
PayloadType string `json:"payload" yaml:"payload"` //nolint:tagalign
Mask []string `json:"mask"`
Data string `json:"data"`
TrimNL bool `json:"trimNL" yaml:"trimNL"`
}
type SpecParser ¶
type SpecParser struct{}
func (*SpecParser) ParseWithOptions ¶
func (sp *SpecParser) ParseWithOptions(r io.Reader, opts *ParseOptions) (*Spec, error)
ParseWithOptions parses a spec yaml definition.
Click to show internal directories.
Click to hide internal directories.