pub struct RevocationsList {
pub version: u32,
pub this_update: DateTime<Utc>,
pub next_update: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub crl_number: u64,
pub revoked: Vec<RevokedEntry>,
}Expand description
The signed revocations list fetched from https://mur.run/revocations.json.
Modeled on TUF’s timestamp.json role. Outer DSSE envelope is stripped
during fetch; this struct represents the payload.
Fields§
§version: u32§this_update: DateTime<Utc>§next_update: DateTime<Utc>§expires_at: DateTime<Utc>After this timestamp Hub refuses to operate until the list is refreshed.
crl_number: u64Monotonically increasing counter. Hub rejects any list whose
crl_number is ≤ the last accepted value (rollback / clock-rollback
defence per spec §7.4.1).
revoked: Vec<RevokedEntry>Implementations§
Source§impl RevocationsList
impl RevocationsList
Sourcepub fn parse_and_validate(
bytes: &[u8],
known_crl: Option<u64>,
) -> Result<Self, MuragentError>
pub fn parse_and_validate( bytes: &[u8], known_crl: Option<u64>, ) -> Result<Self, MuragentError>
Parse from raw JSON bytes and validate monotonicity + expiry.
known_crl is the crl_number from the last accepted list (or None
on first fetch — in which case any validly-signed list is accepted).
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if the list’s expires_at is in the past.
Sourcepub fn is_package_revoked(&self, manifest_hash: &str) -> bool
pub fn is_package_revoked(&self, manifest_hash: &str) -> bool
Returns true if the given manifest hash appears in the revoked list.
manifest_hash should be the sha256:<hex> string from the manifest.
Returns true if the given author pubkey is revoked.
pubkey should be the ed25519:<base64> string from the manifest.
Sourcepub fn load_cached(mur_home: &Path) -> Option<Self>
pub fn load_cached(mur_home: &Path) -> Option<Self>
Load the locally-cached revocations list from <mur_home>/trust/revocations.json.
Returns None if no cache file exists or if the file cannot be parsed.
Callers that only need the cached crl_number should unwrap and read
list.crl_number.
Sourcepub fn save_cached(&self, mur_home: &Path) -> Result<(), MuragentError>
pub fn save_cached(&self, mur_home: &Path) -> Result<(), MuragentError>
Atomically write the revocations list to the local cache.
Uses temp-file + rename for crash-safety (same pattern as TrustStore).
Trait Implementations§
Source§impl Clone for RevocationsList
impl Clone for RevocationsList
Source§fn clone(&self) -> RevocationsList
fn clone(&self) -> RevocationsList
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more