Help us shape the future of Go! Take the 2026 Go Developer Survey

policy

package
v0.4.22 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const ContractVersion = "v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision string
const (
	Allow Decision = "allow"
	Warn  Decision = "warn"
	Deny  Decision = "deny"
)

func Aggregate

func Aggregate(findings []Finding) Decision

type Finding

type Finding struct {
	Code     string   `json:"code"`
	Decision Decision `json:"decision"`
	Scope    string   `json:"scope"`
	Subject  string   `json:"subject,omitempty"`
	Field    string   `json:"field,omitempty"`
	Value    string   `json:"value,omitempty"`
	Message  string   `json:"message"`
	Source   Source   `json:"source"`
}

type Result

type Result struct {
	ContractVersion string    `json:"contract_version"`
	Environment     string    `json:"environment"`
	Profile         string    `json:"profile"`
	Decision        Decision  `json:"decision"`
	Findings        []Finding `json:"findings"`
	Rules           []Rule    `json:"rules,omitempty"`
	Overrides       []string  `json:"overrides,omitempty"`
}

func (Result) Denied

func (r Result) Denied() bool

type Rule

type Rule struct {
	Code        string   `json:"code"`
	Decision    Decision `json:"decision"`
	Overridable bool     `json:"overridable"`
	Description string   `json:"description"`
}

type Source

type Source string
const (
	SourceDefault          Source = "baseharbor_default"
	SourceOperatorOverride Source = "operator_override"
	SourceWorkload         Source = "workload_security"
)

Jump to

Keyboard shortcuts

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