pub struct LogSet { /* private fields */ }Expand description
The did:webvh logs one credential verification uses, as the caller fetched them: the issuer’s, and those of delegation grant issuers.
The core keeps no state and never fetches. The caller fetches each log
from log_url, gives the latest versionId it saw before for each DID
(LogSet::with_seen_version_id), and afterwards remembers the latest
versions the set reports (LogSet::outcomes), so a log later served
rolled back or forked is refused.
A log is verified the first time a verification needs it (credential verification always uses the latest entry), against one clock read when the set is made, and its latest state is then reused for the rest of that verification, as the reference keeps one document per DID per verification. Make one set per verification.
Implementations§
Source§impl LogSet
impl LogSet
Sourcepub fn new(clock: LogClock) -> Result<Self>
pub fn new(clock: LogClock) -> Result<Self>
An empty set whose logs are checked against clock, read now, with
the default limits.
Errors when the clock cannot be read (see LogClock::now_ns).
Sourcepub fn with_limits(self, limits: Limits) -> Self
pub fn with_limits(self, limits: Limits) -> Self
Check every log with these limits.
Sourcepub fn with_log(self, did: &str, log: Vec<u8>) -> Self
pub fn with_log(self, did: &str, log: Vec<u8>) -> Self
The log (did.jsonl) of did, as fetched from log_url.
Sourcepub fn with_seen_version_id(self, did: &str, seen: &str) -> Result<Self>
pub fn with_seen_version_id(self, did: &str, seen: &str) -> Result<Self>
The latest versionId seen for did before. Its log must still
contain it, so a log rolled back or forked since is refused.
Errors when seen is not a did:webvh versionId.
Sourcepub fn now_ns(&self) -> i128
pub fn now_ns(&self) -> i128
The time the logs are checked against, in nanoseconds since the Unix epoch.