@atproto/pds 0.4.165 → 0.4.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/account-manager/account-manager.js +2 -2
  3. package/dist/account-manager/account-manager.js.map +1 -1
  4. package/dist/account-manager/helpers/account-device.d.ts +4 -4
  5. package/dist/account-manager/helpers/account.d.ts +1 -1
  6. package/dist/account-manager/helpers/auth.d.ts +1 -1
  7. package/dist/account-manager/helpers/auth.d.ts.map +1 -1
  8. package/dist/account-manager/helpers/auth.js +8 -8
  9. package/dist/account-manager/helpers/auth.js.map +1 -1
  10. package/dist/account-manager/helpers/authorization-request.d.ts +1 -1
  11. package/dist/account-manager/helpers/authorization-request.d.ts.map +1 -1
  12. package/dist/account-manager/helpers/authorization-request.js +16 -8
  13. package/dist/account-manager/helpers/authorization-request.js.map +1 -1
  14. package/dist/account-manager/helpers/token.d.ts +65 -65
  15. package/dist/actor-store/preference/reader.d.ts +2 -2
  16. package/dist/actor-store/preference/reader.d.ts.map +1 -1
  17. package/dist/actor-store/preference/reader.js +2 -2
  18. package/dist/actor-store/preference/reader.js.map +1 -1
  19. package/dist/actor-store/preference/transactor.d.ts +2 -2
  20. package/dist/actor-store/preference/transactor.d.ts.map +1 -1
  21. package/dist/actor-store/preference/transactor.js +5 -5
  22. package/dist/actor-store/preference/transactor.js.map +1 -1
  23. package/dist/actor-store/preference/util.d.ts +4 -2
  24. package/dist/actor-store/preference/util.d.ts.map +1 -1
  25. package/dist/actor-store/preference/util.js +9 -8
  26. package/dist/actor-store/preference/util.js.map +1 -1
  27. package/dist/actor-store/record/reader.d.ts +2 -2
  28. package/dist/api/app/bsky/actor/getPreferences.d.ts.map +1 -1
  29. package/dist/api/app/bsky/actor/getPreferences.js +29 -7
  30. package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
  31. package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
  32. package/dist/api/app/bsky/actor/getProfile.js +9 -1
  33. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  34. package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
  35. package/dist/api/app/bsky/actor/getProfiles.js +9 -1
  36. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  37. package/dist/api/app/bsky/actor/putPreferences.d.ts.map +1 -1
  38. package/dist/api/app/bsky/actor/putPreferences.js +30 -8
  39. package/dist/api/app/bsky/actor/putPreferences.js.map +1 -1
  40. package/dist/api/app/bsky/feed/getActorLikes.d.ts.map +1 -1
  41. package/dist/api/app/bsky/feed/getActorLikes.js +9 -1
  42. package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
  43. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  44. package/dist/api/app/bsky/feed/getAuthorFeed.js +9 -1
  45. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  46. package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
  47. package/dist/api/app/bsky/feed/getFeed.js +8 -1
  48. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  49. package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
  50. package/dist/api/app/bsky/feed/getPostThread.js +8 -1
  51. package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
  52. package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
  53. package/dist/api/app/bsky/feed/getTimeline.js +9 -1
  54. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  55. package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
  56. package/dist/api/app/bsky/notification/registerPush.js +16 -4
  57. package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
  58. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.d.ts.map +1 -1
  59. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js +5 -1
  60. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js.map +1 -1
  61. package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts.map +1 -1
  62. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +9 -2
  63. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
  64. package/dist/api/com/atproto/identity/signPlcOperation.d.ts.map +1 -1
  65. package/dist/api/com/atproto/identity/signPlcOperation.js +9 -1
  66. package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
  67. package/dist/api/com/atproto/identity/submitPlcOperation.d.ts.map +1 -1
  68. package/dist/api/com/atproto/identity/submitPlcOperation.js +5 -1
  69. package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
  70. package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
  71. package/dist/api/com/atproto/identity/updateHandle.js +6 -1
  72. package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
  73. package/dist/api/com/atproto/moderation/createReport.d.ts.map +1 -1
  74. package/dist/api/com/atproto/moderation/createReport.js +8 -3
  75. package/dist/api/com/atproto/moderation/createReport.js.map +1 -1
  76. package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
  77. package/dist/api/com/atproto/repo/applyWrites.js +25 -19
  78. package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
  79. package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
  80. package/dist/api/com/atproto/repo/createRecord.js +10 -1
  81. package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
  82. package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
  83. package/dist/api/com/atproto/repo/deleteRecord.js +12 -1
  84. package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
  85. package/dist/api/com/atproto/repo/importRepo.d.ts.map +1 -1
  86. package/dist/api/com/atproto/repo/importRepo.js +7 -2
  87. package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
  88. package/dist/api/com/atproto/repo/listMissingBlobs.d.ts.map +1 -1
  89. package/dist/api/com/atproto/repo/listMissingBlobs.js +6 -2
  90. package/dist/api/com/atproto/repo/listMissingBlobs.js.map +1 -1
  91. package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
  92. package/dist/api/com/atproto/repo/putRecord.js +17 -11
  93. package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
  94. package/dist/api/com/atproto/repo/uploadBlob.d.ts.map +1 -1
  95. package/dist/api/com/atproto/repo/uploadBlob.js +5 -1
  96. package/dist/api/com/atproto/repo/uploadBlob.js.map +1 -1
  97. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  98. package/dist/api/com/atproto/server/activateAccount.js +7 -1
  99. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  100. package/dist/api/com/atproto/server/checkAccountStatus.d.ts.map +1 -1
  101. package/dist/api/com/atproto/server/checkAccountStatus.js +5 -1
  102. package/dist/api/com/atproto/server/checkAccountStatus.js.map +1 -1
  103. package/dist/api/com/atproto/server/confirmEmail.d.ts.map +1 -1
  104. package/dist/api/com/atproto/server/confirmEmail.js +6 -1
  105. package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
  106. package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
  107. package/dist/api/com/atproto/server/createAppPassword.js +7 -1
  108. package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
  109. package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
  110. package/dist/api/com/atproto/server/deactivateAccount.js +9 -2
  111. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  112. package/dist/api/com/atproto/server/deleteSession.d.ts.map +1 -1
  113. package/dist/api/com/atproto/server/deleteSession.js +3 -1
  114. package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
  115. package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts.map +1 -1
  116. package/dist/api/com/atproto/server/getAccountInviteCodes.js +8 -1
  117. package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
  118. package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
  119. package/dist/api/com/atproto/server/getServiceAuth.js +24 -13
  120. package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
  121. package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
  122. package/dist/api/com/atproto/server/getSession.js +12 -19
  123. package/dist/api/com/atproto/server/getSession.js.map +1 -1
  124. package/dist/api/com/atproto/server/listAppPasswords.d.ts.map +1 -1
  125. package/dist/api/com/atproto/server/listAppPasswords.js +6 -1
  126. package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
  127. package/dist/api/com/atproto/server/refreshSession.js +1 -1
  128. package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
  129. package/dist/api/com/atproto/server/requestAccountDelete.d.ts.map +1 -1
  130. package/dist/api/com/atproto/server/requestAccountDelete.js +8 -1
  131. package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
  132. package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts.map +1 -1
  133. package/dist/api/com/atproto/server/requestEmailConfirmation.js +6 -1
  134. package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
  135. package/dist/api/com/atproto/server/requestEmailUpdate.d.ts.map +1 -1
  136. package/dist/api/com/atproto/server/requestEmailUpdate.js +6 -1
  137. package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
  138. package/dist/api/com/atproto/server/revokeAppPassword.d.ts.map +1 -1
  139. package/dist/api/com/atproto/server/revokeAppPassword.js +6 -1
  140. package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
  141. package/dist/api/com/atproto/server/updateEmail.d.ts.map +1 -1
  142. package/dist/api/com/atproto/server/updateEmail.js +8 -1
  143. package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
  144. package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts.map +1 -1
  145. package/dist/api/com/atproto/sync/deprecated/getCheckout.js +7 -2
  146. package/dist/api/com/atproto/sync/deprecated/getCheckout.js.map +1 -1
  147. package/dist/api/com/atproto/sync/deprecated/getHead.d.ts.map +1 -1
  148. package/dist/api/com/atproto/sync/deprecated/getHead.js +7 -2
  149. package/dist/api/com/atproto/sync/deprecated/getHead.js.map +1 -1
  150. package/dist/api/com/atproto/sync/getBlob.d.ts.map +1 -1
  151. package/dist/api/com/atproto/sync/getBlob.js +7 -3
  152. package/dist/api/com/atproto/sync/getBlob.js.map +1 -1
  153. package/dist/api/com/atproto/sync/getBlocks.d.ts.map +1 -1
  154. package/dist/api/com/atproto/sync/getBlocks.js +7 -2
  155. package/dist/api/com/atproto/sync/getBlocks.js.map +1 -1
  156. package/dist/api/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
  157. package/dist/api/com/atproto/sync/getLatestCommit.js +7 -2
  158. package/dist/api/com/atproto/sync/getLatestCommit.js.map +1 -1
  159. package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
  160. package/dist/api/com/atproto/sync/getRecord.js +7 -2
  161. package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
  162. package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
  163. package/dist/api/com/atproto/sync/getRepo.js +7 -3
  164. package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
  165. package/dist/api/com/atproto/sync/listBlobs.d.ts.map +1 -1
  166. package/dist/api/com/atproto/sync/listBlobs.js +7 -3
  167. package/dist/api/com/atproto/sync/listBlobs.js.map +1 -1
  168. package/dist/api/com/atproto/temp/checkSignupQueue.d.ts.map +1 -1
  169. package/dist/api/com/atproto/temp/checkSignupQueue.js +7 -3
  170. package/dist/api/com/atproto/temp/checkSignupQueue.js.map +1 -1
  171. package/dist/auth-output.d.ts +45 -0
  172. package/dist/auth-output.d.ts.map +1 -0
  173. package/dist/auth-output.js +3 -0
  174. package/dist/auth-output.js.map +1 -0
  175. package/dist/auth-scope.d.ts +16 -0
  176. package/dist/auth-scope.d.ts.map +1 -0
  177. package/dist/auth-scope.js +40 -0
  178. package/dist/auth-scope.js.map +1 -0
  179. package/dist/auth-verifier.d.ts +50 -115
  180. package/dist/auth-verifier.d.ts.map +1 -1
  181. package/dist/auth-verifier.js +275 -366
  182. package/dist/auth-verifier.js.map +1 -1
  183. package/dist/config/config.d.ts +2 -1
  184. package/dist/config/config.d.ts.map +1 -1
  185. package/dist/config/config.js +2 -1
  186. package/dist/config/config.js.map +1 -1
  187. package/dist/config/env.d.ts +1 -0
  188. package/dist/config/env.d.ts.map +1 -1
  189. package/dist/config/env.js +3 -1
  190. package/dist/config/env.js.map +1 -1
  191. package/dist/context.d.ts.map +1 -1
  192. package/dist/context.js +5 -5
  193. package/dist/context.js.map +1 -1
  194. package/dist/lexicon/index.d.ts +230 -230
  195. package/dist/lexicon/index.d.ts.map +1 -1
  196. package/dist/lexicon/index.js +687 -687
  197. package/dist/lexicon/index.js.map +1 -1
  198. package/dist/lexicon/lexicons.d.ts +16650 -16650
  199. package/dist/lexicon/lexicons.js +9267 -9267
  200. package/dist/lexicon/lexicons.js.map +1 -1
  201. package/dist/pipethrough.d.ts +5 -3
  202. package/dist/pipethrough.d.ts.map +1 -1
  203. package/dist/pipethrough.js +42 -15
  204. package/dist/pipethrough.js.map +1 -1
  205. package/dist/sequencer/events.d.ts +13 -13
  206. package/dist/util/http.d.ts +7 -0
  207. package/dist/util/http.d.ts.map +1 -0
  208. package/dist/util/http.js +31 -0
  209. package/dist/util/http.js.map +1 -0
  210. package/dist/util/types.d.ts +5 -0
  211. package/dist/util/types.d.ts.map +1 -0
  212. package/dist/util/types.js +3 -0
  213. package/dist/util/types.js.map +1 -0
  214. package/package.json +4 -3
  215. package/src/account-manager/account-manager.ts +1 -1
  216. package/src/account-manager/helpers/auth.ts +1 -1
  217. package/src/account-manager/helpers/authorization-request.ts +8 -4
  218. package/src/actor-store/preference/reader.ts +3 -4
  219. package/src/actor-store/preference/transactor.ts +6 -7
  220. package/src/actor-store/preference/util.ts +15 -5
  221. package/src/api/app/bsky/actor/getPreferences.ts +33 -8
  222. package/src/api/app/bsky/actor/getProfile.ts +9 -1
  223. package/src/api/app/bsky/actor/getProfiles.ts +9 -1
  224. package/src/api/app/bsky/actor/putPreferences.ts +35 -12
  225. package/src/api/app/bsky/feed/getActorLikes.ts +9 -1
  226. package/src/api/app/bsky/feed/getAuthorFeed.ts +9 -1
  227. package/src/api/app/bsky/feed/getFeed.ts +9 -2
  228. package/src/api/app/bsky/feed/getPostThread.ts +8 -1
  229. package/src/api/app/bsky/feed/getTimeline.ts +9 -1
  230. package/src/api/app/bsky/notification/registerPush.ts +16 -5
  231. package/src/api/com/atproto/identity/getRecommendedDidCredentials.ts +5 -1
  232. package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +9 -2
  233. package/src/api/com/atproto/identity/signPlcOperation.ts +9 -1
  234. package/src/api/com/atproto/identity/submitPlcOperation.ts +5 -1
  235. package/src/api/com/atproto/identity/updateHandle.ts +6 -1
  236. package/src/api/com/atproto/moderation/createReport.ts +8 -3
  237. package/src/api/com/atproto/repo/applyWrites.ts +28 -20
  238. package/src/api/com/atproto/repo/createRecord.ts +12 -1
  239. package/src/api/com/atproto/repo/deleteRecord.ts +14 -1
  240. package/src/api/com/atproto/repo/importRepo.ts +9 -2
  241. package/src/api/com/atproto/repo/listMissingBlobs.ts +7 -2
  242. package/src/api/com/atproto/repo/putRecord.ts +18 -10
  243. package/src/api/com/atproto/repo/uploadBlob.ts +6 -2
  244. package/src/api/com/atproto/server/activateAccount.ts +10 -2
  245. package/src/api/com/atproto/server/checkAccountStatus.ts +5 -1
  246. package/src/api/com/atproto/server/confirmEmail.ts +6 -1
  247. package/src/api/com/atproto/server/createAppPassword.ts +9 -1
  248. package/src/api/com/atproto/server/deactivateAccount.ts +11 -2
  249. package/src/api/com/atproto/server/deleteSession.ts +3 -1
  250. package/src/api/com/atproto/server/getAccountInviteCodes.ts +11 -2
  251. package/src/api/com/atproto/server/getServiceAuth.ts +37 -18
  252. package/src/api/com/atproto/server/getSession.ts +20 -27
  253. package/src/api/com/atproto/server/listAppPasswords.ts +8 -1
  254. package/src/api/com/atproto/server/refreshSession.ts +1 -1
  255. package/src/api/com/atproto/server/requestAccountDelete.ts +11 -2
  256. package/src/api/com/atproto/server/requestEmailConfirmation.ts +6 -1
  257. package/src/api/com/atproto/server/requestEmailUpdate.ts +6 -1
  258. package/src/api/com/atproto/server/revokeAppPassword.ts +8 -1
  259. package/src/api/com/atproto/server/updateEmail.ts +11 -2
  260. package/src/api/com/atproto/sync/deprecated/getCheckout.ts +7 -6
  261. package/src/api/com/atproto/sync/deprecated/getHead.ts +7 -6
  262. package/src/api/com/atproto/sync/getBlob.ts +7 -7
  263. package/src/api/com/atproto/sync/getBlocks.ts +7 -6
  264. package/src/api/com/atproto/sync/getLatestCommit.ts +7 -6
  265. package/src/api/com/atproto/sync/getRecord.ts +7 -6
  266. package/src/api/com/atproto/sync/getRepo.ts +7 -7
  267. package/src/api/com/atproto/sync/listBlobs.ts +7 -7
  268. package/src/api/com/atproto/temp/checkSignupQueue.ts +8 -2
  269. package/src/auth-output.ts +51 -0
  270. package/src/auth-scope.ts +40 -0
  271. package/src/auth-verifier.ts +404 -520
  272. package/src/config/config.ts +7 -7
  273. package/src/config/env.ts +5 -1
  274. package/src/context.ts +6 -5
  275. package/src/lexicon/index.ts +1235 -1235
  276. package/src/lexicon/lexicons.ts +9416 -9416
  277. package/src/pipethrough.ts +61 -18
  278. package/src/util/http.ts +31 -0
  279. package/src/util/types.ts +7 -0
  280. package/tests/oauth.test.ts +11 -37
  281. package/tests/preferences.test.ts +7 -3
  282. package/tsconfig.build.tsbuildinfo +1 -1
