Skip to main content

Module records

Module records 

Source
Expand description

The bot.did.policy and bot.did.policyBinding records, as didbot reads and writes them.

Both records are written by an operator into the operator’s own repository, which this server can read but never write to — the same asymmetry didbot-pds’s operator::OperatorClaim relies on. So, like that claim, each is parsed here by hand from a foreign repository’s JSON, and a malformed record reads as no record at all rather than charitably. The failure carries a path, exactly as the lexicon checker’s own InvalidRecord does, because the reader is an operator looking at their own record and the field that matters is where.

§Two checks, one stricter than the other

The lexicon documents under lexicons/bot/did/ are the first check, run by didbot_schema::validate_shape. They bound lengths, check formats and require fields. This module is the second: it refuses a field neither record declares, because a field silently dropped is a narrowing the operator wrote and the server never applied. What the lexicon leaves open — an action outside its known values, a document of a $type it does not name — is carried here as written; whether this server can answer the action or read the document is the policy build’s question, not the reader’s. The one open value refused here is an includes word outside subjects and descendants: it names a set of accounts this server cannot enumerate, so no later step could apply it.

Structs§

Includes
The set a binding’s includes names. At least one member is set, and the set with every member set writes every word the reader accepts.
Lookup
One record a policy reads from a repository this server does not hold.
PolicyBinding
One bot.did.policyBinding record.
PolicyRecord
One bot.did.policy record.
PolicyRef
One bot.did.policy record a binding names, by the repository it is in and its record key: the parts of the at:// URI it is written as.

Enums§

Accounts
Whose repositories a Lookup reads. Open: the lexicon names one word and carries any other, so the reader does too, and a word this build does not know reads nothing.
Action
One action a policy is consulted on. Open: the lexicon names some and carries any other, so the reader does too.
Document
A policy’s document, by the $type that names its engine.

Constants§

BINDING_COLLECTION
The collection a PolicyBinding is written under.
BINDING_FIELDS 🔒
The fields a bot.did.policyBinding record declares.
CEDAR_DOCUMENT
The $type of a Document::Cedar.
COUNT_DOCUMENT
The $type of a Document::Count.
DESCENDANTS 🔒
The includes word for every account admitted beneath a subject.
LOOKUP_FIELDS 🔒
The fields one lookups entry declares.
NAMED 🔒
The accounts word for the accounts the written record names.
POLICY_COLLECTION
The collection a PolicyRecord is written under.
POLICY_FIELDS 🔒
The fields a bot.did.policy record declares.
REGEX_DOCUMENT
The $type of a Document::Regex.
SUBJECTS 🔒
The includes word for the subjects themselves.

Functions§

array 🔒
datetime 🔒
did 🔒
dids 🔒
Reads an array of DIDs at name.
expected 🔒
index 🔒
kind_of 🔒
lookups_of
The lookups a record’s JSON declares, read the way PolicyRecord::from_json reads them.
object 🔒
only_fields 🔒
Refuses any field of object outside declared (and $type).
optional_string 🔒
policy_ref 🔒
Reads one policies entry: an at:// URI naming a bot.did.policy record by the DID of its repository and its record key.
required 🔒
string 🔒
typed_as 🔒
Refuses a $type naming anything but collection. A record listed out of a repository carries its collection as $type; a record body built by hand may omit it.