chadtmiller.com/pds.js
An atproto PDS in JavaScript, for Cloudflare Workers and Node
0
0
'@pdsjs/spaces': patch '@pdsjs/core': minor '@pdsjs/storage-sqlite': patch '@pdsjs/cloudflare': patch '@pdsjs/drive': patch
Spaces follow the reference's 0.0.0-spaces-alpha-20261022141228. Nothing
of the old formats is accepted.
- Credentials.
getSpaceCredentialtakes{space, credentialKid, delegationToken?, clientAttestation?}and is not signed:credentialKidis the P-256 did:key the credential binds to. A space with a public read policy issues one without a delegation token; otherwise a request without one is answeredSpaceNotFound. A deleted space isSpaceDeleted, and a token that does not verify or was spent isInvalidDelegationToken(400). A credential is presented asAuthorization: Atproto-Space-Credential <jwt>, signed under the RFC 9421 label and tagatproto-space-credentialwith padded base64. - MACs instead of signatures. A commit is
{ver, repo, space, rev, data}and carries no signature.getRecord,getRepo,getLatestCommitandlistRepoOpsanswer anAtproto-Space-Want-Mackey share with anAtproto-Space-Macheader, under a secret derived from the account's#atproto_kemkey; a credential read without one isBadSpaceMac. The responses vary on the request header and expose the MAC header across origins. - STAR.
getReposerves a STAR-lite v1 archive (application/octet-stream) and no longer takesexcludeValues. A space record may be at most 1 MiB. - Records. A space record's
{$link}is stored as a CID link and{$bytes}as a byte string, so its CID is the one other implementations compute.@pdsjs/core/repogainscborDecodeLinks,jsonToLex,lexToJsonandcborDecodeJson. - Notices.
notifyWriteandlistReposcarrydata(washash), andnotifyWriterequires it andrepoRev. Deleting a space owes every registered syncer anotifySpaceDeleted, stored and retried with backoff until it lands or the registration expires. The authority's own write into a space it has not created, or has deleted, isSpaceNotFound. - Identity.
#atproto_spaceand#atproto_space_hostare gone: tokens are signed by#atproto, and a delegation token is addressed to<authority>#atproto_pds. - Storage.
SpaceStoragePortrows carrydata(the column is renamed in place) and gain the deletion notice outbox:enqueueSpaceDeletedNotify,listDueSpaceDeletedNotify,rescheduleSpaceDeletedNotify,deleteSpaceDeletedNotify.createSpaceRoutesrequiresgetKemKey.