Documentation
¶
Index ¶
- type DiffKind
- type EquivalenceChecker
- func (ec *EquivalenceChecker) AreEquivalent(spec1, spec2 ecc.EnterpriseContractPolicySpec) (bool, error)
- func (ec *EquivalenceChecker) AreEquivalentWithDifferences(spec1, spec2 ecc.EnterpriseContractPolicySpec) (bool, []PolicyDifference, error)
- func (ec *EquivalenceChecker) GenerateUnifiedDiffOutput(differences []PolicyDifference) string
- func (ec *EquivalenceChecker) GenerateUnifiedDiffOutputWithLabels(differences []PolicyDifference, fromLabel, toLabel string) string
- func (ec *EquivalenceChecker) NormalizePolicy(spec ecc.EnterpriseContractPolicySpec) (*NormalizedPolicy, error)
- type FieldPath
- type ImageInfo
- type NormalizedPolicy
- type PolicyBucket
- type PolicyDifference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EquivalenceChecker ¶
type EquivalenceChecker struct {
// contains filtered or unexported fields
}
EquivalenceChecker determines whether two EnterpriseContractPolicy specs produce the same evaluation result for a given image at a specific time.
func NewEquivalenceChecker ¶
func NewEquivalenceChecker(effectiveTime time.Time, imageInfo *ImageInfo) *EquivalenceChecker
func (*EquivalenceChecker) AreEquivalent ¶
func (ec *EquivalenceChecker) AreEquivalent(spec1, spec2 ecc.EnterpriseContractPolicySpec) (bool, error)
AreEquivalent checks equivalence only
func (*EquivalenceChecker) AreEquivalentWithDifferences ¶ added in v0.8.39
func (ec *EquivalenceChecker) AreEquivalentWithDifferences(spec1, spec2 ecc.EnterpriseContractPolicySpec) (bool, []PolicyDifference, error)
AreEquivalentWithDifferences returns equivalence and structured diffs
func (*EquivalenceChecker) GenerateUnifiedDiffOutput ¶ added in v0.8.39
func (ec *EquivalenceChecker) GenerateUnifiedDiffOutput(differences []PolicyDifference) string
func (*EquivalenceChecker) GenerateUnifiedDiffOutputWithLabels ¶ added in v0.8.39
func (ec *EquivalenceChecker) GenerateUnifiedDiffOutputWithLabels(differences []PolicyDifference, fromLabel, toLabel string) string
func (*EquivalenceChecker) NormalizePolicy ¶ added in v0.8.39
func (ec *EquivalenceChecker) NormalizePolicy(spec ecc.EnterpriseContractPolicySpec) (*NormalizedPolicy, error)
NormalizePolicy exposes normalization publicly
type FieldPath ¶ added in v0.8.39
type FieldPath []string
FieldPath represents a structured path to a field (e.g. ["ruleData","paths","/foo/bar"])
type NormalizedPolicy ¶
type NormalizedPolicy struct {
Buckets []PolicyBucket
}
NormalizedPolicy is a normalized view of a policy spec
type PolicyBucket ¶
type PolicyBucket struct {
PolicyURIs []string
DataURIs []string
RuleData map[string]interface{}
Include []string
Exclude []string
// Optional labels (collected names from sources) for nicer headers (if desired later)
Names []string
}
PolicyBucket represents one normalized policy "source entry"
type PolicyDifference ¶ added in v0.8.39
type PolicyDifference struct {
BucketKey string
Field string // kept for compatibility and sorting
Path FieldPath // future-proof path support
Kind DiffKind
VSAValue any
SuppliedValue any
Summary string
}
PolicyDifference represents a structured difference between two policies
func (PolicyDifference) IsAdded ¶ added in v0.8.39
func (pd PolicyDifference) IsAdded() bool
func (PolicyDifference) IsChanged ¶ added in v0.8.39
func (pd PolicyDifference) IsChanged() bool
func (PolicyDifference) IsRemoved ¶ added in v0.8.39
func (pd PolicyDifference) IsRemoved() bool
Click to show internal directories.
Click to hide internal directories.