Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupStaged ¶
CleanupStaged removes a staged artifact path after failed upgrade/rollback.
Types ¶
type BindingStrategy ¶
type BindingStrategy string
BindingStrategy identifies how verified bytes will be preserved for later launch.
const ( // BindingDescriptor holds an opened file descriptor (Linux-oriented). BindingDescriptor BindingStrategy = "descriptor" // BindingProtectedStaging copies into a private digest-addressed store. BindingProtectedStaging BindingStrategy = "protected_staging" // BindingUnsupported means the host cannot preserve verified identity. BindingUnsupported BindingStrategy = "unsupported" )
type LaunchSource ¶
type LaunchSource = VerifiedArtifact
LaunchSource is an alias documenting Phase 3 consumption of VerifiedArtifact.
type Reason ¶
type Reason string
Reason is a bounded stable trust failure/success code (no paths/secrets).
These constants are outcome codes, not sentinel errors: ReasonOK is a success code, so the Err prefix convention for error sentinels does not apply. The names follow the enum convention (type name prefix + value). Error() is implemented so reasons can be wrapped and matched with errors.Is.
const ( ReasonOK Reason = "ok" ReasonPathEscape Reason = "path_escape" ReasonNotRegular Reason = "not_regular_file" ReasonNotExecutableType Reason = "not_native_executable" ReasonUnsupportedPlatform Reason = "unsupported_platform" ReasonDigestMismatch Reason = "digest_mismatch" ReasonSubstitution Reason = "substitution_detected" ReasonStagingUnsupported Reason = "staging_unsupported" ReasonStagingFailed Reason = "staging_failed" ReasonRootRequired Reason = "trusted_root_required" ReasonSymlinkEscape Reason = "symlink_escape" ReasonOpenFailed Reason = "open_failed" ReasonACLUnverified Reason = "acl_unverified" )
type VerifiedArtifact ¶
type VerifiedArtifact struct {
Manifest sdkmanifest.Manifest
DigestHex string
Strategy BindingStrategy
StagedPath string // set for protected staging; empty for descriptor binding
// contains filtered or unexported fields
}
VerifiedArtifact is the digest-bound launch preparation result. It never starts a process; Phase 3 consumes it for exact launch.
func (*VerifiedArtifact) Close ¶
func (v *VerifiedArtifact) Close() error
Close releases held resources (descriptor or staged file handle).
func (*VerifiedArtifact) OpenFile ¶
func (v *VerifiedArtifact) OpenFile() *os.File
OpenFile returns the held descriptor when Strategy is BindingDescriptor.
type VerifyOptions ¶
VerifyOptions controls digest-bound preparation.
type VerifyResult ¶
type VerifyResult struct {
Artifact *VerifiedArtifact
Reason Reason
Err error
}
VerifyResult is either a VerifiedArtifact or a bounded reason.
func Verify ¶
func Verify(root string, m sdkmanifest.Manifest, opt VerifyOptions) VerifyResult
Verify opens the executable under trusted root with no-follow semantics, verifies type/platform/digest from the held handle, and binds for later launch. It never falls back to a raw path when canonicalization fails and never reopens by path after the initial no-follow open for digest verification.