chadtmiller.com/monolith
An atproto PDS
Proxying to the AppView and other services, service auth, preferences, and records checked against their lexicons
MergedThis pull adds proxying and service auth, preferences, read-after-write, SSRF-guarded outbound calls, and record validation against the vendored lexicons. I found nothing that must change, but I did not read all of it. The diff is 15,276 lines in 149 files.
What I read:
- Dependencies: the only new crate is
unicode-segmentation, andbs58is added topds-repo. No atproto or MCP crates were added. - Spec and README: the README and
spec/PDS.mdlink the newPROXY.mdandVALIDATION.mdand list the new methods. The README says what is built, with no history in it. The "no proxying to an appview" gap is removed from "Known gaps", which matches the change. - Preferences:
preferences.rsappends oneaccounts.logentry per put, under the account's lock, and waits for the entry to be durable only after releasing the lock. Personal details are limited to full sessions, and an app-password session cannot overwrite them. - Harness: the new
compare.mjssteps are wired in. I did not read the checks inproxy.mjs,validation.mjsorservices.mjs, so I cannot say whether any check is weaker than it should be. - Conformance excuses:
harness/conformance.yamlis unchanged by this pull, so no new excuses need checking.
What I did not read: proxy.rs, read_after_write.rs, validation.rs, the outbound.rs rewrite, lib.rs, the pds-lexicon and pds-repo changes, the proxy.mjs, validation.mjs and services.mjs harness checks, the PROXY.md and VALIDATION.md text, the vendored lexicons and the interop vectors. The merge queue's full gates remain the check on those.
The queue ejected this on a real difference, crash seed 23 step 413. An OAuth session with transition:chat.bsky sent chat.bsky.convo.sendMessage with atproto-proxy naming the AppView: the reference forwarded it, the server answered 403 ScopeMissingError. The server let transition:chat.bsky allow chat methods only together with transition:generic. Fixed in 1898490: transition:chat.bsky allows rpc of any chat.bsky.* method to any target (and nothing else, not *); transition:generic allows every other method. OAUTH-SCOPES.md says so, with unit tests for chat to the AppView, * under each scope, and getServiceAuth with chat only. Crash seed 23 and plain seed 1 now agree.
I read the change since my approval at c9aaaddacb35. It only changes how OAuth scopes gate chat.bsky. calls. transition:chat.bsky now allows those methods on its own, to any service, and never allows *. transition:generic allows every other method, * included, and no chat.bsky. method.
The code in scopes.rs, the unit test and the service_auth test all match this. spec/OAUTH-SCOPES.md is updated to the same rules in both places that state them. The case-sensitive prefix match is stated in the spec and is what starts_with does. Nothing in this change breaks what I approved earlier.
The PDS as an app's server: forwarding to the AppView and other services, and checking records against their lexicons. Each was specified by an agent that probed the reference, checked by a harness against stub services, and built from the spec alone.
Spec pages (new)
PROXY.mdatproto-proxyrouting: any method the PDS doesn't serve is forwarded. The target is resolved from a DID and service id (did:plcvia the directory,did:web), with the never-forwarded list and a service-auth JWT signed with the account's key. The forwarded and returned headers are exactly as listed, with the reference's status mapping.PDS_BSKY_APP_VIEW_URL/DID/CDN_URL_PATTERN.getServiceAuth:aud,lxm,expand app-password rules.getPreferences/putPreferences, durable, with personal details limited to full sessions.getProfile(s),getAuthorFeed,getTimelineandgetActorLikes, withAtproto-Upstream-Lag.getRecordof a repo not held here,getFeed,registerPush/unregisterPush.PDS_DISABLE_SSRF_PROTECTION.VALIDATION.mdspec/lexicons(app.bsky,chat.bskydeclarations, label and lexicon records, and the third-party ones the reference ships).validateandvalidationStatus:validatemay be undefined, true or false;validationStatusisvalidorunknown.$typechecks.spec/interop/syntax, with the reference'scidanduridifferences noted.Server
proxy.rs,read_after_write.rs,preferences.rs(a newaccounts.logentry, byte-cut tested),outbound.rs,validation.rs, and the validator extended inpds-lexicon(graphemes viaunicode-segmentation).putPreferencesis under the free-space floor.rpc:scopes gate forwarded calls andgetServiceAuth;Harness
lib/services.mjs, an AppView and a chat service that record what each side sends.checks/proxy.mjs: headers, JWT claims, statuses, read-after-write and preferences.checks/validation.mjs:app.bskyrecords, valid and broken in every rule family, under eachvalidatevalue;applyWrites.--limitschecks of forwarded calls.Checked: plain seeds 1–3,
--commands31, crash seed 21 with--firehose,--limits,--invites, the spaces run, andcargo test --workspace. The merge queue runs the full gates.🤖 Generated with Claude Code