Expand description
The router: every route the development server answers.
ModulesΒ§
MacrosΒ§
- xrpc_
methods π - The XRPC methods this server serves: for each one, the handler behind it and the credential it accepts.
StructsΒ§
- AppState π
- Everything a handler needs.
- Auth
State - Session storage, the e-stop latch and the operator credential, bundled so
a caller building
app_with_authhands them over together. - Strict
Transport Security - A
Strict-Transport-Securityheader; see[tls] hsts_max_age_secsand[tls] hsts_include_subdomainsindidbot-config. - Turn
Span π - The request span, carrying the turn when the client named one.
- Xrpc
Body - A buffered request body, refused in the atproto shape.
ConstantsΒ§
- APP_
BSKY_ CREDENTIALS - The credential each of those methods accepts: the ones
getSessiontakes. - APP_
BSKY_ METHODS - The
app.bsky.*methods this server serves itself rather than proxies, as the reference PDS does: the accountβs preferences. - ATPROTO_
CREDENTIALS - The credential each of those methods accepts. See
auth::Credentialfor what each kind means, and that moduleβs βWhy every public route is publicβ for why the read surface isPublicon purpose: protocol-required forcom.atproto.sync.*andcom.atproto.repo.*βs reads, structurally required fordescribeServerandresolveHandle. The write half takes the agent tokencreateAccounthands back, androutes::write_record/routes::apply_writesare where the authenticated DID is checked against the repository a write names.getSessiontakes the same credentials, and names the account they sign in as. - ATPROTO_
METHODS - Every
com.atproto.*method this router answers, in NSID order. - BOT_
DID_ CREDENTIALS - The credential each of those methods accepts.
- BOT_
DID_ METHODS - The
bot.did.*methods this server serves β its own account admin surface, alongside thecom.atproto.*oneATPROTO_METHODSnames. - CORS_
ALLOWED_ HEADERS - The request headers an atproto client sends and a preflight must name.
- CORS_
EXPOSED_ HEADERS - The response headers a browser is allowed to show a script.
- CORS_
MAX_ AGE - How long a browser may cache a preflight answer before asking again.
- DEFAULT_
MAX_ ACCOUNTS - How many accounts a deployment may hold at once, absent
--max-accountsor a[capacity]section; seeAuthState::max_accounts. - DID_
LOOKUP_ LIMIT - How many DIDs hosted elsewhere one caller address may ask
com.atproto.identity.resolveDidto fetch perDID_LOOKUP_WINDOW; seeAuthState::did_lookup_limiter. - DID_
LOOKUP_ WINDOW - The window
DID_LOOKUP_LIMITis measured over. - HANDLE_
LOOKUP_ LIMIT - How many handles no account here holds one caller address may ask
com.atproto.identity.resolveHandleto look up perHANDLE_LOOKUP_WINDOW; seeAuthState::handle_lookup_limiter. - HANDLE_
LOOKUP_ WINDOW - The window
HANDLE_LOOKUP_LIMITis measured over. - MAX_
REQUEST_ BODY - The largest request body this server will hold in memory.
- OPERATOR_
LOGIN_ LIMIT - How many
GET /dashboard/logincalls one caller address may make perOPERATOR_LOGIN_WINDOW; seeAuthState::operator_login_limiter. - OPERATOR_
LOGIN_ WINDOW - The window
OPERATOR_LOGIN_LIMITis measured over. - PROVISION_
RATE_ LIMIT - How many
bot.did.createAccountandbot.did.createSessioncalls one caller address may make perPROVISION_RATE_WINDOW, the two together. - PROVISION_
RATE_ WINDOW - The window
PROVISION_RATE_LIMITis measured over. - REQUEST_
TIMEOUT - How long any one request may take before this router gives up on it and
answers
503with an empty body. - SYNC_
READ_ LIMIT - How many
com.atproto.sync.*reads one caller address may make perSYNC_READ_WINDOW; seeAuthState::sync_rate_limiter. - SYNC_
READ_ WINDOW - The window
SYNC_READ_LIMITis measured over. - TURN_
HEADER - The header a client may name the turn a request belongs to in.
- TURN_
HEADER_ MAX_ LENGTH - The longest turn identifier this server will put in a log line.
StaticsΒ§
- SYNC_
READ_ πCONCURRENCY - How many
com.atproto.sync.*reads may hold a blocking-pool thread at once, across every caller.
FunctionsΒ§
- app
- Builds the router.
- app_
bsky_ πroutes - The routes those names stand for.
- app_
with_ auth - Builds the router with every collaborator supplied explicitly.
- app_
with_ health - Builds the router with the health pulse wired to an existing producer.
- app_
with_ repos - Builds the router with
com.atproto.sync.subscribeReposattached too. - atproto_
did π GET /.well-known/atproto-did- atproto_
routes π - The routes those names stand for.
- authorize_
upload π - Checks one upload against the scope of the token that presented it, and
writes a refusal down the way
authorize_writedoes. - authorize_
write π - Checks a write against the scope of the token that presented it β see
auth::Writer::authorizeβ and writes a refusal to the evaluation log beside the policyβs own, so what a token was refused reads in one place. - blocking_
task_ πfailed - The 500 for a
spawn_blockingtask that panicked instead of answering. - bot_
did_ πroutes - The routes those names stand for.
- cross_
origin_ layer - The cross-origin policy on the public protocol surface.
- describe_
server π GET /xrpc/com.atproto.server.describeServer- did_
json π GET /.well-known/did.json- hand_
out_ πnonce - Hands the client a DPoP nonce on the answer to any request that carried
a
DPoPproof, success and refusal alike, unless the answer names one already, as a nonce challenge does. - health π
GET /health- host_
without_ πport - Strips a port from a Host header value.
- only_
loopback_ πcallers - Refuses a caller that is not on this host, when this deployment answers
only callers that are; see
AuthState::loopback_callers_only. - parse_
body π - Parses a JSON body, mapping any failure to a 400 in the atproto shape.
- poll_
operator_ πclaim POST /xrpc/bot.did.pollOperatorClaim- record_
scope_ πrefusal - The evaluation logβs row for a write outside its tokenβs scope, named
auth::TOKEN_SCOPE_RULEwhere a treeβs row names a policy. - request_
authority π - The authority a request names, however its protocol version spells it.
- request_
too_ πlarge RequestTooLarge: a body overMAX_REQUEST_BODY.- require_
sync_ πbudget - Spends one of the callerβs
SYNC_READ_LIMITsync reads, or answers the refusal. - resolve_
identifier π - Resolves
identifierβ a handle or a DID β to an account DID this deployment hosts. - resource_
credential π - Resolves a repo write routeβs credential β an agent token or a DPoP-bound
OAuth access token. See
auth::require_agent_token_or_dpop. - security_
headers π - The headers every response this server sends carries.
- stats π
GET /xrpc/bot.did.stats- sync_
read π - Runs a
com.atproto.syncread on the blocking pool. - too_
many_ πprovisioning_ attempts - unknown_
route π - The answer for a path nothing serves, and for an XRPC call nothing
proxies; see
crate::proxy::fallback. - wrong_
method π - The fallback for the right path and the wrong method.
- xrpc_
health π GET /xrpc/_health