Documentation
¶
Overview ¶
Package verify provides snapshot integrity verification.
Index ¶
Constants ¶
View Source
const ( ErrorCodeLineageParentMissing = "E_LINEAGE_PARENT_MISSING" ErrorCodeLineageParentInvalid = "E_LINEAGE_PARENT_INVALID" ErrorCodeLineageCycle = "E_LINEAGE_CYCLE" )
View Source
const ( ErrorCodeSnapshotIDInvalid = snapshot.PublishStateCodeSnapshotIDInvalid ErrorCodeDescriptorMissing = snapshot.PublishStateCodeDescriptorMissing ErrorCodeDescriptorCorrupt = snapshot.PublishStateCodeDescriptorCorrupt ErrorCodeDescriptorChecksumMismatch = snapshot.PublishStateCodeDescriptorChecksumMismatch ErrorCodePayloadMissing = snapshot.PublishStateCodePayloadMissing ErrorCodePayloadInvalid = snapshot.PublishStateCodePayloadInvalid ErrorCodePayloadHashMismatch = snapshot.PublishStateCodePayloadHashMismatch ErrorCodeReadyMissing = snapshot.PublishStateCodeReadyMissing ErrorCodeReadyInvalid = snapshot.PublishStateCodeReadyInvalid ErrorCodeReadyDescriptorMissing = snapshot.PublishStateCodeReadyDescriptorMissing )
Variables ¶
This section is empty.
Functions ¶
func IsAncestor ¶
func IsAncestor(repoRoot string, ancestorID, descendantID model.SnapshotID) (bool, error)
IsAncestor reports whether ancestorID is reachable from descendantID by following parent links. It returns a LineageIssue when traversal encounters missing parents, invalid parent IDs, or cycles.
Types ¶
type LineageIssue ¶
type LineageIssue struct {
Code string
SnapshotID model.SnapshotID
ParentID model.SnapshotID
Message string
}
LineageIssue describes a machine-readable lineage problem.
func CheckLineage ¶
func CheckLineage(repoRoot string, snapshotID model.SnapshotID) *LineageIssue
CheckLineage validates parent links reachable from snapshotID.
func (*LineageIssue) Error ¶
func (i *LineageIssue) Error() string
type Result ¶
type Result struct {
SnapshotID model.SnapshotID `json:"snapshot_id"`
ChecksumValid bool `json:"checksum_valid"`
PayloadHashValid bool `json:"payload_hash_valid"`
TamperDetected bool `json:"tamper_detected"`
Severity string `json:"severity,omitempty"`
Error string `json:"error,omitempty"`
ErrorCode string `json:"error_code,omitempty"`
}
Result contains verification results for a single snapshot.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier performs integrity verification on snapshots.
func (*Verifier) VerifySnapshot ¶
func (v *Verifier) VerifySnapshot(snapshotID model.SnapshotID, verifyPayloadHash bool) (*Result, error)
VerifySnapshot verifies a single snapshot's integrity.
Click to show internal directories.
Click to hide internal directories.