Skip to main content

Module permission_set

Module permission_set 

Source
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.
PermissionSets
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.getRecord proof 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 permissions of the permission-set a lexicon record defines as main, or why it defines none.
printed_len 🔒
How many bytes atom adds to a grant’s scope string, its separator included.

Type Aliases§

ResolveFuture
A future a Resolve implementation hands back, boxed so the trait can be held as Arc<dyn Resolve>.