Skip to main content

refresh_allowances

Function refresh_allowances 

Source
pub async fn refresh_allowances(
    registry: &dyn Registry,
    client: &Client,
    endpoint: &str,
    operator_did: &str,
    records_read: &OperatorRecords,
) -> bool
Expand description

Lists every bot.did.operator record in the operator’s repository and installs the creates allowances they carry; see didbot_pds::allowance. A listing that fails leaves the allowances last installed in force, the same way a failed policy listing leaves the last policy set serving: a blip at the operator’s PDS must not widen or narrow what hosted accounts may create.

Every record in the collection is read, not only the ones naming accounts hosted here; an allowance for an account this server does not host is indexed and never matched.

A record naming an account some hosted account created carries no allowance, and is logged instead. The operator admits an account by creating it from their own repository, so a record that names a name already taken beneath a hosted creator is one the creator raced the operator to: honouring it would hand the creator whatever the operator meant to grant the account they were admitting. Records naming a root, or a name no account holds yet, are indexed as before.

Answers whether the listing succeeded and its allowances were installed.