@@ -4,7 +4,11 @@ import { isValidDidDocForService } from './util'
4
4
 
5
5
  export default function (server: Server, ctx: AppContext) {
6
6
  server.com.atproto.server.checkAccountStatus({
7
- auth: ctx.authVerifier.accessStandard(),
7
+ auth: ctx.authVerifier.authorization({
8
+ authorize: () => {
9
+ // always allow
10
+ },
11
+ }),
8
12
  handler: async ({ auth }) => {
9
13
  const requester = auth.credentials.did
10
14
  const [
@@ -5,7 +5,12 @@ import { ids } from '../../../../lexicon/lexicons'
5
5
 
6
6
  export default function (server: Server, ctx: AppContext) {
7
7
  server.com.atproto.server.confirmEmail({
8
- auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
8
+ auth: ctx.authVerifier.authorization({
9
+ checkTakedown: true,
10
+ authorize: (permissions) => {
11
+ permissions.assertAccount({ attr: 'email', action: 'manage' })
12
+ },
13
+ }),
9
14
  handler: async ({ auth, input, req }) => {
10
15
  const did = auth.credentials.did
11
16
 
@@ -1,3 +1,5 @@
1
+ import { ForbiddenError } from '@atproto/xrpc-server'
2
+ import { ACCESS_FULL } from '../../../../auth-scope'
1
3
  import { AppContext } from '../../../../context'
2
4
  import { Server } from '../../../../lexicon'
3
5
  import { ids } from '../../../../lexicon/lexicons'
@@ -5,8 +7,14 @@ import { resultPassthru } from '../../../proxy'
5
7
 
6
8
  export default function (server: Server, ctx: AppContext) {
7
9
  server.com.atproto.server.createAppPassword({
8
- auth: ctx.authVerifier.accessFull({
10
+ auth: ctx.authVerifier.authorization({
9
11
  checkTakedown: true,
12
+ scopes: ACCESS_FULL,
13
+ authorize: () => {
14
+ throw new ForbiddenError(
15
+ 'OAuth credentials are not supported for this endpoint',
16
+ )
17
+ },
10
18
  }),
11
19
  handler: async ({ auth, input, req }) => {
12
20
  if (ctx.entrywayAgent) {
@@ -1,10 +1,19 @@
1
- import { AuthScope } from '../../../../auth-verifier'
1
+ import { ForbiddenError } from '@atproto/xrpc-server'
2
+ import { ACCESS_FULL, AuthScope } from '../../../../auth-scope'
2
3
  import { AppContext } from '../../../../context'
3
4
  import { Server } from '../../../../lexicon'
4
5
 
5
6
  export default function (server: Server, ctx: AppContext) {
6
7
  server.com.atproto.server.deactivateAccount({
7
- auth: ctx.authVerifier.accessFull({ additional: [AuthScope.Takendown] }),
8
+ auth: ctx.authVerifier.authorization({
9
+ additional: [AuthScope.Takendown],
10
+ scopes: ACCESS_FULL,
11
+ authorize: () => {
12
+ throw new ForbiddenError(
13
+ 'OAuth credentials are not supported for this endpoint',
14
+ )
15
+ },
16
+ }),
8
17
  handler: async ({ req, auth, input }) => {
9
18
  // in the case of entryway, the full flow is deactivateAccount (PDS) -> deactivateAccount (Entryway) -> updateSubjectStatus(PDS)
10
19
  if (ctx.entrywayAgent) {
@@ -12,7 +12,9 @@ export default function (server: Server, ctx: AppContext) {
12
12
  })
13
13
  } else {
14
14
  server.com.atproto.server.deleteSession({
15
- auth: ctx.authVerifier.refreshExpired,
15
+ auth: ctx.authVerifier.refresh({
16
+ allowExpired: true,
17
+ }),
16
18
  handler: async ({ auth }) => {
17
19
  await ctx.accountManager.revokeRefreshToken(auth.credentials.tokenId)
18
20
  },
@@ -1,5 +1,6 @@
1
- import { InvalidRequestError } from '@atproto/xrpc-server'
1
+ import { ForbiddenError, InvalidRequestError } from '@atproto/xrpc-server'
2
2
  import { CodeDetail } from '../../../../account-manager/helpers/invite'
3
+ import { ACCESS_FULL } from '../../../../auth-scope'
3
4
  import { AppContext } from '../../../../context'
4
5
  import { Server } from '../../../../lexicon'
5
6
  import { ids } from '../../../../lexicon/lexicons'
@@ -8,7 +9,15 @@ import { genInvCodes } from './util'
8
9
 
9
10
  export default function (server: Server, ctx: AppContext) {
10
11
  server.com.atproto.server.getAccountInviteCodes({
11
- auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
12
+ auth: ctx.authVerifier.authorization({
13
+ checkTakedown: true,
14
+ scopes: ACCESS_FULL,
15
+ authorize: () => {
16
+ throw new ForbiddenError(
17
+ 'OAuth credentials are not supported for this endpoint',
18
+ )
19
+ },
20
+ }),
12
21
  handler: async ({ params, auth, req }) => {
13
22
  if (ctx.entrywayAgent) {
14
23
  return resultPassthru(
@@ -1,6 +1,10 @@
1
1
  import { HOUR, MINUTE } from '@atproto/common'
2
2
  import { InvalidRequestError, createServiceJwt } from '@atproto/xrpc-server'
3
- import { AuthScope } from '../../../../auth-verifier'
3
+ import {
4
+ AuthScope,
5
+ isAccessPrivileged,
6
+ isTakendown,
7
+ } from '../../../../auth-scope'
4
8
  import { AppContext } from '../../../../context'
5
9
  import { Server } from '../../../../lexicon'
6
10
  import { ids } from '../../../../lexicon/lexicons'
@@ -8,19 +12,41 @@ import { PRIVILEGED_METHODS, PROTECTED_METHODS } from '../../../../pipethrough'
8
12
 
9
13
  export default function (server: Server, ctx: AppContext) {
10
14
  server.com.atproto.server.getServiceAuth({
11
- auth: ctx.authVerifier.accessStandard({
15
+ auth: ctx.authVerifier.authorization({
12
16
  additional: [AuthScope.Takendown],
17
+ authorize: (permissions, ctx) => {
18
+ const { aud, lxm = '*' } = ctx.params
19
+ permissions.assertRpc({ aud, lxm })
20
+ },
13
21
  }),
14
22
  handler: async ({ params, auth }) => {
15
23
  const did = auth.credentials.did
24
+
25
+ // @NOTE "exp" is expressed in seconds since epoch, not milliseconds
16
26
  const { aud, exp, lxm = null } = params
17
27
 
18
28
  // Takendown accounts should not be able to generate service auth tokens except for methods necessary for account migration
19
- if (
20
- auth.credentials.scope === AuthScope.Takendown &&
21
- lxm !== ids.ComAtprotoServerCreateAccount
22
- ) {
23
- throw new InvalidRequestError('Bad token scope', 'InvalidToken')
29
+ if (auth.credentials.type === 'access') {
30
+ // @NOTE We should probably use "ForbiddenError" here. Using
31
+ // "InvalidRequestError" for legacy reasons.
32
+ if (
33
+ isTakendown(auth.credentials.scope) &&
34
+ lxm !== ids.ComAtprotoServerCreateAccount
35
+ ) {
36
+ throw new InvalidRequestError('Bad token scope', 'InvalidToken')
37
+ }
38
+
39
+ // @NOTE "oauth" based credentials already checked through permission
40
+ // set in "authorize" method above.
41
+ if (
42
+ lxm != null &&
43
+ PRIVILEGED_METHODS.has(lxm) &&
44
+ !isAccessPrivileged(auth.credentials.scope)
45
+ ) {
46
+ throw new InvalidRequestError(
47
+ `insufficient access to request a service auth token for the following method: ${lxm}`,
48
+ )
49
+ }
24
50
  }
25
51
 
26
52
  if (exp) {
@@ -43,17 +69,10 @@ export default function (server: Server, ctx: AppContext) {
43
69
  }
44
70
  }
45
71
 
46
- if (lxm) {
47
- if (PROTECTED_METHODS.has(lxm)) {
48
- throw new InvalidRequestError(
49
- `cannot request a service auth token for the following protected method: ${lxm}`,
50
- )
51
- }
52
- if (!auth.credentials.isPrivileged && PRIVILEGED_METHODS.has(lxm)) {
53
- throw new InvalidRequestError(
54
- `insufficient access to request a service auth token for the following method: ${lxm}`,
55
- )
56
- }
72
+ if (lxm && PROTECTED_METHODS.has(lxm)) {
73
+ throw new InvalidRequestError(
74
+ `cannot request a service auth token for the following protected method: ${lxm}`,
75
+ )
57
76
  }
58
77
 
59
78
  const keypair = await ctx.actorStore.keypair(did)
@@ -2,27 +2,27 @@ import { ComAtprotoServerGetSession } from '@atproto/api'
2
2
  import { INVALID_HANDLE } from '@atproto/syntax'
3
3
  import { InvalidRequestError } from '@atproto/xrpc-server'
4
4
  import { formatAccountStatus } from '../../../../account-manager/account-manager'
5
- import { AccessOutput, AuthScope, OAuthOutput } from '../../../../auth-verifier'
5
+ import { AccessOutput, OAuthOutput } from '../../../../auth-output'
6
+ import { AuthScope } from '../../../../auth-scope'
6
7
  import { AppContext } from '../../../../context'
7
8
  import { Server } from '../../../../lexicon'
8
9
  import { didDocForSession } from './util'
9
10
 
10
11
  export default function (server: Server, ctx: AppContext) {
11
12
  server.com.atproto.server.getSession({
12
- auth: ctx.authVerifier.accessStandard({
13
+ auth: ctx.authVerifier.authorization({
13
14
  additional: [AuthScope.SignupQueued],
15
+ authorize: () => {
16
+ // Always allowed. "email" access is checked in the handler.
17
+ },
14
18
  }),
15
19
  handler: async ({ auth, req }) => {
16
20
  if (ctx.entrywayAgent) {
17
- // Allow proxying of dpop bound requests by using service auth instead
18
- const headers =
19
- auth.credentials.type === 'oauth' // DPoP bound tokens cannot be proxied
20
- ? await ctx.entrywayAuthHeaders(
21
- req,
22
- auth.credentials.did,
23
- 'com.atproto.server.getSession',
24
- )
25
- : ctx.entrywayPassthruHeaders(req)
21
+ const headers = await ctx.entrywayAuthHeaders(
22
+ req,
23
+ auth.credentials.did,
24
+ 'com.atproto.server.getSession',
25
+ )
26
26
 
27
27
  const res = await ctx.entrywayAgent.com.atproto.server.getSession(
28
28
  undefined,
@@ -65,23 +65,16 @@ export default function (server: Server, ctx: AppContext) {
65
65
  }
66
66
 
67
67
  function output(
68
- { credentials }: AccessOutput | OAuthOutput,
68
+ { credentials }: OAuthOutput | AccessOutput,
69
69
  data: ComAtprotoServerGetSession.OutputSchema,
70
70
  ): ComAtprotoServerGetSession.OutputSchema {
71
- switch (credentials.type) {
72
- case 'access':
73
- return data
74
-
75
- case 'oauth':
76
- if (!credentials.oauthScopes.has('transition:email')) {
77
- const { email, emailAuthFactor, emailConfirmed, ...rest } = data
78
- return rest
79
- }
80
-
81
- return data
82
-
83
- default:
84
- // @ts-expect-error
85
- throw new Error(`Unknown credentials type: ${credentials.type}`)
71
+ if (
72
+ credentials.type === 'oauth' &&
73
+ !credentials.permissions.allowsAccount({ attr: 'email', action: 'read' })
74
+ ) {
75
+ const { email, emailAuthFactor, emailConfirmed, ...rest } = data
76
+ return rest
86
77
  }
78
+
79
+ return data
87
80
  }
@@ -1,3 +1,4 @@
1
+ import { ForbiddenError } from '@atproto/xrpc-server'
1
2
  import { AppContext } from '../../../../context'
2
3
  import { Server } from '../../../../lexicon'
3
4
  import { ids } from '../../../../lexicon/lexicons'
@@ -5,7 +6,13 @@ import { resultPassthru } from '../../../proxy'
5
6
 
6
7
  export default function (server: Server, ctx: AppContext) {
7
8
  server.com.atproto.server.listAppPasswords({
8
- auth: ctx.authVerifier.accessStandard(),
9
+ auth: ctx.authVerifier.authorization({
10
+ authorize: () => {
11
+ throw new ForbiddenError(
12
+ 'OAuth credentials are not supported for this endpoint',
13
+ )
14
+ },
15
+ }),
9
16
  handler: async ({ auth, req }) => {
10
17
  if (ctx.entrywayAgent) {
11
18
  return resultPassthru(
@@ -9,7 +9,7 @@ import { didDocForSession } from './util'
9
9
 
10
10
  export default function (server: Server, ctx: AppContext) {
11
11
  server.com.atproto.server.refreshSession({
12
- auth: ctx.authVerifier.refresh,
12
+ auth: ctx.authVerifier.refresh(),
13
13
  handler: async ({ auth, req }) => {
14
14
  const did = auth.credentials.did
15
15
  const user = await ctx.accountManager.getAccount(did, {
@@ -1,5 +1,6 @@
1
1
  import { DAY, HOUR } from '@atproto/common'
2
- import { InvalidRequestError } from '@atproto/xrpc-server'
2
+ import { ForbiddenError, InvalidRequestError } from '@atproto/xrpc-server'
3
+ import { ACCESS_FULL } from '../../../../auth-scope'
3
4
  import { AppContext } from '../../../../context'
4
5
  import { Server } from '../../../../lexicon'
5
6
  import { ids } from '../../../../lexicon/lexicons'
@@ -18,7 +19,15 @@ export default function (server: Server, ctx: AppContext) {
18
19
  calcKey: ({ auth }) => auth.credentials.did,
19
20
  },
20
21
  ],
21
- auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
22
+ auth: ctx.authVerifier.authorization({
23
+ checkTakedown: true,
24
+ scopes: ACCESS_FULL,
25
+ authorize: () => {
26
+ throw new ForbiddenError(
27
+ 'OAuth credentials are not supported for this endpoint',
28
+ )
29
+ },
30
+ }),
22
31
  handler: async ({ auth, req }) => {
23
32
  const did = auth.credentials.did
24
33
  const account = await ctx.accountManager.getAccount(did, {
@@ -18,7 +18,12 @@ export default function (server: Server, ctx: AppContext) {
18
18
  calcKey: ({ auth }) => auth.credentials.did,
19
19
  },
20
20
  ],
21
- auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
21
+ auth: ctx.authVerifier.authorization({
22
+ checkTakedown: true,
23
+ authorize: (permissions) => {
24
+ permissions.assertAccount({ attr: 'email', action: 'manage' })
25
+ },
26
+ }),
22
27
  handler: async ({ auth, req }) => {
23
28
  const did = auth.credentials.did
24
29
  const account = await ctx.accountManager.getAccount(did, {
@@ -19,7 +19,12 @@ export default function (server: Server, ctx: AppContext) {
19
19
  calcKey: ({ auth }) => auth.credentials.did,
20
20
  },
21
21
  ],
22
- auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
22
+ auth: ctx.authVerifier.authorization({
23
+ checkTakedown: true,
24
+ authorize: (permissions) => {
25
+ permissions.assertAccount({ attr: 'email', action: 'manage' })
26
+ },
27
+ }),
23
28
  handler: async ({ auth, req }) => {
24
29
  const did = auth.credentials.did
25
30
  const account = await ctx.accountManager.getAccount(did, {
@@ -1,10 +1,17 @@
1
+ import { ForbiddenError } from '@atproto/xrpc-server'
1
2
  import { AppContext } from '../../../../context'
2
3
  import { Server } from '../../../../lexicon'
3
4
  import { ids } from '../../../../lexicon/lexicons'
4
5
 
5
6
  export default function (server: Server, ctx: AppContext) {
6
7
  server.com.atproto.server.revokeAppPassword({
7
- auth: ctx.authVerifier.accessStandard(),
8
+ auth: ctx.authVerifier.authorization({
9
+ authorize: () => {
10
+ throw new ForbiddenError(
11
+ 'OAuth credentials are not supported for this endpoint',
12
+ )
13
+ },
14
+ }),
8
15
  handler: async ({ auth, input, req }) => {
9
16
  if (ctx.entrywayAgent) {
10
17
  await ctx.entrywayAgent.com.atproto.server.revokeAppPassword(
@@ -1,14 +1,23 @@
1
1
  import { isEmailValid } from '@hapi/address'
2
2
  import { isDisposableEmail } from 'disposable-email-domains-js'
3
- import { InvalidRequestError } from '@atproto/xrpc-server'
3
+ import { ForbiddenError, InvalidRequestError } from '@atproto/xrpc-server'
4
4
  import { UserAlreadyExistsError } from '../../../../account-manager/helpers/account'
5
+ import { ACCESS_FULL } from '../../../../auth-scope'
5
6
  import { AppContext } from '../../../../context'
6
7
  import { Server } from '../../../../lexicon'
7
8
  import { ids } from '../../../../lexicon/lexicons'
8
9
 
9
10
  export default function (server: Server, ctx: AppContext) {
10
11
  server.com.atproto.server.updateEmail({
11
- auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
12
+ auth: ctx.authVerifier.authorization({
13
+ checkTakedown: true,
14
+ scopes: ACCESS_FULL,
15
+ authorize: () => {
16
+ throw new ForbiddenError(
17
+ 'OAuth credentials are not supported for this endpoint',
18
+ )
19
+ },
20
+ }),
12
21
  handler: async ({ auth, input, req }) => {
13
22
  const did = auth.credentials.did
14
23
  const { token, email } = input.body
@@ -1,3 +1,4 @@
1
+ import { isUserOrAdmin } from '../../../../../auth-verifier'
1
2
  import { AppContext } from '../../../../../context'
2
3
  import { Server } from '../../../../../lexicon'
3
4
  import { getCarStream } from '../getRepo'
@@ -5,14 +6,14 @@ import { assertRepoAvailability } from '../util'
5
6
 
6
7
  export default function (server: Server, ctx: AppContext) {
7
8
  server.com.atproto.sync.getCheckout({
8
- auth: ctx.authVerifier.optionalAccessOrAdminToken(),
9
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
10
+ authorize: () => {
11
+ // always allow
12
+ },
13
+ }),
9
14
  handler: async ({ params, auth }) => {
10
15
  const { did } = params
11
- await assertRepoAvailability(
12
- ctx,
13
- did,
14
- ctx.authVerifier.isUserOrAdmin(auth, did),
15
- )
16
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
16
17
 
17
18
  const carStream = await getCarStream(ctx, did)
18
19
 
@@ -1,18 +1,19 @@
1
1
  import { InvalidRequestError } from '@atproto/xrpc-server'
2
+ import { isUserOrAdmin } from '../../../../../auth-verifier'
2
3
  import { AppContext } from '../../../../../context'
3
4
  import { Server } from '../../../../../lexicon'
4
5
  import { assertRepoAvailability } from '../util'
5
6
 
6
7
  export default function (server: Server, ctx: AppContext) {
7
8
  server.com.atproto.sync.getHead({
8
- auth: ctx.authVerifier.optionalAccessOrAdminToken(),
9
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
10
+ authorize: () => {
11
+ // always allow
12
+ },
13
+ }),
9
14
  handler: async ({ params, auth }) => {
10
15
  const { did } = params
11
- await assertRepoAvailability(
12
- ctx,
13
- did,
14
- ctx.authVerifier.isUserOrAdmin(auth, did),
15
- )
16
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
16
17
 
17
18
  const root = await ctx.actorStore.read(did, (store) =>
18
19
  store.repo.storage.getRoot(),
@@ -1,23 +1,23 @@
1
1
  import { CID } from 'multiformats/cid'
2
2
  import { BlobNotFoundError } from '@atproto/repo'
3
3
  import { InvalidRequestError } from '@atproto/xrpc-server'
4
- import { AuthScope } from '../../../../auth-verifier'
4
+ import { AuthScope } from '../../../../auth-scope'
5
+ import { isUserOrAdmin } from '../../../../auth-verifier'
5
6
  import { AppContext } from '../../../../context'
6
7
  import { Server } from '../../../../lexicon'
7
8
  import { assertRepoAvailability } from './util'
8
9
 
9
10
  export default function (server: Server, ctx: AppContext) {
10
11
  server.com.atproto.sync.getBlob({
11
- auth: ctx.authVerifier.optionalAccessOrAdminToken({
12
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
12
13
  additional: [AuthScope.Takendown],
14
+ authorize: () => {
15
+ // always allow
16
+ },
13
17
  }),
14
18
  handler: async ({ params, res, auth }) => {
15
19
  const { did } = params
16
- await assertRepoAvailability(
17
- ctx,
18
- did,
19
- ctx.authVerifier.isUserOrAdmin(auth, did),
20
- )
20
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
21
21
 
22
22
  const cid = CID.parse(params.cid)
23
23
  const found = await ctx.actorStore.read(params.did, async (store) => {
@@ -2,20 +2,21 @@ import { CID } from 'multiformats/cid'
2
2
  import { byteIterableToStream } from '@atproto/common'
3
3
  import { blocksToCarStream } from '@atproto/repo'
4
4
  import { InvalidRequestError } from '@atproto/xrpc-server'
5
+ import { isUserOrAdmin } from '../../../../auth-verifier'
5
6
  import { AppContext } from '../../../../context'
6
7
  import { Server } from '../../../../lexicon'
7
8
  import { assertRepoAvailability } from './util'
8
9
 
9
10
  export default function (server: Server, ctx: AppContext) {
10
11
  server.com.atproto.sync.getBlocks({
11
- auth: ctx.authVerifier.optionalAccessOrAdminToken(),
12
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
13
+ authorize: () => {
14
+ // always allow
15
+ },
16
+ }),
12
17
  handler: async ({ params, auth }) => {
13
18
  const { did } = params
14
- await assertRepoAvailability(
15
- ctx,
16
- did,
17
- ctx.authVerifier.isUserOrAdmin(auth, did),
18
- )
19
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
19
20
 
20
21
  const cids = params.cids.map((c) => CID.parse(c))
21
22
  const got = await ctx.actorStore.read(did, (store) =>
@@ -1,18 +1,19 @@
1
1
  import { InvalidRequestError } from '@atproto/xrpc-server'
2
+ import { isUserOrAdmin } from '../../../../auth-verifier'
2
3
  import { AppContext } from '../../../../context'
3
4
  import { Server } from '../../../../lexicon'
4
5
  import { assertRepoAvailability } from './util'
5
6
 
6
7
  export default function (server: Server, ctx: AppContext) {
7
8
  server.com.atproto.sync.getLatestCommit({
8
- auth: ctx.authVerifier.optionalAccessOrAdminToken(),
9
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
10
+ authorize: () => {
11
+ // always allow
12
+ },
13
+ }),
9
14
  handler: async ({ params, auth }) => {
10
15
  const { did } = params
11
- await assertRepoAvailability(
12
- ctx,
13
- did,
14
- ctx.authVerifier.isUserOrAdmin(auth, did),
15
- )
16
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
16
17
 
17
18
  const root = await ctx.actorStore.read(did, (store) =>
18
19
  store.repo.storage.getRootDetailed(),
@@ -3,20 +3,21 @@ import { byteIterableToStream } from '@atproto/common'
3
3
  import * as repo from '@atproto/repo'
4
4
  import { InvalidRequestError } from '@atproto/xrpc-server'
5
5
  import { SqlRepoReader } from '../../../../actor-store/repo/sql-repo-reader'
6
+ import { isUserOrAdmin } from '../../../../auth-verifier'
6
7
  import { AppContext } from '../../../../context'
7
8
  import { Server } from '../../../../lexicon'
8
9
  import { assertRepoAvailability } from './util'
9
10
 
10
11
  export default function (server: Server, ctx: AppContext) {
11
12
  server.com.atproto.sync.getRecord({
12
- auth: ctx.authVerifier.optionalAccessOrAdminToken(),
13
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
14
+ authorize: () => {
15
+ // always allow
16
+ },
17
+ }),
13
18
  handler: async ({ params, auth }) => {
14
19
  const { did, collection, rkey } = params
15
- await assertRepoAvailability(
16
- ctx,
17
- did,
18
- ctx.authVerifier.isUserOrAdmin(auth, did),
19
- )
20
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
20
21
 
21
22
  // must open up the db outside of store interface so that we can close the file handle after finished streaming
22
23
  const actorDb = await ctx.actorStore.openDb(did)
@@ -5,23 +5,23 @@ import {
5
5
  RepoRootNotFoundError,
6
6
  SqlRepoReader,
7
7
  } from '../../../../actor-store/repo/sql-repo-reader'
8
- import { AuthScope } from '../../../../auth-verifier'
8
+ import { AuthScope } from '../../../../auth-scope'
9
+ import { isUserOrAdmin } from '../../../../auth-verifier'
9
10
  import { AppContext } from '../../../../context'
10
11
  import { Server } from '../../../../lexicon'
11
12
  import { assertRepoAvailability } from './util'
12
13
 
13
14
  export default function (server: Server, ctx: AppContext) {
14
15
  server.com.atproto.sync.getRepo({
15
- auth: ctx.authVerifier.optionalAccessOrAdminToken({
16
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
16
17
  additional: [AuthScope.Takendown],
18
+ authorize: () => {
19
+ // always allow
20
+ },
17
21
  }),
18
22
  handler: async ({ params, auth }) => {
19
23
  const { did, since } = params
20
- await assertRepoAvailability(
21
- ctx,
22
- did,
23
- ctx.authVerifier.isUserOrAdmin(auth, did),
24
- )
24
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
25
25
 
26
26
  const carStream = await getCarStream(ctx, did, since)
27
27
 
@@ -1,20 +1,20 @@
1
- import { AuthScope } from '../../../../auth-verifier'
1
+ import { AuthScope } from '../../../../auth-scope'
2
+ import { isUserOrAdmin } from '../../../../auth-verifier'
2
3
  import { AppContext } from '../../../../context'
3
4
  import { Server } from '../../../../lexicon'
4
5
  import { assertRepoAvailability } from './util'
5
6
 
6
7
  export default function (server: Server, ctx: AppContext) {
7
8
  server.com.atproto.sync.listBlobs({
8
- auth: ctx.authVerifier.optionalAccessOrAdminToken({
9
+ auth: ctx.authVerifier.authorizationOrAdminTokenOptional({
9
10
  additional: [AuthScope.Takendown],
11
+ authorize: () => {
12
+ // always allow
13
+ },
10
14
  }),
11
15
  handler: async ({ params, auth }) => {
12
16
  const { did, since, limit, cursor } = params
13
- await assertRepoAvailability(
14
- ctx,
15
- did,
16
- ctx.authVerifier.isUserOrAdmin(auth, did),
17
- )
17
+ await assertRepoAvailability(ctx, did, isUserOrAdmin(auth, did))
18
18
 
19
19
  const blobCids = await ctx.actorStore.read(did, (store) =>
20
20
  store.repo.blob.listBlobs({ since, limit, cursor }),
@@ -1,4 +1,5 @@
1
- import { AuthScope } from '../../../../auth-verifier'
1
+ import { ForbiddenError } from '@atproto/xrpc-server'
2
+ import { AuthScope } from '../../../../auth-scope'
2
3
  import { AppContext } from '../../../../context'
3
4
  import { Server } from '../../../../lexicon'
4
5
  import { resultPassthru } from '../../../proxy'
@@ -6,8 +7,13 @@ import { resultPassthru } from '../../../proxy'
6
7
  // THIS IS A TEMPORARY UNSPECCED ROUTE
7
8
  export default function (server: Server, ctx: AppContext) {
8
9
  server.com.atproto.temp.checkSignupQueue({
9
- auth: ctx.authVerifier.accessStandard({
10
+ auth: ctx.authVerifier.authorization({
10
11
  additional: [AuthScope.SignupQueued],
12
+ authorize: () => {
13
+ throw new ForbiddenError(
14
+ 'OAuth credentials are not supported for this endpoint',
15
+ )
16
+ },
11
17
  }),
12
18
  handler: async ({ req }) => {
13
19
  if (!ctx.entrywayAgent) {