Expand description
What an include: scope grants: the permission set it names, resolved
from the set’s lexicon authority and cached.
The lexicon spec’s “Lexicon Publication and Resolution” is the path. The
set’s NSID less its name, reversed, is a domain: app.bsky.authFullApp
is bsky.app. The _lexicon TXT record under it names a DID. That
DID’s document names the server holding its repository and the key its
commits are signed with. The set is the com.atproto.lexicon.schema
record keyed by its NSID in that repository. It arrives as a
com.atproto.sync.getRecord proof, and nothing in it is read until the
proof verifies against that key.
PermissionSets::expand replaces each include: in a request with the
atoms didbot_scope::Include::grants reads out of its set. A set that
does not resolve, for any reason, grants nothing, and the rest of the
request is judged without it. It never fails the request.
§What one request can cost
Each set costs at most three requests: the DNS query, the DID document,
and the proof. Each is a GET through didbot_http::pinned_client with
a bounded body. One request resolves at most MAX_SETS sets, each
within SET_DEADLINE and all of them within EXPANSION_DEADLINE.
The cache is shared by every account and holds at most CACHE_ENTRIES
sets, each read from a proof of at most MAX_PROOF_BYTES.
Structs§
- Entry 🔒
- What the cache knows about one set.
- Network
- The resolution the lexicon spec describes, over the network.
- Permission
Sets - Every set this deployment has resolved, shared by every account.
Enums§
- Unresolved
- Why a set did not resolve.
Constants§
- CACHE_
ENTRIES - How many sets the cache holds.
- EXPANSION_
DEADLINE - How long resolving every set in one request may take. With the client’s
metadata and key set fetched first, a push stays inside
crate::routes::REQUEST_TIMEOUT. - FRESH_
FOR - How long a resolved set is used before it is resolved again.
- KEEP_
FOR - How long the last resolved copy of a set stands in while its authority cannot be reached.
- MAX_
ERROR_ 🔒BYTES - The most of a refusal’s body read, for the atproto error it names.
- MAX_
PROOF_ BYTES - The largest
com.atproto.sync.getRecordproof read. A set with a hundred methods is about ten kilobytes of proof. - MAX_
SETS - The most sets one request resolves. Past it, an
include:grants nothing. - RECORD_
NOT_ 🔒FOUND - The atproto error a repository names when it holds no record at a key.
- RETRY_
AFTER - How long a failed resolution is remembered before a sign-in tries again.
- SCHEMA_
COLLECTION 🔒 - The collection a lexicon is published in.
- SET_
DEADLINE - How long resolving one set may take: three requests, each usually well under a second.
Traits§
- Resolve
- One resolution of a set: its published
permissions.
Functions§
- lexicon_
name 🔒 - Where
nsid’s authority publishes its DID:_lexicon., then the NSID less its name, reversed. - permissions_
of 🔒 - The
permissionsof thepermission-seta lexicon record defines asmain, or why it defines none. - printed_
len 🔒 - How many bytes
atomadds to a grant’s scope string, its separator included.
Type Aliases§
- Resolve
Future - A future a
Resolveimplementation hands back, boxed so the trait can be held asArc<dyn Resolve>.