evidencepolicy

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceTypeProviderExport    = "provider_export"
	SourceTypeGitHubTeamExport  = "github_team_export"
	SourceTypeBackstageExport   = "backstage_export"
	SourceTypeTicketExport      = "ticket_export"
	SourceTypeSignedDeclaration = "signed_declaration"
	SourceTypeCustomerOwnerMap  = "customer_owner_map"
	SourceTypeRepoPolicy        = "repo_policy"
	SourceTypePolicyConfig      = "policy_config"
	SourceTypeCodeowners        = "codeowners"
	SourceTypeCustomOwnerMap    = "custom_owner_mapping"
	SourceTypeServiceCatalog    = "service_catalog"
	SourceTypeBackstageCatalog  = "backstage_catalog"
	SourceTypeAppCatalog        = "app_catalog"
	SourceTypeGitHubMetadata    = "github_metadata"
	SourceTypeRepoFallback      = "repo_fallback"
	SourceTypeRuntime           = "runtime"
	SourceTypeUnknown           = "unknown"

	FreshnessStateFresh   = "fresh"
	FreshnessStateStale   = "stale"
	FreshnessStateExpired = "expired"
	FreshnessStateUnknown = "unknown"

	ConflictStateResolved  = "resolved"
	ConflictStateAmbiguous = "ambiguous"

	FieldOwner      = "owner"
	FieldApproval   = "approval"
	FieldConstraint = "constraint"
	FieldTarget     = "target_class"
	FieldPolicy     = "policy"
)

Variables

This section is empty.

Functions

func EvaluateFreshness

func EvaluateFreshness(generatedAt time.Time, observedAt, validUntil, maxAge, status string) (string, []string, error)

func NormalizeSourceType

func NormalizeSourceType(value string) string

func SourcePrecedenceKey

func SourcePrecedenceKey(sourceType string) string

func SourcePrecedenceRank

func SourcePrecedenceRank(sourceType string) int

Types

type Candidate

type Candidate struct {
	Field          string   `json:"field,omitempty"`
	Value          string   `json:"value,omitempty"`
	SourceType     string   `json:"source_type,omitempty"`
	Source         string   `json:"source,omitempty"`
	EvidenceRefs   []string `json:"evidence_refs,omitempty"`
	ObservedAt     string   `json:"observed_at,omitempty"`
	ValidUntil     string   `json:"valid_until,omitempty"`
	MaxAge         string   `json:"max_age,omitempty"`
	Issuer         string   `json:"issuer,omitempty"`
	Confidence     string   `json:"confidence,omitempty"`
	FreshnessState string   `json:"freshness_state,omitempty"`
	Status         string   `json:"status,omitempty"`
	ReasonCodes    []string `json:"reason_codes,omitempty"`
}

type Contradiction

type Contradiction struct {
	Class             string   `json:"class"`
	ReasonCodes       []string `json:"reason_codes,omitempty"`
	EvidenceRefs      []string `json:"evidence_refs,omitempty"`
	ImpactedTarget    string   `json:"impacted_target_class,omitempty"`
	RecommendedAction string   `json:"recommended_action,omitempty"`
}

type Decision

type Decision struct {
	Field                  string      `json:"field"`
	SelectedValue          string      `json:"selected_value,omitempty"`
	SelectedSourceType     string      `json:"selected_source_type,omitempty"`
	SelectedSource         string      `json:"selected_source,omitempty"`
	SelectedEvidenceRefs   []string    `json:"selected_evidence_refs,omitempty"`
	SelectedObservedAt     string      `json:"selected_observed_at,omitempty"`
	SelectedValidUntil     string      `json:"selected_valid_until,omitempty"`
	SelectedMaxAge         string      `json:"selected_max_age,omitempty"`
	SelectedIssuer         string      `json:"selected_issuer,omitempty"`
	SelectedConfidence     string      `json:"selected_confidence,omitempty"`
	SelectedFreshnessState string      `json:"selected_freshness_state,omitempty"`
	SelectedStatus         string      `json:"selected_status,omitempty"`
	ConflictState          string      `json:"conflict_state,omitempty"`
	ReasonCodes            []string    `json:"reason_codes,omitempty"`
	ConflictReasonCodes    []string    `json:"conflict_reason_codes,omitempty"`
	RejectedCandidates     []Candidate `json:"rejected_candidates,omitempty"`
}

func ResolveDecision

func ResolveDecision(candidates []Candidate, generatedAt time.Time) Decision

Jump to

Keyboard shortcuts

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