predicate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const PolicyPredicateType attestation.PredicateType = "https://carabiner.dev/ampel/policy/v0"
View Source
const PolicySetPredicateType attestation.PredicateType = "https://carabiner.dev/ampel/policyset/v0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Parsed *v1.Policy
	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 (*Policy) GetData

func (p *Policy) GetData() []byte

GetData returns the policy data serialized as JSON.

func (*Policy) GetOrigin

func (p *Policy) GetOrigin() attestation.Subject

GetOrigin returns the coordinates where the predicate data originated when the policy is wrapped in an attestation. At some point this should return the original repo where the policy was read from.

func (*Policy) GetParsed

func (p *Policy) GetParsed() any

GetParsed returns the Go policy object.

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) SetOrigin

func (p *Policy) SetOrigin(origin attestation.Subject)

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 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) GetData

func (set *PolicySet) GetData() []byte

GetData returns the PolicySet data serialized as JSON.

func (*PolicySet) GetOrigin

func (set *PolicySet) GetOrigin() attestation.Subject

GetOrigin returns the coordinates where the predicate data originated when the policyset is wrapped in an attestation. At some point this should return the original repo where the policy was read from.

func (*PolicySet) GetParsed

func (set *PolicySet) GetParsed() any

GetParsed returns the Go PolicySet object.

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) SetOrigin

func (set *PolicySet) SetOrigin(origin attestation.Subject)

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.

Jump to

Keyboard shortcuts

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