mapping

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MatchTypePolicy        matchType = "policy"
	MatchTypeMatchNoPolicy matchType = "match_no_policy"
	MatchTypeNoMatch       matchType = "no_match"
)
View Source
const (
	MappingFilename = "mapping.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttestationConfig

type AttestationConfig struct {
	Style AttestationStyle `json:"style"`
	Repo  string           `json:"repo"`
}

type AttestationStyle

type AttestationStyle string
const (
	AttestationStyleAttached  AttestationStyle = "attached"
	AttestationStyleReferrers AttestationStyle = "referrers"
)

type PolicyMapping

type PolicyMapping struct {
	ID           string              `json:"id"`
	Description  string              `json:"description"`
	Files        []PolicyMappingFile `json:"files"`
	Attestations *AttestationConfig  `json:"attestations"`
}

type PolicyMappingFile

type PolicyMappingFile struct {
	Path string `json:"path"`
}

type PolicyMappings

type PolicyMappings struct {
	Version  string
	Kind     string
	Policies map[string]*PolicyMapping
	Rules    []*PolicyRule
}

func LoadLocalMappings

func LoadLocalMappings(configDir string) (*PolicyMappings, error)

func LoadTUFMappings

func LoadTUFMappings(tufClient tuf.Downloader, localTargetsDir string) (*PolicyMappings, error)

func (*PolicyMappings) FindPolicyMatch

func (mappings *PolicyMappings) FindPolicyMatch(imageName string, platform *v1.Platform) (*PolicyMatch, error)

type PolicyMatch

type PolicyMatch struct {
	MatchType   matchType
	Policy      *PolicyMapping
	Rule        *PolicyRule
	MatchedName string
}

type PolicyRule

type PolicyRule struct {
	Pattern     *regexp.Regexp
	PolicyID    string
	Replacement string
	Platforms   []*v1.Platform
}

Jump to

Keyboard shortcuts

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