Skip to main content

refresh_root_standing

Function refresh_root_standing 

Source
pub async fn refresh_root_standing(
    registry: &dyn Registry,
    client: &Client,
    endpoint: &str,
    operator_did: &str,
    standing: &mut RootStanding,
    now: OffsetDateTime,
    grace: Duration,
) -> Vec<String>
Expand description

Re-reads the operator’s record for every root account and reports each one’s standing to the registry. Answers with the DIDs whose standing changed.

A root account is one the operator created from their own repository: active, hosted here, with no hosted parent, and not the server itself. The same getRecord the server’s own claim is read with, at the record key the root’s own hostname is. A record counts when it names the root’s DID exactly.

Absence is the only thing read as revocation, and only once it has lasted grace, the window the server’s own claim gets and for the same reason: a server cannot tell “the operator revoked” from “the operator’s PDS is down”. fetch_claim_from answers Ok(None) for a repository that was reached and holds no record at the key, and ClaimFetchError for everything it could not get an answer out of; an error leaves every standing as it was and ends the pass, since every root reads from the same endpoint. Registry::set_operator_standing quarantines a lapsed root and everything beneath it, and releases them when the record returns.

At most VOUCH_REREAD_LIMIT roots per call, in DID order from just past where the last call stopped and wrapping to the first.