Documentation
¶
Index ¶
- Constants
- Variables
- type Parser
- func (p *Parser) Parse(data []byte) (attestation.Predicate, error)
- func (p *Parser) ParsePolicyGroupPredicate(data []byte) (attestation.Predicate, error)
- func (p *Parser) ParsePolicyPredicate(data []byte) (attestation.Predicate, error)
- func (p *Parser) ParsePolicySetPredicate(data []byte) (attestation.Predicate, error)
- func (p *Parser) ParseResultGroupPredicate(data []byte) (attestation.Predicate, error)
- func (p *Parser) ParseResultPredicate(data []byte) (attestation.Predicate, error)
- func (p *Parser) ParseResultSetPredicate(data []byte) (attestation.Predicate, error)
- func (*Parser) SupportsType(predTypes ...attestation.PredicateType) bool
- type ParserPolicyGroupPredicate
- type ParserPolicyPredicate
- type ParserPolicySetPredicate
- type ParserResultGroupPredicate
- type ParserResultPredicate
- type ParserResultSetPredicate
- type Policy
- func (p *Policy) GetData() []byte
- func (p *Policy) GetOrigin() attestation.Subject
- func (p *Policy) GetParsed() any
- func (p *Policy) GetType() attestation.PredicateType
- func (p *Policy) GetVerification() attestation.Verification
- func (p *Policy) MarshalJSON() ([]byte, error)
- func (p *Policy) SetOrigin(origin attestation.Subject)
- func (p *Policy) SetType(attestation.PredicateType) error
- func (p *Policy) SetVerification(verification attestation.Verification)
- type PolicyGroup
- func (grp *PolicyGroup) GetData() []byte
- func (grp *PolicyGroup) GetOrigin() attestation.Subject
- func (grp *PolicyGroup) GetParsed() any
- func (grp *PolicyGroup) GetType() attestation.PredicateType
- func (grp *PolicyGroup) GetVerification() attestation.Verification
- func (grp *PolicyGroup) MarshalJSON() ([]byte, error)
- func (grp *PolicyGroup) SetOrigin(origin attestation.Subject)
- func (grp *PolicyGroup) SetType(attestation.PredicateType) error
- func (grp *PolicyGroup) SetVerification(verification attestation.Verification)
- type PolicySet
- func (set *PolicySet) GetData() []byte
- func (set *PolicySet) GetOrigin() attestation.Subject
- func (set *PolicySet) GetParsed() any
- func (set *PolicySet) GetType() attestation.PredicateType
- func (set *PolicySet) GetVerification() attestation.Verification
- func (set *PolicySet) MarshalJSON() ([]byte, error)
- func (set *PolicySet) SetOrigin(origin attestation.Subject)
- func (set *PolicySet) SetType(attestation.PredicateType) error
- func (set *PolicySet) SetVerification(verification attestation.Verification)
- type Result
- func (r *Result) GetData() []byte
- func (r *Result) GetOrigin() attestation.Subject
- func (r *Result) GetParsed() any
- func (r *Result) GetType() attestation.PredicateType
- func (r *Result) GetVerification() attestation.Verification
- func (r *Result) MarshalJSON() ([]byte, error)
- func (r *Result) SetOrigin(origin attestation.Subject)
- func (r *Result) SetType(attestation.PredicateType) error
- func (r *Result) SetVerification(verification attestation.Verification)
- type ResultGroup
- func (r *ResultGroup) GetData() []byte
- func (r *ResultGroup) GetOrigin() attestation.Subject
- func (r *ResultGroup) GetParsed() any
- func (r *ResultGroup) GetType() attestation.PredicateType
- func (r *ResultGroup) GetVerification() attestation.Verification
- func (r *ResultGroup) MarshalJSON() ([]byte, error)
- func (r *ResultGroup) SetOrigin(origin attestation.Subject)
- func (r *ResultGroup) SetType(attestation.PredicateType) error
- func (r *ResultGroup) SetVerification(verification attestation.Verification)
- type ResultSet
- func (r *ResultSet) GetData() []byte
- func (r *ResultSet) GetOrigin() attestation.Subject
- func (r *ResultSet) GetParsed() any
- func (r *ResultSet) GetType() attestation.PredicateType
- func (r *ResultSet) GetVerification() attestation.Verification
- func (r *ResultSet) MarshalJSON() ([]byte, error)
- func (r *ResultSet) SetOrigin(origin attestation.Subject)
- func (r *ResultSet) SetType(attestation.PredicateType) error
- func (r *ResultSet) SetVerification(verification attestation.Verification)
Constants ¶
const ( PredicateTypePolicy attestation.PredicateType = "https://carabiner.dev/ampel/policy/v0" PredicateTypePolicy0 attestation.PredicateType = "https://carabiner.dev/ampel/policy/v0.0.1" )
const ( PredicateTypePolicySet attestation.PredicateType = "https://carabiner.dev/ampel/policyset/v0" PredicateTypePolicySet0 attestation.PredicateType = "https://carabiner.dev/ampel/policyset/v0.0.1" )
const ( PredicateTypeResult attestation.PredicateType = "https://carabiner.dev/ampel/result/v0" PredicateTypeResult0 attestation.PredicateType = "https://carabiner.dev/ampel/results/v0.0.1" )
const PredicateTypePolicyGroup attestation.PredicateType = "https://carabiner.dev/ampel/policygroup/v0"
const PredicateTypeResultGroup attestation.PredicateType = "https://carabiner.dev/ampel/resultgroup/v0"
const PredicateTypeResultSet attestation.PredicateType = "https://carabiner.dev/ampel/resultset/v0"
Variables ¶
var PredicateTypes = []attestation.PredicateType{ PredicateTypePolicy, PredicateTypePolicySet, PredicateTypePolicyGroup, PredicateTypeResult, PredicateTypeResultSet, PredicateTypeResultGroup, PredicateTypePolicy0, PredicateTypePolicySet0, PredicateTypeResult0, }
PredicateTypes is a slice of all the predicate types
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct{}
func (*Parser) Parse ¶
func (p *Parser) Parse(data []byte) (attestation.Predicate, error)
Parse takes JSON data and returns any of the supported predicates if it parses
func (*Parser) ParsePolicyGroupPredicate ¶
func (p *Parser) ParsePolicyGroupPredicate(data []byte) (attestation.Predicate, error)
func (*Parser) ParsePolicyPredicate ¶
func (p *Parser) ParsePolicyPredicate(data []byte) (attestation.Predicate, error)
func (*Parser) ParsePolicySetPredicate ¶
func (p *Parser) ParsePolicySetPredicate(data []byte) (attestation.Predicate, error)
func (*Parser) ParseResultGroupPredicate ¶
func (p *Parser) ParseResultGroupPredicate(data []byte) (attestation.Predicate, error)
func (*Parser) ParseResultPredicate ¶
func (p *Parser) ParseResultPredicate(data []byte) (attestation.Predicate, error)
func (*Parser) ParseResultSetPredicate ¶
func (p *Parser) ParseResultSetPredicate(data []byte) (attestation.Predicate, error)
func (*Parser) SupportsType ¶
func (*Parser) SupportsType(predTypes ...attestation.PredicateType) bool
type ParserPolicyGroupPredicate ¶
type ParserPolicyGroupPredicate struct{}
func NewParserPolicyGroupPredicate ¶
func NewParserPolicyGroupPredicate() *ParserPolicyGroupPredicate
func (*ParserPolicyGroupPredicate) Parse ¶
func (p *ParserPolicyGroupPredicate) Parse(data []byte) (attestation.Predicate, error)
func (*ParserPolicyGroupPredicate) SupportsType ¶
func (p *ParserPolicyGroupPredicate) SupportsType(predTypes ...attestation.PredicateType) bool
type ParserPolicyPredicate ¶
type ParserPolicyPredicate struct{}
func NewParserPolicyPredicate ¶
func NewParserPolicyPredicate() *ParserPolicyPredicate
func (*ParserPolicyPredicate) Parse ¶
func (p *ParserPolicyPredicate) Parse(data []byte) (attestation.Predicate, error)
func (*ParserPolicyPredicate) SupportsType ¶
func (p *ParserPolicyPredicate) SupportsType(predTypes ...attestation.PredicateType) bool
type ParserPolicySetPredicate ¶
type ParserPolicySetPredicate struct{}
func NewParserPolicySetPredicate ¶
func NewParserPolicySetPredicate() *ParserPolicySetPredicate
func (*ParserPolicySetPredicate) Parse ¶
func (p *ParserPolicySetPredicate) Parse(data []byte) (attestation.Predicate, error)
func (*ParserPolicySetPredicate) SupportsType ¶
func (p *ParserPolicySetPredicate) SupportsType(predTypes ...attestation.PredicateType) bool
type ParserResultGroupPredicate ¶
type ParserResultGroupPredicate struct{}
func NewParserResultGroupPredicate ¶
func NewParserResultGroupPredicate() *ParserResultGroupPredicate
func (*ParserResultGroupPredicate) Parse ¶
func (p *ParserResultGroupPredicate) Parse(data []byte) (attestation.Predicate, error)
func (*ParserResultGroupPredicate) SupportsType ¶
func (p *ParserResultGroupPredicate) SupportsType(predTypes ...attestation.PredicateType) bool
type ParserResultPredicate ¶
type ParserResultPredicate struct{}
func NewParserResultPredicate ¶
func NewParserResultPredicate() *ParserResultPredicate
func (*ParserResultPredicate) Parse ¶
func (p *ParserResultPredicate) Parse(data []byte) (attestation.Predicate, error)
func (*ParserResultPredicate) SupportsType ¶
func (p *ParserResultPredicate) SupportsType(predTypes ...attestation.PredicateType) bool
type ParserResultSetPredicate ¶
type ParserResultSetPredicate struct{}
func NewParserResultSetPredicate ¶
func NewParserResultSetPredicate() *ParserResultSetPredicate
func (*ParserResultSetPredicate) Parse ¶
func (p *ParserResultSetPredicate) Parse(data []byte) (attestation.Predicate, error)
func (*ParserResultSetPredicate) SupportsType ¶
func (p *ParserResultSetPredicate) SupportsType(predTypes ...attestation.PredicateType) bool
type Policy ¶
Policy (or rather predicate.Policy) is a wrapper around the policy proto message that implements the ampel attestation predicate interface.
func (*Policy) GetOrigin ¶
func (p *Policy) GetOrigin() attestation.Subject
GetOrigin calls the underlying method of the same name
func (*Policy) GetType ¶
func (p *Policy) GetType() attestation.PredicateType
func (*Policy) GetVerification ¶
func (p *Policy) GetVerification() attestation.Verification
GetVerification returns the signature verification generated from the envelope parser. The verification may contain details about the integrity, identity and signature guarding the PolicySet.
func (*Policy) MarshalJSON ¶
MarshalJSON implements the JSON marshaler interface. It reuses any pre parsed data already stored in the predicate.
func (*Policy) SetOrigin ¶
func (p *Policy) SetOrigin(origin attestation.Subject)
SetOrigin calls the underlting method of the same name
func (*Policy) SetType ¶
func (p *Policy) SetType(attestation.PredicateType) error
func (*Policy) SetVerification ¶
func (p *Policy) SetVerification(verification attestation.Verification)
SetVerification gets the signature verification data from the envelope parser before discarding the envelope. This is supposed the be stored for later retrieval.
type PolicyGroup ¶
type PolicyGroup struct {
Parsed *v1.PolicyGroup
Data []byte
// contains filtered or unexported fields
}
Policy (or rather predicate.Policy) is a wrapper around the policy proto message that implements the ampel attestation predicate interface.
func (*PolicyGroup) GetData ¶
func (grp *PolicyGroup) GetData() []byte
GetData returns the policy data serialized as JSON.
func (*PolicyGroup) GetOrigin ¶
func (grp *PolicyGroup) GetOrigin() attestation.Subject
GetOrigin calls the underlying method of the same name
func (*PolicyGroup) GetParsed ¶
func (grp *PolicyGroup) GetParsed() any
GetParsed returns the Go policy object.
func (*PolicyGroup) GetType ¶
func (grp *PolicyGroup) GetType() attestation.PredicateType
func (*PolicyGroup) GetVerification ¶
func (grp *PolicyGroup) GetVerification() attestation.Verification
GetVerification returns the signature verification generated from the envelope parser. The verification may contain details about the integrity, identity and signature guarding the PolicyGroup.
func (*PolicyGroup) MarshalJSON ¶
func (grp *PolicyGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the JSON marshaler interface. It reuses any pre parsed data already stored in the predicate.
func (*PolicyGroup) SetOrigin ¶
func (grp *PolicyGroup) SetOrigin(origin attestation.Subject)
SetOrigin calls the underlying method of the same name
func (*PolicyGroup) SetType ¶
func (grp *PolicyGroup) SetType(attestation.PredicateType) error
func (*PolicyGroup) SetVerification ¶
func (grp *PolicyGroup) SetVerification(verification attestation.Verification)
SetVerification gets the signature verification data from the envelope parser before discarding the envelope. This is supposed the be stored for later retrieval.
type PolicySet ¶
type PolicySet struct {
Parsed *v1.PolicySet
Data []byte
// contains filtered or unexported fields
}
PolicySet (predicate.Policy) is a wrapper around the policySet proto message that implements the ampel attestation predicate interface.
func (*PolicySet) GetOrigin ¶
func (set *PolicySet) GetOrigin() attestation.Subject
GetOrigin calls the underlying method of the same name
func (*PolicySet) GetType ¶
func (set *PolicySet) GetType() attestation.PredicateType
func (*PolicySet) GetVerification ¶
func (set *PolicySet) GetVerification() attestation.Verification
GetVerification returns the signature verification generated from the envelope parser. The verification may contain details about the integrity, identity and signature guarding the PolicySet.
func (*PolicySet) MarshalJSON ¶
MarshalJSON implements the JSON marshaler interface. It reuses any pre parsed data already stored in the predicate.
func (*PolicySet) SetOrigin ¶
func (set *PolicySet) SetOrigin(origin attestation.Subject)
SetOrigin calls the underlting method of the same name
func (*PolicySet) SetType ¶
func (set *PolicySet) SetType(attestation.PredicateType) error
func (*PolicySet) SetVerification ¶
func (set *PolicySet) SetVerification(verification attestation.Verification)
SetVerification gets the signature verification data from the envelope parser before discarding the envelope. This is supposed the be stored for later retrieval.
type Result ¶
Result (or rather predicates.Result) is a wrapper around the policy evaluation results proto message that ampel generates with --attest
func (*Result) GetOrigin ¶
func (r *Result) GetOrigin() attestation.Subject
GetOrigin calls the underlying method of the same name
func (*Result) GetType ¶
func (r *Result) GetType() attestation.PredicateType
func (*Result) GetVerification ¶
func (r *Result) GetVerification() attestation.Verification
GetVerification returns the signature verification generated from the envelope parser. The verification may contain details about the integrity, identity and signature guarding the PolicySet.
func (*Result) MarshalJSON ¶
MarshalJSON implements the JSON marshaler interface. It reuses any pre parsed data already stored in the predicate.
func (*Result) SetOrigin ¶
func (r *Result) SetOrigin(origin attestation.Subject)
SetOrigin calls the underlying method of the same name
func (*Result) SetType ¶
func (r *Result) SetType(attestation.PredicateType) error
func (*Result) SetVerification ¶
func (r *Result) SetVerification(verification attestation.Verification)
SetVerification gets the signature verification data from the envelope parser before discarding the envelope. This is supposed the be stored for later retrieval.
type ResultGroup ¶
type ResultGroup struct {
Parsed *v1.ResultGroup
Data []byte
// contains filtered or unexported fields
}
ResultGroup (or rather predicates.ResultSet) is a wrapper around the policyset evaluation results proto message that ampel generates with --attest
func (*ResultGroup) GetData ¶
func (r *ResultGroup) GetData() []byte
GetData returns the policy data serialized as JSON.
func (*ResultGroup) GetOrigin ¶
func (r *ResultGroup) GetOrigin() attestation.Subject
GetOrigin calls the underlying method of the same name
func (*ResultGroup) GetParsed ¶
func (r *ResultGroup) GetParsed() any
GetParsed returns the Go policy object.
func (*ResultGroup) GetType ¶
func (r *ResultGroup) GetType() attestation.PredicateType
func (*ResultGroup) GetVerification ¶
func (r *ResultGroup) GetVerification() attestation.Verification
GetVerification returns the signature verification generated from the envelope parser. The verification may contain details about the integrity, identity and signature guarding the PolicySet.
func (*ResultGroup) MarshalJSON ¶
func (r *ResultGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the JSON marshaler interface. It reuses any pre parsed data already stored in the predicate.
func (*ResultGroup) SetOrigin ¶
func (r *ResultGroup) SetOrigin(origin attestation.Subject)
SetOrigin calls the underlying method of the same name
func (*ResultGroup) SetType ¶
func (r *ResultGroup) SetType(attestation.PredicateType) error
func (*ResultGroup) SetVerification ¶
func (r *ResultGroup) SetVerification(verification attestation.Verification)
SetVerification gets the signature verification data from the envelope parser before discarding the envelope. This is supposed the be stored for later retrieval.
type ResultSet ¶
type ResultSet struct {
Parsed *v1.ResultSet
Data []byte
// contains filtered or unexported fields
}
Result (or rather predicates.ResultSet) is a wrapper around the policyset evaluation results proto message that ampel generates with --attest
func (*ResultSet) GetOrigin ¶
func (r *ResultSet) GetOrigin() attestation.Subject
GetOrigin calls the underlying method of the same name
func (*ResultSet) GetType ¶
func (r *ResultSet) GetType() attestation.PredicateType
func (*ResultSet) GetVerification ¶
func (r *ResultSet) GetVerification() attestation.Verification
GetVerification returns the signature verification generated from the envelope parser. The verification may contain details about the integrity, identity and signature guarding the PolicySet.
func (*ResultSet) MarshalJSON ¶
MarshalJSON implements the JSON marshaler interface. It reuses any pre parsed data already stored in the predicate.
func (*ResultSet) SetOrigin ¶
func (r *ResultSet) SetOrigin(origin attestation.Subject)
SetOrigin calls the underlying method of the same name
func (*ResultSet) SetType ¶
func (r *ResultSet) SetType(attestation.PredicateType) error
func (*ResultSet) SetVerification ¶
func (r *ResultSet) SetVerification(verification attestation.Verification)
SetVerification gets the signature verification data from the envelope parser before discarding the envelope. This is supposed the be stored for later retrieval.