pub enum TrustRootStalenessError {
MalformedEmbeddedSnapshotDate {
observed: String,
reason: String,
},
EmbeddedSnapshotMidnightConstruction,
CacheMetadata {
path: PathBuf,
source: Error,
},
CacheMtime {
path: PathBuf,
source: Error,
},
CacheFutureDated {
anchor: String,
anchor_ts: DateTime<Utc>,
now: DateTime<Utc>,
tolerance_seconds: u64,
},
}Expand description
Errors produced while resolving a TrustRootStalenessAnchor.
These surface to the CLI when the caller’s selected anchor source
is structurally unavailable (e.g. unreadable cache file). They are
not the “trust root is stale” branch — that is the Ok(true)
return of TrustedRoot::is_stale_at.
Variants§
MalformedEmbeddedSnapshotDate
EMBEDDED_TRUSTED_ROOT_SNAPSHOT_DATE constant did not parse as
YYYY-MM-DD. Build-time bug — surfaces to operators only when
a fresh build is mis-tagged.
Fields
EmbeddedSnapshotMidnightConstruction
NaiveDate::and_hms_opt(0,0,0) failed; not actually reachable
for any well-formed date but retained so the anchor resolver
can fail closed rather than panic.
CacheMetadata
std::fs::metadata on the cache file failed (file missing,
unreadable permissions, etc.).
CacheMtime
File metadata was read but modified() was unsupported / failed.
CacheFutureDated
The resolved freshness anchor is dated more than the operator tolerance ahead of wall-clock.
Prior F3 closure: a future-dated cache mtime (e.g. set via
touch -d 2099-01-01) used to silently pass the freshness gate
because the now - mtime > max_age comparison goes false for a
negative duration. The check is now fail-closed: any anchor more
than TRUSTED_ROOT_CACHE_FUTURE_MTIME_TOLERANCE in the future
surfaces this error and the caller MUST refuse the operation with
STABLE_INVARIANT_TRUSTED_ROOT_CACHE_FUTURE_DATED.
Fields
anchor: StringDiagnostic label naming the anchor source (embedded_snapshot_date=…
or cache_file_mtime path=…).
tolerance_seconds: u64Tolerance window expressed in seconds (matches
TRUSTED_ROOT_CACHE_FUTURE_MTIME_TOLERANCE).
Trait Implementations§
Source§impl Debug for TrustRootStalenessError
impl Debug for TrustRootStalenessError
Source§impl Display for TrustRootStalenessError
impl Display for TrustRootStalenessError
Source§impl Error for TrustRootStalenessError
impl Error for TrustRootStalenessError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()