Documentation
¶
Index ¶
- Variables
- type Attestation
- func (att *Attestation) AddSubjects(subs []*intoto.ResourceDescriptor) error
- func (att *Attestation) GetPredicate() cattestation.Predicate
- func (att *Attestation) GetPredicateType() cattestation.PredicateType
- func (att *Attestation) GetSubjects() []cattestation.Subject
- func (att *Attestation) GetType() string
- func (att *Attestation) GetVerification() cattestation.Verification
- func (att *Attestation) MarshalJSON() ([]byte, error)
- func (att *Attestation) ToJSON(w io.Writer) error
- type Predicate
- func (p *Predicate) GetData() []byte
- func (p *Predicate) GetOrigin() cattestation.Subject
- func (p *Predicate) GetParsed() any
- func (p *Predicate) GetType() cattestation.PredicateType
- func (p *Predicate) GetVerification() cattestation.Verification
- func (p *Predicate) SetOrigin(org cattestation.Subject)
- func (p *Predicate) SetType(t cattestation.PredicateType) error
- func (p *Predicate) SetVerification(v cattestation.Verification)
Constants ¶
This section is empty.
Variables ¶
View Source
var PredicateType cattestation.PredicateType = "https://openvex.dev/ns/v0.2.0"
Functions ¶
This section is empty.
Types ¶
type Attestation ¶
type Attestation struct {
// Note that here, we are embedding the *intoto* Statement. Not to be
// confused with the VEX Statement struct.
//
// Essentially our attestation is an extension of the intoto statement
// with our custom predicate.
*intoto.Statement
// Predicate contains type specific metadata.
Predicate *Predicate `json:"predicate"`
}
func New ¶
func New() *Attestation
func (*Attestation) AddSubjects ¶
func (att *Attestation) AddSubjects(subs []*intoto.ResourceDescriptor) error
AddSubjects adds a list of intoto subjects to the attestation
func (*Attestation) GetPredicate ¶ added in v0.2.8
func (att *Attestation) GetPredicate() cattestation.Predicate
func (*Attestation) GetPredicateType ¶ added in v0.2.8
func (att *Attestation) GetPredicateType() cattestation.PredicateType
func (*Attestation) GetSubjects ¶ added in v0.2.8
func (att *Attestation) GetSubjects() []cattestation.Subject
func (*Attestation) GetType ¶ added in v0.2.8
func (att *Attestation) GetType() string
func (*Attestation) GetVerification ¶ added in v0.2.8
func (att *Attestation) GetVerification() cattestation.Verification
func (*Attestation) MarshalJSON ¶ added in v0.2.8
func (att *Attestation) MarshalJSON() ([]byte, error)
MarshalJSON implements custom JSON marshaling for Attestation. It uses protojson to marshal the embedded in-toto Statement (which produces the correct field names like "_type" and "predicateType"), then replaces the predicate field with the output of the Predicate's own serialization.
type Predicate ¶ added in v0.2.8
func NewPredicate ¶ added in v0.2.8
func (*Predicate) GetOrigin ¶ added in v0.2.8
func (p *Predicate) GetOrigin() cattestation.Subject
func (*Predicate) GetType ¶ added in v0.2.8
func (p *Predicate) GetType() cattestation.PredicateType
func (*Predicate) GetVerification ¶ added in v0.2.8
func (p *Predicate) GetVerification() cattestation.Verification
func (*Predicate) SetOrigin ¶ added in v0.2.8
func (p *Predicate) SetOrigin(org cattestation.Subject)
func (*Predicate) SetType ¶ added in v0.2.8
func (p *Predicate) SetType(t cattestation.PredicateType) error
func (*Predicate) SetVerification ¶ added in v0.2.8
func (p *Predicate) SetVerification(v cattestation.Verification)
Click to show internal directories.
Click to hide internal directories.