policy

package
v0.0.1-alpha6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PolicyPredicate = "https://witness.testifysec.com/policy/v0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	Type     string   `json:"type"`
	Policies []string `json:"policies"`
}

type CertConstraint

type CertConstraint struct {
	Roots []string `json:"roots"`
}

type ErrKeyIDMismatch

type ErrKeyIDMismatch struct {
	Expected string
	Actual   string
}

func (ErrKeyIDMismatch) Error

func (e ErrKeyIDMismatch) Error() string

type ErrMissingAttestation

type ErrMissingAttestation struct {
	Step        string
	Attestation string
}

func (ErrMissingAttestation) Error

func (e ErrMissingAttestation) Error() string

type ErrNoAttestations

type ErrNoAttestations string

func (ErrNoAttestations) Error

func (e ErrNoAttestations) Error() string

type ErrPolicyExpired

type ErrPolicyExpired time.Time

func (ErrPolicyExpired) Error

func (e ErrPolicyExpired) Error() string

type Functionary

type Functionary struct {
	Type           string         `json:"type"`
	CertConstraint CertConstraint `json:"certConstraint,omitempty"`
	PublicKeyID    string         `json:"publickeyid,omitempty"`
}

type Policy

type Policy struct {
	Expires    time.Time            `json:"expires"`
	Roots      map[string]Root      `json:"roots,omitempty"`
	PublicKeys map[string]PublicKey `json:"publickeys,omitempty"`
	Steps      map[string]Step      `json:"steps"`
}

func (Policy) Verify

func (p Policy) Verify(signedCollections []io.Reader) error

type PublicKey

type PublicKey struct {
	KeyID string `json:"keyid"`
	Key   []byte `json:"key"`
}

type Root

type Root struct {
	Certificate   []byte   `json:"certificate"`
	Intermediates [][]byte `json:"intermediates,omitempty"`
}

type Step

type Step struct {
	Name          string        `json:"name"`
	Functionaries []Functionary `json:"functionaries"`
	Attestations  []Attestation `json:"attestations"`
}

func (Step) Verify

func (s Step) Verify(attestCollections []attestation.Collection) error

Jump to

Keyboard shortcuts

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