~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The docs say what the host does after the README rewrite

Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:docs/readme-followup
docs/design/groups.md+9−7
@@ -73,18 +73,20 @@ public repo. The host writes it when `meta` starts public, and writes
or removes it whenever `meta`'s `publicRead` changes, and refuses a
write of it while `meta` is private.
`getActorGroups` shows you all your own groups. For someone else, it
shows only the switched-on groups you're in too, so a person's other
memberships stay private.
`getActorGroups` lists the switched-on groups a person holds a role in
that you're in too, so a person's other memberships stay private, and
asking about yourself never shows a switched-off group.
## How relays hear of a group
Apps learn of a group from relays reading the host's firehose, as for
any account ([sync](https://atproto.com/specs/sync)). Making a group
puts out `#identity`, `#account` and a first commit there. But a relay
puts out `#identity`, `#account` and its first commits there, the
declaration among them when `meta` is public. But a relay
that stopped reading a host it couldn't reach reads it again only when
asked. So the host asks each relay in `PDS_CRAWLERS` to crawl
(`com.atproto.sync.requestCrawl`) as it starts, before it serves, and
(`com.atproto.sync.requestCrawl`) as it starts, before anything is
written, and
every 20 minutes after, whether or not it wrote anything.
The host never prunes its firehose, so a relay that reconnects with a
@@ -99,9 +101,9 @@ A group's first handle is one label under `HANDLE_DOMAIN` (`.test` by
default), such as `book-club.test`. The host keeps it as the group's
address, which never changes while the group is here and stays
reserved after the group takes another handle. `checkAddress` says
whether a label is free. At its address the host serves
whether an address is free. At its address the host serves
`/.well-known/` and `/xrpc/`, `/` redirects to the group's page in the
console, and anything else is a 404.
console while the group is switched on, and anything else is a 404.
## A handle on its own domain
docs/design/membership.md+30−19
@@ -8,7 +8,8 @@ console and in every app a member signed in as the group.
## Members and the members space
A space is a set of records that only the accounts its policy names may
read ([spaces](https://atproto.com/guides/spaces)). A member is anyone
read, unless the policy sets `publicRead`
([spaces](https://atproto.com/guides/spaces)). A member is anyone
with an `org.atgrp.membership` record, keyed by their DID, in the
group's members space (`at:space/<group>/org.atgrp.members/self`). Its
policy gives the `member` role read and write, and `updateSpace` refuses
@@ -22,9 +23,10 @@ side, an `org.atgrp.confirmation` in their own repo in the space, which
changes nothing they may do.
Roles and memberships are ordinary records written as the group. The
host has no methods of its own for changing them, and writes a
host has no methods of its own for changing them. It writes a
membership itself only when someone joins, and for the founder and
stewards when a group is made. `getGroup` gives a member just
stewards when a group is made, and deletes one itself when someone
leaves. `getGroup` gives a member just
`memberCount`, so showing a group's size doesn't mean fetching the
roster.
@@ -42,7 +44,8 @@ and `group.configure`, and a permission answers each. `admit`,
membership, so any permission that writes memberships carries them. A
[permission set](https://atproto.com/guides/permission-sets) counts as
every permission it lists, so `authManageMembers` carries all four
member actions. A role may also carry `repo:<collection>`, a
member actions (`invite`, `admit`, `role.assign` and `eject`). A role
may also carry `repo:<collection>`, a
collection of the group's public repo its holders may write. The API
reference lists the actions and sets.
@@ -104,7 +107,9 @@ editor in advance which permissions and sets they hold enough of to give.
Someone asks to join with `requestJoin`, and the group's `joinPolicy`
(in its `org.atgrp.config`) decides what happens. With `open`, they get
in. With `approval` (the default), they wait for a member who holds
`admit`. With `invite`, only an invitation gets them in.
`admit`. With `invite`, only an invitation gets new people in. A request
left waiting from before the policy changed still waits, and an admitter
may still let that person in.
A request isn't a record, since the asker isn't a member and the members
space is for members. The host keeps it in its own database, one per
@@ -124,9 +129,12 @@ a day.
An invite means the group has already said yes. It has to reach someone
outside the group, so the group writes it where they already look, their
inbox (`at:space/<invitee>/org.atgrp.inbox/self`). That's a space under
their own DID at their own PDS. Their app makes it with a policy that
lets any account write and names no members, so any group may write
there and only its owner reads it. The invite is an `org.atgrp.invite`
their own DID at their own PDS. Their app makes it with
`createSpace` at their PDS (a permission `authParticipate` carries),
under a `com.atproto.memberspace.policy` that sets `publicWrite` and
names no members. So any group may write there and only its owner reads
it. The console never makes an inbox, and shows invites from the host's
list instead. The invite is an `org.atgrp.invite`
record in the group's repo in that inbox, with an optional message and
expiry.
@@ -145,7 +153,8 @@ whatever the join policy. It writes the membership first and takes the
invite back after, so a failed join leaves the invite waiting. The
invitee refuses with `declineInvite`, and the group may invite them
again. An expired invite admits nobody, and the host takes it back
within the hour. Some apps can't read a person's inbox, so
within the hour, after which the group may invite them again. Some apps
can't read a person's inbox, so
`getActorInvites` lists the caller's waiting invites from groups here.
## Leaving and being removed
@@ -154,16 +163,18 @@ A member leaves with `leaveGroup`. A holder of `eject` puts a member out
by deleting their membership as the group, if every role the member
holds is one the ejecter may assign.
Either way, the host first revokes the space credentials the group
issued them, so if that fails they're still in and it can be tried
again. Revocation is immediate for repos on this host, and writers on
other PDSes are sent `com.atproto.space.notifyCredentialsRevoked`
([space sync](https://atproto.com/guides/space-sync)). Once the
membership goes, the host ends the OAuth grants they approved for the
group and their MCP clients' grants, with every session those began,
and drops their app passwords for the group. It takes them off the
writers of each of the group's spaces and tells each space's syncers.
With no roles, no space's policy grants them anything.
Either way, the host revokes the space credentials the group issued
them, ends the OAuth grants they approved for the group and their MCP
clients' grants, with every session those began, and drops their app
passwords for the group. It takes them off the writers of each of the
group's spaces and tells each space's syncers. Leaving ends all of that
before the membership goes. An ejection revokes credentials before the
membership goes and ends the grants and app passwords after. Either way,
if revocation fails they're still in and it can be tried again.
Revocation is immediate for repos on this host, and writers on other
PDSes are sent `com.atproto.space.notifyCredentialsRevoked`
([space sync](https://atproto.com/guides/space-sync)). With no roles, no
space's policy grants them anything.
What they wrote stays theirs, in their own repos at their own PDSes,
though the group's index forgets it at once. An ejection is kept in the
docs/design/moderation.md+18−9
@@ -23,14 +23,17 @@ holds none. The permission set `org.atgrp.authModerate` carries
members spaces only, so it doesn't carry `label`. `authManageAdmin`
carries all of that and `group.configure`.
No method checks `label`. A label is a record, so the space's write
The `label` action only describes what a role can do (`getGroup`
answers it and the console uses it), and no method checks it. A label
is a record, so the space's write
permissions decide where a moderator may write one, through their roles'
group-wide permissions or a space policy granting their role the label
collection there. `getGroup` answers those spaces as
`viewer.labelSpaces`, and the console offers labelling only there.
Every other method checks the caller's roles when it's called, whether a
member asks or an app or MCP client acts for one. The API reference
member asks or an app or MCP client acts for one. Reports, appeals and
`mod.querySelfHistory` need no role. The API reference
lists the methods and errors
([Moderation](../reference/api.md#moderation)).
@@ -43,14 +46,17 @@ spaces](https://atproto.com/guides/moderating-spaces)).
The host keeps a label beside its subject, so exactly the people who
read the subject read its label. A record's label goes in the record's
space. atproto has no standard for labelling an account in a space, so
this host puts an account's label in the members space, which every
member reads. A member's public post is labelled there too, if its
by convention this host puts an account's label in the members space,
which every member reads. Any of the group's spaces may hold one,
though. A member's public post is labelled in the members space too, if
its
author holds a role in the group, so a moderator can label one post
rather than its author.
Taking a label back means deleting its record, since atproto has no
standard for negating a space label. Each label written or deleted
through a token for the group becomes an event in the queue, credited to
standard for negating a space label. Each label written or deleted as
the group (by any token, session or MCP client) becomes an event in the
queue, credited to
the acting member, so the queue keeps who labelled what.
## What the host does with a label
@@ -67,6 +73,7 @@ down only that version, and one without takes down every version. A file
is taken down if its writer is, or if a taken-down record holds it in
the version the index has now. An account taken down in the members
space has everything it wrote taken out of every space of the group.
Taken down in another space, it loses only what it wrote there.
Only labels in the group's own repo count. A label past its `exp` counts
no more, and deleting the label puts everything back. The content stays
@@ -91,7 +98,8 @@ public repo, and a record is a subject separate from its author.
A subject enters the queue with its first report, label or ejection, and
starts `open`. Each later act is an event on it: a report, an appeal, a
status or tag change, a label written or deleted, or an ejection. An
ejection is a moderator deleting someone's membership, which also takes
ejection is anyone holding `eject` deleting someone's membership, which
also takes
them out of every space's writers. A member who leaves of their own
accord isn't ejected.
@@ -127,8 +135,9 @@ appeal needs no role and no read access, so someone put out of the group
can still appeal, and the labeler doesn't limit appeals.
`mod.querySelfHistory` shows someone what was done to their account and
records, former members included. It shows status changes, label values
and the label records' URIs. It leaves out reports, tags, notes and who
records, former members included. It shows status changes, appeals,
ejections, label values and the label records' URIs. It leaves out
reports, tags, notes and who
acted, so it never names a reporter or a moderator.
## The group's own labels
docs/design/moving.md+18−9
@@ -13,8 +13,9 @@ references to the group still hold. The DID moves by a PLC operation, a
signed change the directory accepts only from a rotation key the last
operation lists ([DIDs and PLC](https://atproto.com/specs/did)).
Only the spaces the group governs move, and a repo it keeps in someone
else's space stays behind. Members' repos stay on their PDSes. The new
In a group move, only the spaces the group governs move, and a repo it
keeps in someone else's space stays behind. Members' repos stay on
their PDSes. The new
host keeps each writer's repo rev and digest, so it reads them on
without waiting for a write, and members' PDSes find it through the
group's DID ([space sync](https://atproto.com/guides/space-sync)).
@@ -40,8 +41,12 @@ lives. It resolves the group's DID fresh, checks the JWT is the group's
and meant for it, and pulls only from the PDS the document names. Any
failed answer from the source stops the move (`SourceUnreadable`). The
repo must be signed by the group's current key, and each file must hash
to its listed CID. A missing or wrong file fails the whole move, since
the source still serves and records mustn't point at nothing.
to its listed CID. A space repo must name the group and the space, and
its digest must equal its commit's. A missing or wrong file fails the
whole move, since the source still serves and records mustn't point at
nothing. The group gets the first label of its old address under
`HANDLE_DOMAIN`, and keeps a handle on a domain of its own only while
that still resolves to it.
The destination makes its own keys and rebuilds the repos as new
commits under them, so old commits go but each record keeps its CID.
@@ -91,11 +96,15 @@ match is left out with a warning. That's looser than a group move,
because an account on an arbitrary PDS may already have lost files.
The account keeps its handle only on a domain of its own that still
resolves to it, and always gets an address under `HANDLE_DOMAIN`.
Its spaces come along when its server reports `spacesAlpha`. A personal
space becomes an unlisted `org.atgrp.policy`, and a member space keeps
its members as grants. A policy this host can't express is
`UnsupportedPolicy`. `checkImport` shows the plan before anything moves.
resolves to it, and always gets an address under `HANDLE_DOMAIN`. The
[API reference](../reference/api.md#moving) lists the handle rules.
Its spaces come along when its server reports `spacesAlpha`, and so
does the account's repo in another account's space. Personal and member
spaces both become an unlisted `org.atgrp.policy`. A member space keeps
its `publicRead` and its members as grants, and a space already under
`org.atgrp.policy` keeps its policy as it is. A policy this host can't
express is `UnsupportedPolicy`. `checkImport` shows the plan before
anything moves.
`completeImport` takes the operation the account's server signed, which
must point the account here with this host's keys (else
docs/design/signing-in.md+29−17
@@ -65,8 +65,9 @@ scope of `atproto transition:generic` (the repo, blobs and other
services, never a space). A privileged one adds `transition:chat.bsky`.
The host can't narrow a scope that broad, so it follows the maker
bluntly. Once the maker stops holding `repo:*`, the host forgets every
app password they made in that group, and their sessions, for good.
bluntly. The next time it checks the maker (at each sign-in, use,
refresh or listing) and finds they no longer hold `repo:*`, it forgets
every app password they made in that group, and their sessions, for good.
### Apps that start groups
@@ -95,10 +96,14 @@ part of the request the member's roles grant at that moment:
- `space:*?...` becomes one scope per space the roles read, with the
collections they may write there.
- `manage=` is kept if the roles or the space's policy let the member
manage spaces of that type, and `blob:` only if something kept writes.
manage spaces of that type. Only the `space.create` role grants
`create`, since a policy grants just `update` and `delete`. `blob:` is
kept only if something kept writes.
- `space:org.atgrp.inbox?...` for someone else's inbox is kept when the
roles hold `invite` and the scope asks to write invites alone.
Everything else is withheld, such as `identity:`, `account:` and a
space scope for another authority. The `rpc:` scopes come below.
Everything else is withheld, such as `identity:`, `account:` and any
other space scope for another authority. The `rpc:` scopes come below.
The host's four
[permission sets](https://atproto.com/guides/permission-sets) for a
@@ -107,9 +112,10 @@ group session are upper bounds. `authManageAdmin` holds
keeps the parts the roles grant, under a tier's name when they make up a
whole one. So a moderator whose app asks for `authManageAdmin` gets
`authModerate`. Another app's set is read as that app publishes it,
through its `_lexicon` TXT record (over `DNS_OVER_HTTPS`). Its repo parts
are kept as `repo:` scopes would be, and its space permissions give a
group session nothing. A set that doesn't resolve is withheld.
through its `_lexicon` TXT record (over `DNS_OVER_HTTPS`). Its repo and
`rpc` parts are kept as `repo:` and `rpc:` scopes would be, and its space
permissions give a group session nothing. A set that doesn't resolve is
withheld.
Last, the host expands each set into the scopes it held at approval and
turns `authority=self` into the group's DID. So a set that grows later
@@ -126,8 +132,10 @@ it as the group (`Forbidden` otherwise). In a space, its policy decides
The checks run under the group's write lock, with the commit, and a
group's commits run one at a time. So no change to the member's roles
slips in between the check and the write. A member whose roles shrink
gives every app they signed in less at once. A member who leaves or is
slips in between the check and the write. An invite is the exception.
Its checks run just before its write to the inbox, outside the lock. A
member whose roles shrink gives every app they signed in less at once.
A member who leaves or is
removed ends every grant they approved, MCP grants included.
A switched-off group refuses writes and uploads. Its apps' tokens still
@@ -142,7 +150,7 @@ To read a space, an app buys a delegation token with
`getDelegationToken`, for a scope that reads the space and a member who
reads it now, and the host keeps it as the grant's. When the grant ends
or its member comes to read less, the host revokes what it bought
([spaces](spaces.md#giving-out-credentials)).
([spaces](spaces.md#reading-a-space-through-the-host)).
An app calls the host's own methods as the group with `rpc:` scopes. At
approval the host keeps one only for a method its sets list, aimed at
@@ -181,8 +189,8 @@ cookie, and the host honours the callback only there. So a link to
someone else's approval can't sign a person in as them.
A signed-in person holds a cookie with their DID and its expiry, signed
with an HMAC, which lasts 30 days and needs nothing stored. Signing out
records the time, and any cookie signed before a DID's last sign-out
with an HMAC, which lasts 30 days. The host stores no session for it,
only the time of each DID's last sign-out. Any cookie signed before that
names no one, in any browser. On https the cookie takes the `__Host-`
prefix, so a group's address can't set one, and a request whose `Origin`
isn't the console's names no one. Moving an account here asks a wider
@@ -193,8 +201,10 @@ scope ([moving](moving.md)).
The console doesn't run OAuth against its own host. To write as a group,
it asks `getGroupAuth` for one space, as the member, with a DPoP proof.
It gets a 15-minute token that's never refreshed, scoped to what the
space's policy lets the member's roles write, and checked at each write
like any grant. An MCP tool that writes runs the same way.
space's policy lets the member's roles write (in the members space, the
roles' own writes too), and checked at each write like any grant. Asked
for someone's inbox, it gets a token that writes invites there if the
roles hold `invite`. An MCP tool that writes runs the same way.
## Seeing and ending grants
@@ -203,8 +213,10 @@ with `listGroupTokens` and ends any with `revokeGroupToken`. An app ends
its own at `/oauth/revoke`. Beside the grants, `listGroupTokens` returns
the group's activity log, which shows who did what through which app.
Tokens are 32 random bytes, and the host stores only their SHA-256. So
revoking a grant deletes its row, and the next call with its token
OAuth, `getGroupAuth` and MCP tokens are 32 random bytes, and the host
stores only their SHA-256. An app password's session tokens are JWTs
signed with a key derived from the rotation key, found by their hash.
So revoking a grant deletes its row, and the next call with its token
fails, with no token left to run until it lapses. DPoP nonces need
nothing stored. Each is an HMAC of a three-minute time step, and the
host checks one by computing it again (accepting one step either side).
docs/design/spaces.md+15−6
@@ -9,7 +9,9 @@ atproto's answer is a space, a non-public store of records whose
authority DID decides who reads and writes. Each writer keeps their own
repo in it on their own PDS ([spaces](https://atproto.com/guides/spaces)),
and a space is named `at:space/<authority>/<type>/<skey>`
([space data](https://atproto.com/guides/spaces-data)). The host is the
([space data](https://atproto.com/guides/spaces-data)). A space's type
is any NSID, but a member's PDS grants an app a type only once it can
read that type's published schema. The host is the
authority of each group's spaces. It also keeps the group's own repo in
each space the group writes in, as any PDS does.
@@ -113,11 +115,9 @@ The group is a writer too, in its own spaces and in others, such as
an invite in the invitee's inbox space
([membership](membership.md#invites)). Its repo there has records and a
revision but no signed tree, and a set hash over the records names its
state. After each write the host tells the authority with
`notifyRepoUpdate`, retried for a day. `getRecord`, `getRepo`,
`getLatestCommit` and `listRepoOps` sign their answer with a secret
agreed against the group's `#atproto_kem` key, which proves to that
reader alone that this host answered.
state. For its own spaces the host records each write at once,
internally. An authority elsewhere hears of it by `notifyRepoUpdate`,
retried for a day.
## Reading a space through the host
@@ -142,6 +142,11 @@ The credential is the group's, so it reads everything there, but only
while the app's grant lasts and its member reads. When either ends, the
host revokes its credentials and withdraws its registrations.
`getRecord`, `getRepo`, `getLatestCommit` and `listRepoOps` on the
group's own repo sign their answer with a secret agreed against the
group's `#atproto_kem` key, which proves to that reader alone that this
host answered.
## Reaching other servers
A member's DID document ([DIDs](https://atproto.com/specs/did)) or a
@@ -150,6 +155,10 @@ guard that allows only public addresses over https and follows no
redirects, and no one can aim it at its own network. When `PUBLIC_URL`
is http, for local work, the guard allows any address.
The host keeps a member's DID document 5 minutes, and fetches it again
when a kept key rejects a signature. It reads a document up to 256 KiB
and refuses a `did:web` with a path.
## Ending a space or a group
`deleteSpace` unlists a space and ends it. The host forgets its index,
docs/diagrams/network.svg+1−1
@@ -49,7 +49,7 @@ path{fill:none;stroke-linecap:round}
<text x="386" y="270" class="f-muted" font-size="16" text-anchor="middle">of a write there</text>
<path d="M558.95 20.28 C618.97 21.05, 678.93 20.18, 858.91 19.02 M560.71 20.37 C668.51 21.33, 777.4 21.56, 860.1 20.59 M858.12 18.26 C858.79 41.74, 858.54 61.76, 859.64 91.22 M859.06 20.41 C859.66 44.77, 859.06 71.25, 860.92 89.99 M861.39 90.27 C781.18 92.33, 699.69 91.42, 559.43 90.84 M859.97 89.67 C743.22 90.24, 625.35 89.79, 559.97 90.52 M559.75 89.22 C561.2 68.71, 559.75 50.45, 558.06 19.5 M559.71 90.97 C560.49 64, 559.09 36.93, 559.49 20.8" class="s-ink" stroke-width="1.6"/>
<text x="710" y="50" class="f-ink" font-size="18" text-anchor="middle">an app a member</text>
<text x="710" y="74" class="f-ink" font-size="18" text-anchor="middle">signed in to as "hikers"</text>
<text x="710" y="74" class="f-ink" font-size="18" text-anchor="middle">signed in as hikers</text>
<path d="M641.43 93.35 C632.29 109.6, 623.96 125.93, 599.72 177.06 M639.32 93.76 C626.27 125.47, 610.54 156.73, 600.55 176.55" class="s-ink" stroke-width="1.8"/>
<path d="M600.19 174.9 C601.14 172.16, 600.7 170.23, 600.22 162.65 M599.79 175.37 C600.19 172.98, 599.65 171.07, 600.25 163.2" class="s-ink" stroke-width="1.8"/>
<path d="M599.44 176.83 C601.81 175.38, 603.38 172.63, 609.26 169.5 M600.02 176.19 C602.21 173.82, 605.2 172.47, 610.08 168.34" class="s-ink" stroke-width="1.8"/>
docs/reference/api.md+60−13
@@ -86,9 +86,9 @@ these too. A request to the host's own name never does:
| Method | What it does |
| --- | --- |
| `GET org.atgrp.internal.listMembers` | lists the group's members and their roles, a page at a time in DID order (`limit`, `cursor`), filtered to those whose handle or DID contains `q`. It's for a caller who may read the members space. A page is 50 by default, 100 at most |
| `GET org.atgrp.internal.listMembers` | lists the group's members and their roles, a page at a time in DID order (`limit`, `cursor`), filtered to those whose handle or DID contains `q`, ignoring case. It's for a caller who may read the members space. A page is 50 by default, 100 at most |
| `POST org.atgrp.leaveGroup` | leaves a group (`GroupNotFound`, `NotAMember`), unless the caller is its only admin (`LastConfigurer`) |
| `POST org.atgrp.requestJoin` | asks to join, or redeems an `invite` in the caller's inbox. It answers `status` `admitted` with the `membership`, or `pending` with the `request`. A caller who already asked gets their waiting request back, with its first message and time, and a member gets their membership. A `message` is 2,000 graphemes at most. A switched-off group refuses it (`GroupNotFound`, `InvalidInvite`, `JoinClosed`) |
| `POST org.atgrp.requestJoin` | asks to join, or redeems an `invite` in the caller's inbox. It answers `status` `admitted` with the `membership`, or `pending` with the `request`. A named `invite` must be the caller's waiting invite from this group (`InvalidInvite`), and a waiting invite admits them whatever the policy. Under `open`, the caller is let in, even with a request left waiting from before. Under `approval` or `invite`, a caller who already asked gets their waiting request back, with its first message and time. Under `invite`, one who hasn't asked is refused (`JoinClosed`). A member gets their membership. A `message` is 2,000 graphemes at most. A group not here fails `GroupNotFound`, and a switched-off one `RepoDeactivated` |
| `GET org.atgrp.internal.getJoinRequest` | shows the caller's own request to join while it waits |
| `POST org.atgrp.cancelJoinRequest` | withdraws that request (`GroupNotFound`, `JoinRequestNotFound`) |
| `GET org.atgrp.listJoinRequests` | lists the waiting requests, newest first, for those who admit people. A page is 50 by default, 100 at most (`InvalidCursor`) |
@@ -143,6 +143,12 @@ The group's permission sets give these, with what else each writes:
| `org.atgrp.authModerate` | `mod.read`, `mod.resolve`, `eject` | labels in `meta` and `members` only, so no `label` · the moderation queue and `getModSubjectBlob` |
| `org.atgrp.authManageAdmin` | all of the above, and `group.configure` | the config, labeler and roles · `manage=update` on `meta` and `members` |
A new group has two roles. `member` is everyone's. The founder's `admin`
holds `include:org.atgrp.authManageAdmin`,
`space:*?collection=com.atproto.label.record`, `space:*?manage=update`,
`space:*?manage=create&manage=delete`, `space:*?collection=*` and
`repo:*`, and may assign every role (`*`).
`org.atgrp.authParticipate` is for a person's own session at their PDS,
never a group's. It reads `meta`, writes the person's own confirmation
in `members`, makes their inbox, and calls the methods a person calls
@@ -180,7 +186,7 @@ each, so it answers the space alpha's methods:
| Method | What it does |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST com.atproto.space.authorizeSpaceSync` | gives a credential to read a space, bound to `credentialKey`, with the space's revision (`spaceRev`). It gives one to a user it lets in (`delegationToken`), or to anyone for a space open to all. With `notify`, it registers an endpoint, once the endpoint confirms, to hear of changes until the credential lapses. The endpoint is https (http while the host is), its token 512 bytes at most, and its confirmation is read to 4 KiB within 10 seconds (`SpaceDeleted`, `RepoDeactivated`, `InvalidDelegationToken`, `RegistrationNotConfirmed`) |
| `POST com.atproto.space.authorizeSpaceSync` | gives a credential to read a space, bound to `credentialKey`, with the space's revision (`spaceRev`). It gives one to a user it lets in (`delegationToken`), or to anyone for a space open to all. With `notify`, it registers an endpoint, once the endpoint confirms, to hear of changes until the credential lapses. A refusal also withdraws any registration of the `notify` it names. The endpoint is https (http while the host is), its token 512 bytes at most, and its confirmation is read to 4 KiB within 10 seconds (`SpaceDeleted`, `RepoDeactivated`, `InvalidDelegationToken`, `RegistrationNotConfirmed`) |
| `POST com.atproto.space.notifyRepoUpdate` | hears about a member's write in a space, by service auth from the writer. A `repoRev` more than 5 minutes ahead fails `FutureRev` |
| `GET com.atproto.space.listWriters` | lists the space's writer set in the order of its revisions, each a `repoWrite` or a `repoRemoved`. A page holds up to 1000 (100 by default), and `cursor` is the last one's `spaceRev` |
| `POST com.atproto.space.notifyCredentialsRevoked` | hears from a space's authority that credentials no longer hold, from that authority alone, for a repo here, 1 to 100 at a time |
@@ -215,6 +221,23 @@ The host is each group's OAuth server ([signing in](../design/signing-in.md)):
| `POST /oauth/par`, `GET /oauth/authorize`, `POST /oauth/token`, `POST /oauth/revoke` | atproto OAuth's endpoints. `par` takes only scopes the client's metadata declares, `atproto` among them, and all it declares when `scope` is left out. `authorize` sends the browser to the console to approve, and answers a plain 400 page for a request that's unknown, lapsed or another client's. `token` answers the approving member's DID as `member` beside the group's as `sub`. A refresh token works once, and using it again fails `invalid_grant` while the grant goes on. `revoke` ends the grant of either token, and what it bought of the group's spaces, and answers the same whether it found one or not |
| `GET /img/app?id=<client_id>` | serves an app's logo, the `logo_uri` of its client metadata, so a reader's browser never asks the app's server. It serves one only on the client id's own origin, over https, and only a PNG, JPEG, GIF or WebP image of at most 256 KiB, by its bytes, never SVG. It keeps each for 10 minutes, 100 apps' at most, and answers 404 for anything else |
The host takes a client by its metadata:
- A native app on the same machine may use the loopback client id
`http://localhost`. An http redirect to `127.0.0.1` or `[::1]` may be
registered without its port, and then matches whatever port the app
listens on.
- A native app is a public client (`token_endpoint_auth_method: none`).
- A confidential client signs its client assertion with a key from its
metadata's `jwks` or its `jwks_uri`. A key not among the kept set has
the set fetched once more.
- A client keeps authenticating the same way, with the same key, for
the grant's life.
- A DPoP proof is ES256 or ES256K and carries the host's nonce
(`use_dpop_nonce` otherwise). A proof to a resource carries `ath`, the
hash of its access token, and one to the OAuth endpoints carries
none. A proof is good once.
| Method | What it does |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST org.atgrp.internal.provisionGroup` | lets an app that `PROVISIONING_CLIENTS` names start a group for a person, and signs the app in to it. It takes `metaPublicRead` as `createGroup` does. The app sends its `clientId`, a client assertion if it's confidential, a DPoP proof and a `scope`, which must hold `atproto` and only scopes its metadata declares (`UntrustedApp`, `InvalidScope`). It answers `did`, `meta`, `members` and `session`, a token response narrowed to the founder's roles. The session is an ordinary grant: it refreshes at `/oauth/token`, lasts as an OAuth grant does, and shows in `listGroupTokens`. An OAuth failure comes back named by its OAuth code (`invalid_client`, `invalid_dpop_proof`, `use_dpop_nonce`, …) |
@@ -225,7 +248,7 @@ The host is each group's OAuth server ([signing in](../design/signing-in.md)):
| `GET org.atgrp.internal.listGroupTokens` | lists the grants in force, for a member with `group.configure`, and the latest 20 entries of the group's [activity log](#the-activity-log), each with the handle of whoever let it in or acted. Each app comes as its client metadata names it, where that can be read (`client`: name, home page, logo). A write also comes in its parts (`write`: operation, collection, key, space), with what its kind of record is when that's another app's lexicon the host can read (`write.description`), and with whom it's about (`subject`). Making, changing or ending a space comes as `space`: the space, the operation, and `publicRead` when the change opened it to anyone (`true`) or closed it to those its policy names (`false`) |
| `POST org.atgrp.internal.revokeGroupToken` | signs one app out, for a member with `group.configure` (`NotFound` for another group's grant or an unknown one) |
| `POST org.atgrp.internal.createAppPassword` | makes an app password for the group, for an app that signs in with one ([app passwords](#app-passwords)) |
| `GET org.atgrp.internal.listAppPasswords` | lists the group's app passwords, each with its owner's handle and when it was last used. A member with `group.configure` sees every one, and anyone else their own. It never shows the passwords |
| `GET org.atgrp.internal.listAppPasswords` | lists the group's app passwords, each with its owner's handle and when it was last used. A member with `group.configure` sees every one. Anyone else sees their own, if their roles hold `repo:*` (`Forbidden` otherwise). It never shows the passwords |
| `POST org.atgrp.internal.revokeAppPassword` | revokes one, and signs out its apps, for its maker or a member with `group.configure` (`NotFound`) |
An app signed in this way, or with an app password, uses these as the
@@ -247,8 +270,25 @@ group:
A group's about record and config, in `meta`, and its rules and roles,
in `members`, change only this way. An app writes the records as the
group, and the host keeps each one only as the rules allow
([groups](../design/groups.md#changing-its-about-record-rules-and-pictures)).
group, and the host checks each one beyond its lexicon:
- `meta` takes only `org.atgrp.about`, `org.atgrp.config` and labels,
and `members` only `org.atgrp.rule`, `org.atgrp.labeler`,
`org.atgrp.role`, `org.atgrp.membership` and labels. Any other
collection there is `Forbidden`.
- The about record, config and labeler are kept at `self` and never
deleted (`InvalidRequest`).
- The about record's `displayName` is more than spaces, and its
`website` an http or https address. Its `avatar` must be one of the
group's own uploads, a PNG, JPEG or WebP image, with the `mimeType`
and `size` the host kept at upload.
- The config names a join policy the host knows.
- A rule is kept at a TID, so a label citing it keeps its URI, and has a
`title` that's more than spaces.
Rules are shown by `order`, lowest first, then by when they were
written. A file is removed once no record in the group's repos
references it.
### Proxying
@@ -324,6 +364,7 @@ latest 20 entries.
| an OAuth grant | 14 days for a public client and 90 days for a confidential one, unless refreshed. Each refresh starts it again |
| a group token (`getGroupAuth`) | 15 minutes, never refreshed |
| an app password's access token, and its session | 2 hours, and 90 days unless refreshed |
| a console sign-in under way | 15 minutes |
| the console's cookie | 30 days |
| an account's session while it moves here | 24 hours at most |
| a DPoP proof | 60 seconds old at most, with 10 seconds' skew. The nonce changes every 3 minutes, and the one either side is taken too |
@@ -358,8 +399,8 @@ Its tools are in [MCP tools](mcp.md).
| `POST org.atgrp.mod.submitReport` | reports a member, a record in one of the group's spaces here, or a member's record in their public repo: `subject` is an account's DID or a record's URI, with an optional `cid`. The reporter must be able to read its space (the members space for a member or their public record), and the group's labeler must take reports of its kind and reason. `reasonType` is one of the `org.atgrp.mod.defs#reason*` tokens (`reasonSpam`, `reasonViolation`, `reasonMisleading`, `reasonNsfw`, `reasonRude`, `reasonOther`), and a `rule` it cites is a rule in the members space. A reason the labeler doesn't take is `InvalidRequest`. The host doesn't check that a reported record exists or that its `cid` matches. It answers the report's `eventId` and `createdAt` (`GroupNotFound`, `InvalidSubject`) |
| `POST org.atgrp.mod.submitAppeal` | appeals a label or an ejection on the caller's own account or record, with an optional `note`, and reopens the subject. It takes an appeal from someone who has left the group too. It answers the appeal's `eventId` and `createdAt` (`GroupNotFound`, `InvalidSubject` for a subject that isn't the caller's, `NotAppealable` for one with no live label or ejection) |
| `GET org.atgrp.mod.querySelfHistory` | lists what the group did to the caller's account and records, or to one `subject` of theirs, newest first unless `sort` is `oldest`. It leaves out reports, tags, notes and who acted, and works for former members (`GroupNotFound`, `InvalidSubject`, `InvalidCursor`) |
| `GET org.atgrp.mod.querySubjects` | lists the moderation queue: every status unless `status` is `open` or `resolved`, and only subjects with any of `tags` when given. `sort` is `oldest` (the default) or `newest` by when the subject entered the queue, or `updated`, the latest changed first (`InvalidCursor`) |
| `GET org.atgrp.mod.querySubjectHistory` | lists a subject's events (`reportEvent`, `appealEvent`, `statusEvent`, `tagEvent`, `labelEvent`, `ejectEvent`), newest first unless `sort` is `oldest`, a page at a time. With a `cid`, it lists those about that version. For a record in one of the group's spaces that the caller may read, it also answers the `record` as the host's index holds it, with `takenDown` true if the group has taken that version down (`InvalidSubject`, `InvalidCursor`) |
| `GET org.atgrp.mod.querySubjects` | lists the moderation queue: every status unless `status` is `open` or `resolved`, and only subjects with any of `tags` when given. `sort` is `oldest` (the default) or `newest` by when the subject entered the queue, or `updated`, the latest changed first (`InvalidCursor`). Each subject comes with its account as `actor` and its `reportCount` |
| `GET org.atgrp.mod.querySubjectHistory` | lists a subject's events (`reportEvent`, `appealEvent`, `statusEvent`, `tagEvent`, `labelEvent`, `ejectEvent`), newest first unless `sort` is `oldest`, a page at a time. Each event names the version it's about (`cid`), and who acted as `createdBy` (a DID) and `creator`. With a `cid`, it lists those about that version. For a record in one of the group's spaces that the caller may read, it also answers the `record` as the host's index holds it, with `takenDown` true if the group has taken that version down (`InvalidSubject`, `InvalidCursor`) |
| `GET org.atgrp.internal.getModSubjectBlob` | serves a file the record `subject` holds, by its `cid`, to someone with `mod.read` whom the record's space lets read it, even if the group has taken the record down. A file the record doesn't hold, or a record the caller can't read there, fails with `NotFound` |
| `POST org.atgrp.mod.updateSubject` | changes a subject in the queue: its `status` (`open` or `resolved`), a `note`, and its tags (`addTags`, `removeTags`, lowercase letters and `-`, 128 characters at most, 25 at most each). What it leaves out stays as it is. It answers the subject (`InvalidSubject`, `SubjectNotFound`) |
| `POST org.atgrp.internal.putLabelDefinition` | defines or changes one of the group's own labels (lowercase letters and hyphens) in its labeler, for someone with `group.configure`. Its name (64 graphemes at most) and description (2,000) are in `lang` (`en` unless given), and replace only those in that language. The label is 100 characters at most. Unless asked, `severity` is `inform`, `blurs` is `none` and `defaultSetting` is `warn`, and `adultOnly` is set only when true. It answers the definition, and `getGroup` answers them as `labels` |
@@ -371,6 +412,12 @@ characters at most (20,000 bytes). Reports and appeals share a limit of
([limits](../design/limits.md)). The queue's lists answer 50 a page by
default and 100 at most, and an unknown `sort` is `InvalidRequest`.
The group's labeler decides what reports it takes. Its `reasonTypes`
lists the reasons, its `subjectTypes` `account` or `record`, and its
`subjectCollections` the collections of records. A field left out takes
anything. A member's record in their public repo counts as a `record` of
its collection.
A label is a `com.atproto.label.record` with `uri`, `val` (128 bytes at
most) and `cts`, and an optional `cid` and `exp`. The host checks only
the shape of its `uri`. It doesn't check that the subject exists, or
@@ -433,15 +480,15 @@ Moving groups between hosts, and accounts here to become groups ([moving](../des
| ---------------------------------------- | ------------------------------------------------------------------ |
| `POST org.atgrp.internal.migratePrepare` | on the host a group leaves, starts the move, while the directory's last operation for the group lists this host's rotation key (`NotController`). It answers service auth the group signs for `destDid` to call `migrateReceive`, good for an hour, the group's handle, address and spaces, and an export token good for an hour. Preparing again replaces the token |
| `GET org.atgrp.internal.migrateExport` | on that host, serves what the destination pulls of the group: the list of its files, one file, and a space's state and repo (`InvalidToken`, `BlobNotFound`) |
| `POST org.atgrp.internal.migrateReceive` | on the destination, takes the group in, switched off, for a founder here (`NotAllowed`), who must hold `group.configure` in the records it brings (`Forbidden`). It pulls from the PDS the group's DID document names, reading a file to `BLOB_UPLOAD_LIMIT`, a repo or space to 256 MiB, and any other answer to 16 MiB. It answers what it took and `recommendedCreds`. It refuses a group already here (`AlreadyHere`), service auth that isn't the group's (`BadServiceJwt`), an address or handle that's taken (`HandleNotAvailable`), and a source that answers with a failure (`SourceUnreadable`) |
| `POST org.atgrp.internal.migrateReceive` | on the destination, takes the group in, switched off, for a founder here (`NotAllowed`), who must hold `group.configure` in the records it brings (`Forbidden`). It pulls from the PDS the group's DID document names, reading a file to `BLOB_UPLOAD_LIMIT`, a repo or space to 256 MiB, and any other answer to 16 MiB. The group's handle here is its old address's first label under `HANDLE_DOMAIN`. A handle on its own domain comes along only while that domain still names the group. It answers what it took and `recommendedCreds`. It refuses a group already here (`AlreadyHere`), service auth that isn't the group's (`BadServiceJwt`), an address or handle that's taken (`HandleNotAvailable`), and a source that answers with a failure (`SourceUnreadable`) |
| `POST org.atgrp.internal.migrateComplete` | on the host it leaves, points its DID at the destination, then switches the group off there and answers `movedTo`. It refuses an ended DID, or one that no longer lists this host's key (`NotController`), and says the directory's words when it refuses the operation (`InvalidOperation`) |
| `POST org.atgrp.internal.migrateActivate` | on the destination, switches it on and answers its `spaces`. Until the DID document names this host and the signing key made here, it fails `NotYet`, so ask again once the directory catches up |
| `GET org.atgrp.internal.checkImport` | shows what moving an account here would make of it: its `handle`, `address`, `label`, whether it `keeps` its handle, its `pds`, and a `refused` reason. For a move under way, it answers `recommendedCreds` too (`NotPlc`) |
| `POST org.atgrp.internal.importAccount` | starts moving an account here, for a founder (`NotAllowed`), never their own account (`SameAccount`), and only a `did:plc` (`NotPlc`). Its address is the label asked for, or its handle's first label made lowercase with dashes, 63 characters at most (`InvalidHandle`, `HandleNotAvailable`). It refuses an account someone else is moving (`AlreadyHere`) |
| `POST org.atgrp.internal.migrateActivate` | on the destination, switches it on and answers how many `spaces` it has. Until the DID document names this host and the signing key made here, it fails `NotYet`, so ask again once the directory catches up. A DID document it can't read is `SourceUnreadable` |
| `GET org.atgrp.internal.checkImport` | shows what moving an account here would make of it: its `handle`, `address`, `label`, whether it `keeps` its handle, its `pds`, and a `refused` reason. The account keeps its handle only if it isn't `handle.invalid`, isn't under `HANDLE_DOMAIN` or a domain its old server gives out (`availableUserDomains`), and still names the account. To whoever is moving the account, it answers `recommendedCreds` too (`NotPlc`) |
| `POST org.atgrp.internal.importAccount` | starts moving an account here, for a founder (`NotAllowed`), never their own account (`SameAccount`), and only a `did:plc` (`NotPlc`). Its address is the label asked for, or else its handle's first label, either made lowercase, each run of other characters a dash, and cut to 63 characters (`InvalidHandle`, `HandleNotAvailable`). The group's about record takes its name and description from the account's `app.bsky.actor.profile`, with the label as the name if it has none. It refuses an account someone else is moving (`AlreadyHere`) |
| `POST org.atgrp.internal.importAccountSpace` | brings over one of its spaces while the move waits, a part at a time: `meta`, then each `blob`, then `repo`. An archive is 100 MiB at most, and a file `BLOB_UPLOAD_LIMIT` (`TooLarge`). It refuses the group's own meta and members spaces (`SpaceReserved`), a space it doesn't own (`NotSpaceOwner`), a bad archive (`InvalidArchive`), and a repo before its space's meta (`NotFound`) |
| `POST org.atgrp.internal.completeImport` | finishes the move with the operation the account's server signed. It must name this host as PDS, the keys made here, this host's rotation key and the handle here (`InvalidOperation`) |
| `GET org.atgrp.internal.getAccountMove` | shows the account the caller signed in to from the console to move |
| `POST org.atgrp.internal.startAccountMove` | starts that move |
| `POST org.atgrp.internal.startAccountMove` | starts that move. An account server whose `describeServer` can't be read stops it |
| `POST org.atgrp.internal.finishAccountMove` | finishes it with the code the account's server emailed (`NotStarted`) |
| `POST org.atgrp.internal.cancelAccountMove` | stops it |
harness/diagrams.mjs+10−3
@@ -1,7 +1,8 @@
// The README's diagrams, drawn with rough.js in Excalidraw's hand, as
// SVG files under docs/diagrams. Each carries its font (Excalifont, under
// the SIL Open Font License) and both its light and dark colours, so it
// reads the same wherever the Markdown is shown.
// the SIL Open Font License, Excalifont-OFL.txt beside this) and both its
// light and dark colours, so it reads the same wherever the Markdown is
// shown.
//
// node harness/diagrams.mjs
//
@@ -206,6 +207,12 @@ ${els.join('\n')}
api.text(592, 374, "signs the group's", 'muted', 16, 'start');
api.text(592, 392, 'DID changes', 'muted', 16, 'start');
api.text(440, 504, 'members keep their own accounts, anywhere: the group lives on the host', 'ink', 18);
api.text(
440,
504,
'members keep their own accounts, anywhere: the group lives on the host',
'ink',
18
);
d.write();
}
harness/Excalifont-OFL.txtnew+49−0
@@ -0,0 +1,49 @@
Copyright (c) 2024 by Excalidraw.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
SIL OPEN FONT LICENSE
Version 1.1 - 26 February 2007
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.