OAuth: access tokens on every method, and what scopes allow
An OAuth access token (OAuth: the authorization server) is taken by every method that takes a
token, with the DPoP scheme and a DPoP proof of the call, and allows what
its session’s scope allows. This page says which methods take one, how it is
checked there, and what each method needs of the scope. How the token is
issued, its proof and nonces are in OAuth: the authorization server; password
sessions and the Authorization header’s form are in
Sessions.
What is not served yet: OAuth tokens through the MCP tools and the CLI
(Commands: every method as an MCP tool and a CLI command), which take only Bearer tokens. importRepo needs
account:repo and deactivateAccount account:status, each to manage
(the methods’ table, below). Calls for other services
(Proxying, service auth and preferences) need rpc: permissions (“Proxied calls”, below); the space
methods (Spaces) need space: permissions (“Spaces”, below).
Sources
Section titled “Sources”This section is informative.
| File | Description | Licence |
|---|---|---|
| atproto's Permissions spec | atproto’s permissions and their scope strings | CC-BY, atproto/LICENSE.txt |
| atproto's OAuth spec | atproto’s OAuth profile | CC-BY, atproto/LICENSE.txt |
| RFC 9449 | DPoP, §7: the DPoP scheme at a protected resource | IETF Trust (BCP 78) |
| RFC 6750 | bearer token usage, §3: WWW-Authenticate and its errors | IETF Trust |
The rules below that those leave open are the reference’s, probed: which methods take a token and when they check it, what each needs, and the words of a refusal.
Which methods take a token
Section titled “Which methods take a token”The Authorization header is read as Sessions says: two words, the
scheme matched without regard to case, Bearer, Basic or DPoP, else
400 InvalidToken, wherever a method reads it. The methods are of five
kinds:
| Kind | Methods | With Authorization: DPoP … |
|---|---|---|
| take no token | describeServer, createSession, resolveHandle, repo.getRecord, listRecords, describeRepo, listRepos, getRepoStatus, createInviteCode, createInviteCodes, requestPasswordReset, resetPassword, deleteAccount, updateSubjectStatus, getSubjectStatus | the header is not read as a token: any Authorization and DPoP headers, of any form, are as none, and the answer carries no DPoP-Nonce (the invite methods’ and the admin’s methods’ Basic header is the admin’s, Limits and Account lifecycle, which answer a DPoP one as they say) |
| createAccount | createAccount | 401 AuthenticationRequired, whatever the token and proof, before the input is checked, with no DPoP-Nonce; but a header that is not two words, DPoP alone or DPoP a b, is 400 InvalidToken first, as Sessions says of any header’s form |
| take a token optionally | sync.getRepo, getLatestCommit, sync.getRecord, getBlocks, listBlobs, getBlob | after the parameters are checked, the token and proof are checked as below; a good one answers as its account’s own token does (Account lifecycle): of the repository’s account, as if it were active, and of another account, as no token does |
| need a token | getSession, getRecommendedDidCredentials, updateHandle, uploadBlob, createRecord, putRecord, deleteRecord, applyWrites, createAppPassword, listAppPasswords, revokeAppPassword, getAccountInviteCodes, requestEmailConfirmation, confirmEmail, requestEmailUpdate, updateEmail, checkAccountStatus, deactivateAccount, activateAccount, requestAccountDelete; of Moving an account between servers, importRepo, listMissingBlobs, submitPlcOperation, requestPlcOperationSignature, signPlcOperation; and of Proxying, service auth and preferences, getServiceAuth, getPreferences, putPreferences, getProfile, getProfiles, getTimeline, getAuthorFeed, getActorLikes, getPostThread, getFeed, registerPush, unregisterPush, and every call the server forwards | the token and proof are checked as below, then what the method needs of the scope; a forwarded call’s once what Proxying, service auth and preferences checks before its token passes (its HTTP method, a method never forwarded, and its target), so that one refused for those is answered as with no token, with no DPoP-Nonce |
| take a refresh token | refreshSession, deleteSession | 401 AuthMissing, as Sessions says, with no DPoP-Nonce |
The space methods (Spaces) that take an account’s access token take
an OAuth access token too, as methods that need a token do (“Spaces”,
below, says which, and what each needs). Those that take service auth, a
delegation token or a space credential alone (notifyRepoUpdate,
listWriters, authorizeSpaceSync, notifyCredentialsRevoked) are none
of these kinds: a DPoP call’s token is not checked as below, and the
method refuses it as a token the server did not give out.
With Bearer, the methods that take a token optionally take a session’s
accessJwt as Blobs says getBlob does: one the server gave out, of
any account, is as none, and one it did not 400 InvalidToken, after the
parameters are checked. An OAuth access token sent as Bearer is not one
the server gave out as a bearer token: 400 InvalidToken, on every method
that checks a Bearer token (RFC 9449 §7.2).
The token and its proof
Section titled “The token and its proof”A method that takes a token checks an Authorization: DPoP <access token>
call as OAuth: the authorization server says getSession does (“OAuth tokens on XRPC”), with
htm the call’s HTTP method and htu the issuer’s origin and the path
/xrpc/<method>, <method> as the request’s path spells it: a method
named in another case (/xrpc/COM.ATPROTO.SERVER.GETSESSION) is proved with
that path, and a proof whose htu spells it as the lexicon does is 401 invalid_dpop_proof. A query in the request or in htu is not compared. The
answers are those of OAuth: the authorization server: 401 invalid_dpop_proof, 401 use_dpop_nonce or 401 invalid_token, as XRPC errors with
WWW-Authenticate: DPoP algs="…", error="<error>". A proof that passes
the checks of OAuth: the authorization server “DPoP” is spent, whatever the call answers after.
When. A query’s parameters are checked first: a call refused for them is
refused as without a token, and its answer carries no DPoP-Nonce. A
procedure’s token and proof are checked before its input. So a
createRecord with no collection and a proof without a nonce is 401 use_dpop_nonce, and a sync.getRepo with a did that is not a DID and
the same proof is 400 InvalidRequest.
Headers. Every answer to a call with the DPoP scheme, to a method
that needs a token or takes one optionally, carries DPoP-Nonce (the
nonce of OAuth: the authorization server), unless the call was refused before its token was
looked at: for the form of its Authorization header, for the HTTP method
(The PDS: accounts and their records), or for a query’s parameters. Each answer that carries
DPoP-Nonce also carries Access-Control-Expose-Headers naming
DPoP-Nonce, and WWW-Authenticate too when the answer has that header,
so a browser’s script may read them (RFC 9449 §7.1). Only the 401
answers of the token and proof carry WWW-Authenticate: a 403 does not.
Once the token and proof pass, the call is made for the session’s account, as with that account’s password session, but for what the scope allows. With rate limits on, it counts as that session’s call would, by the account’s DID, in the same buckets; a call refused for its token, its proof, or a scope checked with the token costs nothing (Limits, “OAuth access tokens”).
What a scope allows
Section titled “What a scope allows”A session’s scope is its scope tokens as OAuth: the authorization server keeps them (at PAR,
narrowed at consent), its include: scopes replaced by their sets’
permissions (OAuth: permission sets, “The token’s scope”):
atproto, the transition: scopes, and the permissions that parse. An
include: scope itself allows nothing. Every token has atproto, which
alone allows what
every method needs of a token and nothing more. Each permission allows:
repo(collectionset C,actionset A, by default all three): a write of action a to collection c when a is in A, and c is in C or C has*. Collections are compared as written, case and all:repo:com.example.noteallows nothing ofcom.Example.note.blob(acceptset): a media type m when m is a type and subtype, that is: one/, something before it and after it, no space and no*; a space is U+0020 alone, soimage/p<tab>ngis a type and subtype thatblob:image/*allows, andimage/png<tab>(image/png<tab>; q=1) too; and some accept value is*/*, or m itself, or<type>/*with m starting<type>/. Compared as written, case and all:blob:image/*allowsimage/pngand notIMAGE/PNG, and noblobpermission allows*/*,image/*ora/b/cas a media type.identity(attr): the handle, whenattrishandleor*.account(attr,actionset, by defaultread): reading or managing that attribute;manageallows reading too.account:emailandaccount?attr=emailallow reading the email.rpc(lxmset, oneaud): a call of method l to service s when somelxmis l or*, andaudis s or*. Both are compared as written:audis a DID and a#service id, percent-decoded as the scope’s parameters are.
And the transitional scopes (atproto's Permissions spec):
-
transition:genericallows everyrepoandblobcheck, whatever the collection or media type (*/*anda/b/ctoo), everyrpccheck of a method whose name does not start withchat.bsky.compared without regard to case,*among them, whatever the service, and nothing ofidentityoraccount. So it allows nothing ofChat.Bsky.convo.sendMessageorCHAT.BSKY.convo.getLog.Note: a service may read a method’s name without regard to case, as the server itself does (Proxying, service auth and preferences), and the case a client chose must not change what its scope allows.
-
transition:chat.bskyallows everyrpccheck of a method whose name starts withchat.bsky.in any case, whatever the service (the AppView’s#bsky_appviewas well as a chat service), with or withouttransition:generic; and nothing else, not*. -
transition:emailallows reading the email.
What each method needs
Section titled “What each method needs”| Method | Needs | Checked |
|---|---|---|
getSession | nothing; but answers email, emailConfirmed and emailAuthFactor only if the scope allows reading the email (OAuth: the authorization server) | |
getRecommendedDidCredentials, and the methods that take a token optionally | nothing | |
updateHandle | the handle (identity:handle) | after the token, before the input |
uploadBlob | blob of the call’s media type, as Blobs reads it from Content-Type | after the Content-Type check, before the size |
createRecord | repo create of the collection | after the input and repo checks (The PDS: accounts and their records), before anything of the record, its key, validate or the swaps: a record whose $type is not its collection, a key that exists, a swapCommit that is not the head |
putRecord | repo create, then update, of the collection, whether or not the record exists | as createRecord |
deleteRecord | repo delete of the collection, whether or not the record exists | as createRecord |
applyWrites | for each collection its creates name, in the order first named, repo create; then for its updates’ collections update; then for its deletes’ delete | as createRecord, before anything of each write: an update of a record that does not exist is the scope’s refusal, not 500 |
createAppPassword, listAppPasswords, revokeAppPassword, getAccountInviteCodes, requestAccountDelete | never allowed to an OAuth token: 403 Forbidden, OAuth credentials are not supported for this endpoint | after the token, before the input |
requestEmailConfirmation, confirmEmail | managing the email (account:email?action=manage); transition:email only reads it | after the token, before the input |
requestEmailUpdate, updateEmail | never allowed to an OAuth token, whatever its scope: 403 Forbidden, Use the account manager interface to update email address associated with an account | after the token, before the input |
checkAccountStatus | nothing | |
deactivateAccount | managing the account’s status (account:status?action=manage); it then ends every OAuth session of the account and deletes its app passwords (Account lifecycle) | after the token, before the input |
activateAccount | never allowed to an OAuth token: 403 Forbidden, Account reactivation is not available with OAuth credentials. Sign in to your account management page to reactivate. | after the token, before the input |
importRepo | managing the account’s repository (account:repo?action=manage) | after the token, before the Content-Type |
listMissingBlobs | nothing | |
submitPlcOperation, requestPlcOperationSignature, signPlcOperation | the whole identity (identity:*) | after the token, before the input |
| a call forwarded (Proxying, service auth and preferences) | rpc of the method, as its path names it, to the service its atproto-proxy header names, or <AppView DID>#bsky_appview without one | after the token, before the body’s size and the privileged methods’ check |
getServiceAuth | rpc of its lxm, or * without one, to its aud, as given | after the parameters and the token, before aud’s form, exp and the privileged and never-forwarded methods’ checks |
getPreferences, putPreferences, getProfile, getProfiles, getTimeline, getAuthorFeed, getActorLikes, getPostThread | rpc of the method to the service its atproto-proxy header names, as given, or <AppView DID>#bsky_appview | after the parameters and the token, before the input and the header’s form |
getFeed | as those, of getFeed, then of getFeedSkeleton, to the same service | as those |
registerPush, unregisterPush | rpc of the method to <serviceDid>#bsky_notif | after the token and the input |
So with only atproto, a createRecord to another account’s repository is
401 AuthenticationRequired, one to a repository no account has 403 AccountNotFound, and one whose input is wrong 400 InvalidRequest; one
whose record’s $type is not its collection is the scope’s refusal.
uploadBlob without a Content-Type is 400 InvalidRequest whatever the
scope, and one of more than 5 MiB with a scope that allows it 413 PayloadTooLarge.
The refusal. A call the scope does not allow is 403:
{"error": "ScopeMissingError", "message": "Missing required scope \"<scope>\""}where <scope> is the first permission missing, in the order above, as a
scope string:
repo:<collection>?action=<create|update|delete>;identity:handle;account:<attr>?action=manage, asaccount:email?action=manageandaccount:status?action=manage;rpc:<lxm>?aud=<aud>, aud percent-encoded as m below, but for a space, which is+:aud=did:plc:…#a bisaud=did:plc:…%23a+b;blob:<m>, where m is the media type in lower case, percent-encoded as JavaScript’sencodeURIComponentencodes it, and then with%3A,%2F,%2B,%2C,%40and%25turned back to:,/,+,,,@and%. SoIMAGE/PNGisblob:image/png, thoughblob:image/pngwould not allow it;text/plain ;q=1, whose media type istext/plain(Blobs), isblob:text/plain%20;im<tab>age/pngisblob:im%09age/png;image/svg+xmlisblob:image/svg+xml; and*/*isblob:*/*. Each byte of theContent-Typeheader is the character of that value (Latin-1), not part of a UTF-8 sequence, and is lowered as Unicode lowers it, which in that range isA–Z,À–ÖandØ–Þeach to the character 0x20 after it; the result is encoded as UTF-8. So a byte 0xC9 (É) is%C3%A9, andÉsent as UTF-8, the bytes 0xC3 0x89, is%C3%A3%C2%89.
Proxied calls
Section titled “Proxied calls”A call for another service (Proxying, service auth and preferences) with an OAuth token is made as the
account’s: the service token the server sends is the account’s, whatever
the session. The scope is asked for rpc where the table above says, and
in place of the privileged methods’ check: an OAuth session may call a
chat.bsky. method, forwarded or in getServiceAuth’s lxm, if its scope
allows it (transition:chat.bsky, alone or with transition:generic, to
any service, the AppView too; or an rpc permission naming it), and
com.atproto.server.createAccount likewise; transition:generic alone
allows no chat.bsky. method. putPreferences and
getPreferences take an OAuth session as one of another scope than
com.atproto.access: it neither reads nor writes personalDetailsPref.
Each answer to a call whose token and proof passed carries DPoP-Nonce, a
service’s answer passed on too.
Spaces
Section titled “Spaces”space: permissions are the spaces proposal’s (spaces/proposal.md,
“OAuth scopes”), as the pinned spaces alpha of the reference
(Spaces) serves them.
Which parse. A space permission parses, and is kept at PAR as
OAuth: the authorization server keeps every permission that parses, when its parameters are
these, each given in one place only, the positional one or as itself, and
each with a value allowed:
| Parameter | Many | Default | Values |
|---|---|---|---|
spaceType (positional, required) | no | an NSID, or * | |
authority | no | self | a DID, self, or * |
skey | no | * | a record key (atproto's Record Key spec), or * |
collection | yes | none | an NSID, or * |
action | yes | read, create, update, delete | read_self, read, create, update, delete |
manage | yes | none | create, update, delete |
So space:com.example.forum, space:*?authority=*&action=read,
space?spaceType=com.example.forum&manage=create and
space:com.example.forum?authority=did:plc:abc&skey=main&collection=com.example.post&action=create
are kept, and space, space:forum, space:com.example.forum?authority=me,
space:com.example.forum?action=write, space:com.example.forum?spaceType=com.example.forum,
space:com.example.forum?authority=*&authority=self and
space:com.example.forum?other=1 are dropped.
Space type declarations. A space type’s NSID names a declaration:
a lexicon document whose defs.main has type: "space", a key (a
string), and collections, an array of NSIDs, none *, which may be
empty (spaces/proposal.md, “Space type declarations”). It is resolved
as a permission set is (OAuth: permission sets, “Resolving a set”,
steps 1 to 4, and its caching, shared with the sets’), and is a
declaration when its document is as step 5 says but for defs.main:
type space, with key and collections as said. A document whose
defs.main.type is something else is not a declaration; one of type
space with no key, or whose collections is missing or not as said,
does not resolve. The types are those the scope’s space: tokens name,
and those of the space permissions its sets grant
(OAuth: permission sets, “What a set grants”), each distinct one
once, but *.
- At PAR, no declaration is resolved.
- The authorization page resolves each type’s declaration, once the sets
resolve (OAuth: permission sets). One that does not resolve, or is
not a declaration, ends the request, and the page sends the browser
back to the client as it does a request that can no longer be used
(OAuth: the authorization server, “The authorization page”), with
error=invalid_scopeanderror_descriptionUnable to retrieve space declarations; the request’s page loaded again is then the error page of a request that is not there. - At the code grant each is resolved again, after the sets; one that does
not resolve or is not a declaration is
400 invalid_request.
On the authorization page. When the scope, with what its sets grant,
has a space permission, the page’s __authorizeData (OAuth: the authorization server, “The
authorization page”) has, as the alpha’s has:
spaces: an object with a key for each type above, its value that declaration’sdefs.mainas published, every field kept;spaceHandles: an object with a key for each DID that aspace:token of the scope itself (not one a set grants, as the alpha) names as itsauthority, each once, whose handle verifies, its value that handle as the document writes it, its case kept. A handle verifies when the DID resolves (Identity), its document’s firstalsoKnownAsentry that beginsat://is a handle after it, and that handle resolves to the same DID as Identity (“Resolving a handle”) resolves an external one, by DNS and HTTPS, even the handle of an account here. A DID whose handle does not verify is left out, and does not end the request. With none,{}.
Without a space permission it has neither. The consent view shows the
scope’s space: tokens, and the space permissions of each set, from
these (OAuth: what the authorization pages show, “What it asks for”).
The token’s scope. At the code grant, once the sets are expanded
(OAuth: permission sets, “The token’s scope”), each space: token of
the expansion, in place, is rewritten:
- one with no
collection, of aspaceTypethat is not*, whose declaration’scollectionsis not empty, gets those collections; - then one whose
authorityisself, given or by default, gets the account’s DID.
A token neither step changes is kept as it was given. One either changes
is written again: space:<spaceType>, then, after ? and joined by &,
authority=<a> unless it is self, skey=<k> unless it is *, each
collection as collection=<c> (several: each once, sorted, or * alone
if one is *), each action as action=<x> in the order of the table’s
values unless they are the default four, and each manage=<m> in the
order create, update, delete. The type is percent-encoded as
JavaScript’s encodeURIComponent encodes it, and the parameters as a URL’s
form-encoded query (application/x-www-form-urlencoded: all but letters,
digits and *-._ percent-encoded, a space +); in both, %3A, %2F,
%2B, %2C, %40 and %25 are then turned back to :, /, +, ,,
@ and %. So space:com.example.forum, with a declaration of
[com.example.reply, com.example.thread], is
space:com.example.forum?authority=did:plc:…&collection=com.example.reply&collection=com.example.thread.
That is the token answer’s scope, and what the session’s tokens allow.
At each refresh the scope is expanded and rewritten again, the
declarations resolved again; one that does not resolve leaves the
session’s last expansion as it was, as a set does.
What it allows. A space operation is a space, its authority, type and
key, and one of: reading the whole space (read), reading the caller’s
own repo in it (read_self), a write of a collection (create, update
or delete), or managing the space (manage create, update or
delete). A space permission allows it when its spaceType,
authority and skey are each the operation’s or * (an authority of
self matches nothing), and:
readwhen its actions haveread;read_selfwhen they havereadorread_self; whatever its collections;- a write when its actions have the write’s action and its collections
have the collection or
*: one with no collections allows no write; - managing when its
managehas the operation; its actions and collections are not asked.
transition:generic and every other permission allow nothing of a space.
A password session, and an app password’s, is allowed every operation.
What each method needs. With an OAuth token, each method asks the scope for the space its input names, and for these, at these points:
| Method | Needs | Checked |
|---|---|---|
createSpace | manage create, of the space under the caller’s DID with the input’s spaceType, and skey (or the one made for it) | after the input, before the policy |
updateSpace, removeWriter, putMembers, removeMembers | manage update | after the input, before the caller is checked as the space’s authority |
deleteSpace | manage delete | as updateSpace |
importSpaceMeta | manage create, then manage update, of the archive’s space | once the archive is read, before the caller is checked as its authority |
getSpace, exportSpaceMeta, listMembers | read_self | after the parameters, before the caller is checked as the space’s authority |
getDelegationToken | read | after the parameters |
createRecord, putRecord, deleteRecord | create or delete of the collection; for putRecord, update if the record is there, else create | after the input’s fields, repo and the collection’s check (The space repo), before the record is checked and the space looked for |
applyWrites | for each write, in order, its action of its collection (update for an update) | once the input is checked, each write’s record too, before the space is looked for |
clearRecords | delete of each collection the caller’s repo in the space holds a record of, but those kept (The space repo), in the order of their names | as applyWrites |
importRepo | create of each collection the archive’s records name, in the order first named | once the archive is read and found the caller’s repo’s, before the space is looked for |
getRecord, listRecords, getLatestCommit, listRepoOps, getRepo, getBlob, listBlobs | read_self | after the caller’s repo is checked as its own (RepoNotFound first) |
listSpaces | read_self of the space whose type is the spaceType given, else *, whose authority is the spaceDid given, else *, and whose key is * | after the parameters |
So an unfiltered listSpaces needs a permission of spaceType * and
authority *. Every other check a method makes of its caller is as with
a password session: an OAuth session is its account’s, and is neither an
app password’s nor a taken-down account’s.
The refusal is 403 ScopeMissingError, as above, naming the first
operation not allowed as a space: scope, written as the token’s scope is:
the space’s type, authority its DID (or *), skey its key unless it
is *; for managing, action=read_self and manage=<m>; for a read,
action=<read or read_self>; for a write, collection=<c> and
action=<a>. So putRecord of com.example.tile in
at://did:plc:abc/space/com.example.workspace/main with no permission for
it is Missing required scope "space:com.example.workspace?authority=did:plc:abc&skey=main&collection=com.example.tile&action=create".
For other slices
Section titled “For other slices”This section is informative.
What a handler is given, once a call’s token has passed: the account’s DID,
and how the call was made: a password session, an app password’s session
(Sessions), or an OAuth session with its scope. A method that needs
some permission asks the scope, as “What a scope allows” and “Spaces” say;
an OAuth scope that does not allow it is the 403 ScopeMissingError above,
naming the scope that would. Password sessions are allowed every
permission; whether an app password’s session is allowed a method is the
method’s page’s to say.
How it is checked
Section titled “How it is checked”harness/checks/oauth-scopes.mjs signs accounts in through OAuth: the authorization server’s
flow with loopback clients whose scopes mix atproto, the transitional
scopes and repo, blob, identity and account permissions, each
request a random part of its client’s, and adds those sessions to the
account’s. Then its steps, among the others of compare.mjs:
- a call with a session’s token: a random method of each kind above,
with the session’s access token and a good proof: writes of the
harness’s collections (
createRecord,putRecord,deleteRecord,applyWrites, with creates, updates and deletes of several collections),uploadBlobwith media types drawn from a list (image/png,TEXT/Plain,*/*,a/b/c, none, …),updateHandlewith a handle that does not parse (so that nothing changes),getSession,getRecommendedDidCredentials, the app password methods andgetAccountInviteCodes, the email and lifecycle methods in forms that leave the account’s state as it is (adeactivateAccountwhosedeleteAfteris not a datetime,checkAccountStatusby status alone), the methods that take a token optionally, the methods that take none, andcreateAccount. - proxied calls:
harness/checks/proxy.mjs’s steps (Proxying, service auth and preferences) draw OAuth sessions too, signed in with loopback clients whose scopes mixtransition:generic,transition:chat.bskyandrpcpermissions of some of the methods and services the steps call, or none; each call is then made withDPoPand a proof, and compared as Proxying, service auth and preferences says, with the nonce,WWW-Authenticate’serrorand aScopeMissingError’smessagetoo. But for achat.bsky.method named in another case (Chat.Bsky.convo.getLog,CHAT.BSKY.x.y) with a scope oftransition:genericand nottransition:chat.bsky: the reference’s check of the prefix minds case, and allows it (probed: itsgetServiceAuthofChat.Bsky.convo.getLogand ofCHAT.BSKY.convo.getLoganswers a token, ofchat.bsky.convo.getLog403 ScopeMissingError). Such a call,getServiceAuthof it and the method forwarded to the chat service, is sent to the server alone, which must answer403 ScopeMissingErrorand send nothing on; a step of its own signs a session oftransition:genericalone in for it. - a call refused: one of those methods with one thing wrong in the
proof (OAuth: the authorization server’s list, and a replay), or in the token (none, a
replaced, revoked or garbage one, the refresh token, a password
session’s, a proof by another key), or in the scheme (
Bearerwith the OAuth token, a header of one or three words,dpopin lower case); and a query whose parameters are wrong, or a procedure whose input is wrong, with a proof without a nonce. - the edges, each every time:
uploadBlobwith a session ofatproto blob:image/*alone and media types with a tab (image/png<tab>; q=1,image/p<tab>ng,im<tab>age/png) and with a byte outside ASCII (0xC9, and 0xC3 0x89), the refusals’messagecompared;createAccountwithAuthorizationDPoPalone,DPoP a b,DPoP abcanddpop abc, no proof, and a handle that does not parse; andgetSessionandgetLatestCommitnamed in another case, with a proof whosehtuis the path as sent and one whosehtuis as the lexicon spells it.
Compared, on both sides: the status; the error; the message of a
ScopeMissingError; whether the answer carries DPoP-Nonce; the error
of WWW-Authenticate; which of DPoP-Nonce and WWW-Authenticate
Access-Control-Expose-Headers names; and a success’s body as The PDS: accounts and their records
compares it (the getRepo and sync.getRecord CAR files by status only).
A write that lands is noted as the other write steps note theirs, so the
repository checks see it.
Not compared:
- Other
messages, andWWW-Authenticate’salgsanderror_description, as OAuth: the authorization server says. Cache-ControlandVaryof answers to calls with a token (the reference sendsprivateandAuthorization), for any scheme.- A
Basicheader on the methods that take a token optionally (the reference answers401 AuthenticationRequired, Sessions the rest400 InvalidToken). - A media type with no
/: the reference looks it up as a file extension (Blobs), and its scope check takespngasimage/png.
The space: permissions are checked in the spaces run (Spaces),
against the pinned alpha, by harness/spaces/scopes.mjs. The run’s
lexicon authority, a PDS of its own on the alpha’s directory, publishes
declarations (one with two collections and a title, one with none, one
of another key), a declaration with no key, one with no
collections, and a document of another type; the server is started
with PDS_LEXICON_AUTHORITY_DID its DID, and the alpha given the same
(OAuth: permission sets, “How it is checked”). Loopback clients
asking for atproto and space: scopes from a list (bare; manage;
authority *, another account’s DID and self given; the positional
as a parameter; read and read_self alone and with manage;
collections outside the declaration, repeated, and *; skey; type
*; two types; transition:generic alone; tokens that do not parse; and
each type that is no declaration, and one with no document) sign in on
both sides through the page’s API; what each step answers is compared:
PAR’s status, the page’s status and where it sends the browser with its
error, the page’s spaces and spaceHandles (each {} when not
there), the page loaded again, and the token answer’s scope, each
account’s DID named alike. With each session’s token, a good proof and a
nonce, the space methods are called on the account’s own spaces (a
personalspace holding a record and a memberspace, made with its
password session), another account’s, and spaces never made: each
createSpace case, getSpace, listSpaces with and without each
filter, putRecord of a record there and of one not, createRecord of
a declared collection, another, a published one, a record of another
type, and in another’s repo and space, deleteRecord of a record there
and not, applyWrites with each action, with a bad write and with none,
the reads of its own repo and another’s, getDelegationToken of its own
space and another’s, putMembers, listMembers, removeMembers,
removeWriter, updateSpace, exportSpaceMeta, importSpaceMeta of
the archive its password session exported, clearRecords and
deleteSpace. Each answer is compared: the status, the error, and a
ScopeMissingError’s message, each account’s DID named alike and a key
the server made as <tid>. The main run, which the latest reference
answers and which keeps no space: permission, asks for none.
Not compared: a success’s body (the spaces run’s other checks hold
them); importRepo with an OAuth token; a declaration changed
during a session; the code grant’s refusal of a declaration that no
longer resolves, as no declaration changes during a run; and a
spaceHandles entry, as no handle of the run’s network resolves by DNS
or HTTPS on either side, so both give {}.