Spaces: policies and the space lifecycle
What this server does as a space’s authority and host for the spaces its
accounts own: creating, changing, describing and deleting them
(com.atproto.space.createSpace, updateSpace, getSpace,
deleteSpace); the policy that decides who may read a space and whose
writes it tracks, and asking a managedspace’s managing app
(com.atproto.managedspace.checkAccess); a memberspace’s member list
(com.atproto.memberspace.putMembers, removeMembers, listMembers);
taking an account out of the writer set (com.atproto.space.removeWriter);
publishing the policy and members to readers; a space’s host-side state
as an archive, for migration (com.atproto.space.exportSpaceMeta,
importSpaceMeta); and what these answer for an account taken down or
deactivated. Spaces, their URIs, roles and keys are as
Spaces says; what every method shares, and how the
server is checked, is in The PDS: accounts and their records.
The methods’ lexicons are in lexicons/com/atproto/{space,memberspace}
(a member, com.atproto.memberspace.defs#member, in
lexicons/com/atproto/memberspace/defs.json); the policies’ in
lexicons/com/atproto/{personalspace,memberspace,managedspace}/policy.json,
and the two published records’ in lexicons/com/atproto/space/policy.json
and lexicons/com/atproto/memberspace/member.json.
com.atproto.managedspace.checkAccess is a method the server calls and
does not serve, so its lexicon stays in
spaces/lexicons/com/atproto/managedspace/.
What every method here shares
Section titled “What every method here shares”Who calls. Every method here takes a session’s accessJwt as its
bearer token, from a password or an app password (Sessions), except
importSpaceMeta, which an app-password session may not call: 400 InvalidToken. No token is 401 AuthMissing; a token the server did not
give out, 400 InvalidToken. An OAuth access token is taken as well,
allowed what its space: permissions allow (OAuth: access tokens on every method, and what scopes allow, “Spaces”).
What is checked, in order, the first failure answered:
- For a procedure, the token, then its input against the lexicon; for a
query, its parameters, then the token (The PDS: accounts and their records). Input the lexicon
refuses, such as a malformed
space,did,repo,spaceTypeorskey, amembersordidslist of more than 100, a member without itsdid,readorwrite, apolicythat is not an object with a$type, or a policy field of the wrong type, is400 InvalidRequest; so isimportSpaceMeta’s body of anotherContent-Type(there). The account’s status is checked with the token (Takedown and deactivation, below). - Ownership: the space’s authority, the DID in its URI, must be the
caller’s own DID. Any other is
400 NotAuthorized, whether or not such a space exists and whoever hosts it. (importSpaceMetareads its archive first: there.) - For
createSpace,updateSpaceandimportSpaceMeta, the policy (below): before whether the space exists. - The space: one that was never created here, or was deleted, is
400 SpaceNotFound. A space is its whole URI, so the same authority with another type or key is another space. - For the member methods, the policy’s type:
400 PolicyMismatchfor a space not governed bycom.atproto.memberspace.policy. - For
listMembers, itscursor(The member list):400 InvalidCursor.
What they answer. createSpace, getSpace and listMembers answer
JSON, exportSpaceMeta an archive; every other method here answers 200
with an empty body and no Content-Type.
Policies
Section titled “Policies”A space’s policy is an object whose $type names the policy and whose
other fields configure it. The server implements the three baseline
policies, and only them. A $type other than these is 400 UnsupportedPolicy. The policy stored, and answered by getSpace and
published, is the one given with its defaults filled in and every field its
lexicon does not define dropped:
$type | Stored |
|---|---|
com.atproto.personalspace.policy | {$type} alone |
com.atproto.memberspace.policy | publicRead, publicWrite, publishPolicy, publishMembers, each false unless given; allowedApps as given, an empty list too, and absent when not given |
com.atproto.managedspace.policy | managingApp as given; publishPolicy, false unless given |
managingApp is required, and must be a service reference
<did>#<fragment>, with exactly one #:
<did>an atproto DID, as Proxying, service auth and preferences’sgetServiceAuthtakesaud(step 3):did:plc:and 24 characters ofa-zand2-7, or adid:webwith no path, and with no port but onlocalhost(did:web:localhost%3A2583);<fragment>not empty, of the characters RFC 3986 allows in a fragment:A-Z,a-z,0-9,-._~!$&'()*+,;=:@/?, and%followed by two hex digits.
Anything else is 400 InvalidRequest: a bare DID with no fragment, did:,
did:key:…#x, did:example:…#x, did:plc:abc#x, <did>#, <did>#a#b,
<did>#a b, <did>#%4, did:web:app.example:path#x,
did:web:app.example%3A443#x. Nothing more of it is checked when it is
stored: it need not resolve.
Who is authorized
Section titled “Who is authorized”Each policy decides two things for an account, separately: read, whether the authority issues a space credential for it; and write, whether the authority tracks its writes (the writer set, below). Neither stops an account writing its own repo in any space. A space’s authority is authorized to read and write its own space under every policy, without a member list or a managing app.
| Policy | Read | Write |
|---|---|---|
| personalspace | the authority only | the authority only |
| memberspace | anyone if publicRead; otherwise a member whose entry has read: true | a member as its entry’s write says; an account not on the list, only if publicWrite |
| managedspace | as the managing app’s read | as the managing app’s write |
So under publicWrite a member whose entry has write: false is not
tracked, and an account taken off the list is tracked again by its next
write.
A credential asked for with no delegation token names no account. A
memberspace with publicRead authorizes it; a managedspace asks its app,
with no repo; every other space refuses it.
A memberspace’s allowedApps is a second gate on reads alone, decided
after the account’s and applied to the authority too: when it is present,
the client must have presented an attestation whose client_id is in the
list; with no attestation, or one not listed, the app is refused. When it
is absent, or under any other policy, every app is authorized. How a
refused account and a refused app are answered is the credentials’ part.
Each decision reads the policy and member list as they are when it is made.
Asking a managing app: checkAccess
Section titled “Asking a managing app: checkAccess”Under managedspace, each read decision (a credential, authorizeSpaceSync,
Spaces: credentials) and each write decision (a write notification,
notifyRepoUpdate, Spaces: write notifications, the writer set and syncers) for an account other than the
authority asks the managing app, afresh each time; no answer is
remembered.
- Where.
managingAppis<did>#<fragment>. The DID is resolved (atproto's DID spec): adid:plcthrough the directory the server uses, adid:webfrom its host, fetched as Spaces: credentials fetches an issuer’s (“Issuers’ keys”: through Proxying, service auth and preferences’s guard, so with protection on never from an IP address orlocalhost, and never overhttp; no redirect; at most 65536 bytes; 10 seconds; in Limits’s pool fordid:webdocuments). The endpoint is the document’s service whoseidis#<fragment>(or the DID and#<fragment>), of anytype. ItsserviceEndpointmust be a string that starts withhttp://orhttps://and parses as a URL; any other (ftp://…,app.example, an object) is no endpoint. - The request.
GET <origin>/xrpc/com.atproto.managedspace.checkAccess,<origin>the endpoint’s scheme, host and port: its path, query and fragment are not used, sohttps://app.example/base?x=is asked athttps://app.example/xrpc/com.atproto.managedspace.checkAccess. An endpoint with a user name or password is asked nothing. The parameters arespace(the space’s URI);repo, the account’s DID, when there is one (a read with no delegation token has none); and, for a read whose client presented an attestation,clientId, the attestedclient_id. A write never carriesclientId, nor does a read without an attestation. No other parameter is sent. The request goes through Proxying, service auth and preferences’s guard (“SSRF protection”): with protection on, only to anhttpsendpoint whose host is a public name, no IP address and nolocalhost, resolving only to public unicast addresses; one it will not send is as a request that failed. With protection on or off it follows no redirect, reads at most 524288 bytes of the answer, and is given up after 10 seconds. - Its service auth (atproto's HTTP API (XRPC) spec):
Authorization: Bearer <JWT>, the JWT’s header{"typ": "JWT", "alg": "ES256K"}and its body exactlyiss(the authority’s DID),aud(managingAppas stored, fragment and all),lxm(com.atproto.managedspace.checkAccess),iat,exp(iat+ 60, in seconds) andjti(a fresh random string), signed with the authority’s#atprotokey as atproto's Cryptography spec signs. - The answer. The app answers when its status is
2xx(201too), itsContent-Typeisapplication/json(its media type compared without regard to case; parameters such ascharsetallowed), and its body is a JSON object whosereadandwriteare both booleans; other fields are ignored. A read decision is itsread, a write decision itswrite:falserefuses,trueauthorizes. - No answer. Anything else is a failure to decide, neither a refusal
nor an authorization: a DID that does not resolve, a document with no
such service or no endpoint, a request not sent, one that fails or
takes more than 10 seconds, a redirect, any other status (
204,3xx,4xx,5xx), noContent-Typeor another, a body that is not JSON, not an object, or longer than 524288 bytes, andreadorwriteabsent or not a boolean ("true",1,null; an answer of the form{"authorized": true}too). The method that asked then answers502 UpstreamFailure:authorizeSpaceSync(Spaces: credentials) andnotifyRepoUpdate(Spaces: write notifications, the writer set and syncers), the write not tracked.
createSpace
Section titled “createSpace”{spaceType, skey?, policy} creates a space whose authority is the caller:
at://<caller>/space/<spaceType>/<skey>. With no skey, the key is a new
TID (atproto's Timestamp Identifiers (TIDs) spec). It answers {space}, that URI, and nothing else.
A space of that URI that exists is 400 SpaceAlreadyExists, whether it
was created or imported; the policy is checked first, so an unsupported one
is UnsupportedPolicy even then. A deleted space may be created again: it
starts afresh, with the new policy, no members and an empty writer set.
When the policy asks for publishing, the published records are written as
the space is created (Publishing, below).
getSpace
Section titled “getSpace”?space= answers {space, policy}: space the space as asked, and
policy the stored policy.
updateSpace
Section titled “updateSpace”{space, policy} replaces the policy wholesale with the one given, stored
as above: a field not given takes its default, not its old value.
- The same
$typeis a change of configuration: a memberspace’s member list stays. - Another
$typemigrates the space: its member list is deleted, and migrating back to memberspace does not restore it. - Either way the writer set is not changed: writers tracked under the old policy stay until removed.
Publishing follows the new policy (below).
deleteSpace
Section titled “deleteSpace”{space} deletes the space. Deleting a space already deleted answers 200
again, and changes nothing; one never created is SpaceNotFound.
Deleting drops the space’s policy, member list and writer set (its
removals too), its syncers’ registrations, and the authority’s own repo in
the space: its records, commit and operation log (the space repo’s part).
Members’ repos, on this server or others, are not touched. From then on
every method here answers the space SpaceNotFound, except createSpace,
which creates it again, and importSpaceMeta. The server remembers that it
was deleted: authorizeSpaceSync answers it 400 SpaceDeleted whatever
the request’s delegation token, client attestation or notify
(Spaces: credentials, “authorizeSpaceSync”); and the syncers
registered for it when it is deleted, those whose registration has lapsed
too, are owed notifySpaceUpdate with #spaceDeleted (Spaces: write notifications, the writer set and syncers).
The member list
Section titled “The member list”A memberspace keeps a list of members, each a DID with two booleans,
read and write (com.atproto.memberspace.defs#member). The list is not
part of the policy object. Any DID may be a member, the authority’s own
too.
putMembers {space, members}, at most 100 members, each {did, read, write}, adds each DID to the list, or replaces both booleans of one
already listed. A DID given more than once takes its last entry. Each DID
given write: false is also taken out of the writer set (The writer set).
An empty members changes nothing and answers 200.
removeMembers {space, dids}, at most 100 DIDs, takes each DID that is
a member off the list and out of the writer set. A DID that is not a
member is ignored, its entry in the writer set, if any, left as it is; a
DID given twice is as once. An empty dids answers 200.
listMembers ?space=&limit=&cursor= answers {members, cursor?}, each
member {did, read, write}, in ascending byte order of the DID as stored.
limit is 1 to 1000, 100 by default. cursor, if given and not empty,
must be a DID (the lexicon’s did format, atproto's DID spec): any other
string is 400 InvalidCursor, checked last (What every method here
shares); it answers only the members whose DID is after it in that order.
An empty cursor is as none. The answer’s cursor is the last member’s
DID whenever the page has any member, even when it is the last page, and
is absent from an empty page.
The writer set
Section titled “The writer set”The writer set is the authority’s record of the accounts whose writes to
the space it tracks: each entry a DID, with the repoRev and data of
that account’s repo in the space as last notified, and the space-wide
spaceRev it was tracked at; the notifications’ part keeps it, and the
removals from it, in order (Spaces: write notifications, the writer set and syncers). Writes enter it as the
notifications’ part says, each only if the policy authorizes the writer to
write (Who is authorized), the authority’s own writes included. This page
changes it only so:
- removeWriter
{space, repo}takes the DIDrepoout of the writer set, under any policy, the authority’s own DID too. It answers200whether or not the DID was in it. A DID in it is removed: a removal the notifications’ part sequences, lists and tells the space’s syncers (Spaces: write notifications, the writer set and syncers); one not in it changes nothing. The DID is tracked again by its next write the policy authorizes. putMemberstakes out each DID it giveswrite: false, andremoveMemberseach DID that was a member: each a removal as above.deleteSpaceempties it; a space created again starts with it empty.importSpaceMetareplaces it with the archive’s.
updateSpace, putMembers with write: true, and removeMembers of a
DID that is not a member do not change it.
Publishing to readers
Section titled “Publishing to readers”A memberspace or managedspace whose policy has publishPolicy: true, and a
memberspace with publishMembers: true, keep copies of that state as
records in the authority’s own repo in the space, where they sync to
readers as any record does:
| Flag | Collection | Record key | Value |
|---|---|---|---|
publishPolicy | com.atproto.space.policy | self | {"$type": "com.atproto.space.policy", "policy": <the stored policy>} |
publishMembers | com.atproto.memberspace.member | the member’s DID, as below | {"$type": "com.atproto.memberspace.member", "read": …, "write": …} |
A member’s record key is the DID with its first %3A written as :, so
that a did:web with a port is a valid record key: did:web:localhost%3A2583
is keyed did:web:localhost:2583. Other DIDs are keyed as they are.
The server writes these records itself, each change below as one commit of the authority’s repo in the space, as any write of that repo is made (the space repo’s part), so that it is notified and tracked like the authority’s other writes. A change that writes or deletes nothing makes no commit.
createSpacewithpublishPolicywrites the policy record.updateSpacewrites the policy record, a new version even when the policy is unchanged, if the new policy publishes it, and deletes it if not and it is there. If whether members are published differs between the old policy and the new one, it also writes a record for each member (now published) or deletes each member’s record that is there (no longer published, a migration away from memberspace included), in the same commit.putMembers, when members are published, writes each given DID’s record, once however often the DID is given, in one commit, even a record that was already so; an emptymembersmakes no commit.removeMembersdeletes each removed member’s record that is there, in one commit; one that removes no member makes no commit.importSpaceMetawrites nothing: the records arrive with the authority’s repo (importRepo).deleteSpacedeletes the repo, records and all.
The policy and member list are what is enforced; the records are copies.
Direct writes of either collection, to any repo, are refused, and
clearRecords leaves them in the authority’s repo; both are the space
repo’s part.
Space meta archives
Section titled “Space meta archives”exportSpaceMeta
Section titled “exportSpaceMeta”?space= answers the space’s host-side state as a STAR archive
(Spaces) of the profile atproto-space-meta, Content-Type: application/vnd.dasl.star. The archive of a space’s state is one string of
bytes:
- The metadata is the DRISL map
{"$type": "atproto-space-meta", "ver": 1, "space": <the space's URI>}. - The pairs, each value DRISL, in three sections in this order, and
within each in strict ascending order of the key’s bytes:
- the key
policy: the stored policy; - for a memberspace, one pair per member, keyed
com.atproto.memberspace.member/<the member's record key, as above>, its value{"$type": "com.atproto.memberspace.member", "read": …, "write": …}; no pairs for the other policies; - one pair per entry of the writer set, keyed
writer/<DID>, its value{"repoRev": <TID>, "data": <the 32 bytes>, "spaceRev": <TID>}. The writer set’s removals are not in it.
- the key
- Limits: as the space repo profile’s, 65536 bytes of metadata, 4096 of a key, 1048576 of a value.
importSpaceMeta
Section titled “importSpaceMeta”The body is such an archive, as Content-Type: application/vnd.dasl.star,
parameters allowed; another type (application/octet-stream,
application/json, …), or none, is 400 InvalidRequest, with the token,
before the body is read. It is read, in this order, and the first fault
answered:
- STAR’s own faults, an empty body too, and the limits above:
400 InvalidSpaceMeta. - The metadata:
$typemust beatproto-space-meta,verthe integer1, andspacea valid space URI; else400 InvalidSpaceMeta. Other metadata fields are ignored. - The pairs, as they come: each value must be DRISL, and a map. The first
pair must be
policy; then any pairs that are neitherpolicynor startwriter/, the policy state; then thewriter/pairs. No pairs, or nonepolicy, a section out of that order, and keys out of order or repeated within a section are faults. Awriter/key’s rest must be a DID, and its value a map withrepoRevandspaceRevTIDs anddatabytes (of any length), other fields ignored. Each fault is400 InvalidSpaceMeta. - Ownership: the metadata’s space must be the caller’s, else
400 NotAuthorized. - The policy: one its lexicon refuses (no
$type, a field of the wrong type) is400 InvalidSpaceMeta; a$typeother than the three,400 UnsupportedPolicy; a badmanagingApp,400 InvalidRequest, as forcreateSpace. Unknown fields are dropped. - The policy state: under memberspace each key must be
com.atproto.memberspace.member/and a member record key that is a DID (read back by writing:before trailing digits of adid:web:<host>:<port>as%3A), its value a validcom.atproto.memberspace.memberwith its$type,readandwrite. Any other key, any key under another policy, or a bad value is400 InvalidSpaceMeta: a host never drops access state it does not know.
Then it replaces whatever the server holds for the space, all at once: the
space exists (again, if it was deleted), with the archive’s policy as
stored, the archive’s members as its member list, and the archive’s
writers, repoRev, data and spaceRev as given, as its writer set, with
no removals. It publishes nothing. So exportSpaceMeta of the space then
answers the archive imported, byte for byte, when that was as
exportSpaceMeta writes one.
Takedown and deactivation
Section titled “Takedown and deactivation”For an account deactivated (com.atproto.server.deactivateAccount) or
taken down by the server’s operator:
| Methods | Deactivated | Taken down |
|---|---|---|
createSpace, updateSpace, deleteSpace, putMembers, removeMembers, removeWriter | 401 AccountDeactivated | 401 AccountTakedown |
importSpaceMeta | answered as for an active account | 401 AccountTakedown |
getSpace, listMembers, exportSpaceMeta | answered as for an active account | answered as for an active account |
These come with the token, before the input is read. A taken-down account
can still get a session from createSession with allowTakendown: true;
exportSpaceMeta takes that session, and every other method here answers
it 400 InvalidToken.
getSpace and exportSpaceMeta do not take the admin token: 400 InvalidToken. A
space whose authority is deactivated or taken down is suspended, not
deleted; what that changes for credentials (authorizeSpaceSync refuses
it, Spaces: credentials) and the writer set is theirs. The account’s
own space repo writes and getDelegationToken are refused too
(The space repo, Spaces: credentials).
Note: exportSpaceMeta takes that session so that the account can
migrate its spaces away.
An account’s state is Account lifecycle’s, taken down before deactivated.
For other slices
Section titled “For other slices”These are what the other spaces parts rely on from this one, as behaviour; each reads the space’s state as it is when asked.
- Whether a space exists. A space is live from
createSpaceorimportSpaceMetauntildeleteSpace; deleted after that, until it is created or imported again; and otherwise unknown. The space repo’s part needs a live space for the authority’s own writes;authorizeSpaceSyncanswers a deleted oneSpaceDeleted. authorize_read(space, repo?, client_id?) -> yes | no | undecided: the read column of Who is authorized, for a live space.repoabsent (no delegation token) is yes for a memberspace withpublicRead, as the managing app answers for a managedspace, and no otherwise.client_id, the attested client, is passed to a managing app and decides nothing else here.authorize_app(space, client_id?) -> bool: theallowedAppsgate, asked only onceauthorize_readis yes: false only for a memberspace withallowedAppsand noclient_id, or one not listed.authorize_write(space, repo) -> yes | no | undecided: the write column, for a live space; a managing app is asked without a client.- Undecided is a managing app’s failure to decide (Asking a managing
app: checkAccess); the method that asked answers
502 UpstreamFailure. - The writer set’s changes from here: take a DID out (
removeWriter,putMemberswithwrite: false,removeMembersof a member), each a removal the notifications’ part sequences and tells the syncers; empty it (deleteSpace); replace it (importSpaceMeta). The notifications’ part keeps the set; this part only changes it so. - Published records are written through the space repo’s own write
path as the authority’s writes, so
on_commit(space, repo, rev, data)follows each commit as for any write. Their collections,com.atproto.space.policyandcom.atproto.memberspace.member, are the ones the space repo refuses to write directly, keeps onclearRecordsin the authority’s repo, and imports as they are. - Deletion: the syncers registered for the space when it is deleted,
lapsed registrations too, are owed
notifySpaceUpdatewith#spaceDeleted; delivering it is the notifications’ part.
Commands
Section titled “Commands”The methods here are commands and tools as Commands: every method as an MCP tool and a CLI command makes them, in the
groups space and memberspace: pds space create-space,
space_create_space; pds memberspace put-members,
memberspace_put_members; pds memberspace remove-members,
memberspace_remove_members. As there, a required repo (removeWriter’s)
may be left out with a token, and is then the caller’s own DID. Two are not
JSON:
exportSpaceMetaanswers an archive:pds space export-space-metawrites its bytes to standard output, asget-repowrites a CAR file, and it has no MCP tool.importSpaceMetatakes an archive:pds space import-space-metasends standard input as the body,Content-Type: application/vnd.dasl.star, and it has no MCP tool.
Where the reference departs from this page
Section titled “Where the reference departs from this page”- A managing app’s redirect. The reference follows it, and takes the answer at its target; the server follows none, a failure to decide.
How it is checked
Section titled “How it is checked”The spaces run (harness/spaces/compare.mjs, Spaces) checks this page
in harness/spaces/policies.mjs, with the server as a space’s authority
and host beside the alpha’s: on each side an authority account (the
server’s on the server, the reference’s on the alpha PDS), and peers on a
second alpha PDS, the same accounts for both sides, as members and
writers. Each request goes to both sides alike, with the space’s URI on
the side’s authority, and the answers must be equal with each authority’s
DID named alike, as The PDS: accounts and their records says. Every draw (the members, their booleans,
how they are batched, page sizes, keys) comes from the run’s seed. In
order, each stage on what the one before needs:
- Policies and lifecycle, which need nothing else: every method’s
answers and refusals above, in their order, the policies stored as
getSpaceanswers them,managingApps of each form above, taken and refused; the member list put in batches, a DID given twice in one, an empty batch, 100 members and 101, removals of members, of DIDs never listed and of a DID twice, and its pages, with cursors before and after every DID, an empty one, and ones that are no DID;removeWriter’s answers; and deletion and creating again, withauthorizeSpaceSyncof the deleted space answeringSpaceDeletedwith no delegation token, one that is no JWT, and anotify, andInvalidRequestfor acredentialKeythat is no key. Each archiveexportSpaceMetaanswers is read on each side as this page says, itsContent-Type, section order, key order, value shapes and limits, and must be the bytes of its own contents written again; then the two sides’ contents must be equal, eachwriter/entry by its DID anddata(repoRevandspaceRevmust be TIDs, and differ between servers).importSpaceMetais sent archives the harness writes: one valid, whichexportSpaceMetamust then answer byte for byte; one for each fault above, and pairs of faults that show their order; and bodies of otherContent-Types and none. - Publishing, which reads the authority’s repo with the space repo’s
listRecords,getRecord,getLatestCommitandlistRepoOps: the records each change above writes and deletes, their values and CIDs; which changes make a commit, by the repo’srev; that a batch ofputMembersorremoveMembersis one commit holding an operation for each member, bylistRepoOps; the refused direct writes; andclearRecordskeeping the records. - The writer set, which needs write notifications: peers on the
second PDS write into each side’s space, the same records on both, and
exportSpaceMeta’swriter/entries must show the same writers with the samedataon both sides: who is tracked under each policy, the authority too; underpublicWrite, an account not listed tracked and a member withwrite: falsenot;removeWriter,putMemberswithwrite: falseandremoveMembersof a member taking writers out, andremoveMembersof a writer not listed leaving it; a removed writer tracked again;updateSpaceleaving the set; deletion emptying it; and the managing app asked about writes, and a write it fails to decide not tracked. That a write is not tracked is seen once a later write by a tracked peer, made after it, is. Writes enter the writer set only by write notifications, the notifications’ part: until the server servescom.atproto.space.notifyRepoUpdate(the run probes it, and takes a501or404as not served), the writes are made on both sides, but only the reference’s writer set is held to the page; compared from then on. - Reads, which need credentials: delegation tokens from each user’s
PDS traded with each side’s
authorizeSpaceSync, whose answers must agree (a credential,SpaceNotFound,AppNotAuthorizedorUpstreamFailure) for members and others,publicRead,allowedAppswith no attestation, a personalspace, and a managedspace. - Takedown and deactivation, each held to the reference alone until
the server can deactivate and take down an account (it probes the
server’s
deactivateAccount, and the admin’supdateSubjectStatuswithPDS_ADMIN_PASSWORD, which the run sets); compared from then on. With the account’s token from before: the methods above, its space repo’s five writes (andcreateRecordwith a body past the limit, input the lexicon refuses, and another account’srepo), andgetDelegationToken; andauthorizeSpaceSyncof its space, as Spaces: credentials’s “How it is checked” says.
A managing app, played by the harness at a did:plc of its own with a
#forum service, answers checkAccess from a table, and errs on purpose:
it must be asked exactly for the accounts above, a read with no delegation
token with no repo, with the parameters above, and every call’s JWT must
be as above, verified against the authority’s key in the directory. An
answer with another field, and one of status 201, are taken; an error
status (500, 401), a read of "true", an answer with no write,
{"authorized": true}, a body that is not JSON, one of Content-Type: text/plain, and a fragment the app’s document lacks each fail to decide
(502 UpstreamFailure), the last with no call. Its document has services
with other endpoints too, compared: with a path, a query, a bare ? after
a path, and a fragment, each asked at
/xrpc/com.atproto.managedspace.checkAccess with the parameters above
alone; and with a user and password, ftp://, and no scheme, each failing
with no call. An answer in 600000 bytes fails, and one in 400000 bytes is
taken, compared. Held to this page alone, as the reference follows
redirects: an app whose endpoint answers 302 to the app fails to decide,
the app not asked.
With SSRF protection on, the server alone (harness/spaces/ssrf.mjs, near
the end of the run, the server started again without
PDS_DISABLE_SSRF_PROTECTION, then as before): a managing app
did:web:localhost%3A<port>#forum, and a did:plc whose services’
endpoints are http://127.0.0.1:<port>, https://127.0.0.1:<port> and
https://localhost:<port>, each a plain TCP listener of the harness
counting connections: a user’s credential fails to decide (502 UpstreamFailure), and no listener sees a connection.
Not compared:
- OAuth
space:scopes (manage=create,read_self, …): the run uses password sessions; OAuth: access tokens on every method, and what scopes allow’s spaces checks call these methods with OAuth tokens. - Client attestations:
allowedAppsis checked only with none given, and a managing app is never sentclientId; that a listed client’s attestation is accepted is the credentials’. - The time a managing app is waited for.
- A managing app’s redirect: the reference follows it; the server is held to this page.
- SSRF protection: the reference runs without it.
- What syncers are told of the writer set’s changes, and
listWriters: the notifications’ part. - The server’s writer set, until it serves
notifyRepoUpdate(stage 3, above): the notifications’ part. - Takedown and deactivation on the server, as above.