@atproto/pds 0.5.3 → 0.5.5

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 (275) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/account-manager/account-manager.d.ts +1 -1
  3. package/dist/account-manager/account-manager.d.ts.map +1 -1
  4. package/dist/account-manager/account-manager.js +16 -19
  5. package/dist/account-manager/account-manager.js.map +1 -1
  6. package/dist/account-manager/db/index.d.ts.map +1 -1
  7. package/dist/account-manager/db/migrations/index.d.ts.map +1 -1
  8. package/dist/account-manager/helpers/account-device.d.ts +91 -91
  9. package/dist/account-manager/helpers/account.d.ts +7 -7
  10. package/dist/account-manager/helpers/account.d.ts.map +1 -1
  11. package/dist/account-manager/helpers/auth.d.ts.map +1 -1
  12. package/dist/account-manager/helpers/authorization-request.d.ts.map +1 -1
  13. package/dist/account-manager/helpers/device.d.ts +1 -1
  14. package/dist/account-manager/helpers/device.d.ts.map +1 -1
  15. package/dist/account-manager/helpers/email-token.d.ts.map +1 -1
  16. package/dist/account-manager/helpers/invite.d.ts +1 -1
  17. package/dist/account-manager/helpers/invite.d.ts.map +1 -1
  18. package/dist/account-manager/helpers/password.d.ts.map +1 -1
  19. package/dist/account-manager/helpers/repo.d.ts.map +1 -1
  20. package/dist/account-manager/helpers/scrypt.d.ts.map +1 -1
  21. package/dist/account-manager/helpers/token.d.ts +457 -457
  22. package/dist/account-manager/helpers/token.d.ts.map +1 -1
  23. package/dist/account-manager/helpers/used-refresh-token.d.ts.map +1 -1
  24. package/dist/account-manager/oauth-store.d.ts.map +1 -1
  25. package/dist/account-manager/oauth-store.js +46 -26
  26. package/dist/account-manager/oauth-store.js.map +1 -1
  27. package/dist/account-manager/scope-reference-getter.d.ts.map +1 -1
  28. package/dist/account-manager/scope-reference-getter.js.map +1 -1
  29. package/dist/actor-store/actor-store-reader.d.ts.map +1 -1
  30. package/dist/actor-store/actor-store-reader.js.map +1 -1
  31. package/dist/actor-store/actor-store-transactor.d.ts.map +1 -1
  32. package/dist/actor-store/actor-store-transactor.js.map +1 -1
  33. package/dist/actor-store/actor-store-writer.d.ts.map +1 -1
  34. package/dist/actor-store/actor-store.d.ts.map +1 -1
  35. package/dist/actor-store/actor-store.js.map +1 -1
  36. package/dist/actor-store/blob/reader.d.ts.map +1 -1
  37. package/dist/actor-store/blob/reader.js.map +1 -1
  38. package/dist/actor-store/blob/transactor.d.ts.map +1 -1
  39. package/dist/actor-store/blob/transactor.js.map +1 -1
  40. package/dist/actor-store/db/index.d.ts.map +1 -1
  41. package/dist/actor-store/db/migrations/index.d.ts.map +1 -1
  42. package/dist/actor-store/migrate.d.ts.map +1 -1
  43. package/dist/actor-store/preference/reader.d.ts.map +1 -1
  44. package/dist/actor-store/preference/reader.js.map +1 -1
  45. package/dist/actor-store/preference/transactor.d.ts.map +1 -1
  46. package/dist/actor-store/record/reader.d.ts +3 -3
  47. package/dist/actor-store/record/reader.d.ts.map +1 -1
  48. package/dist/actor-store/record/reader.js.map +1 -1
  49. package/dist/actor-store/record/transactor.d.ts.map +1 -1
  50. package/dist/actor-store/record/transactor.js.map +1 -1
  51. package/dist/actor-store/repo/reader.d.ts.map +1 -1
  52. package/dist/actor-store/repo/reader.js.map +1 -1
  53. package/dist/actor-store/repo/sql-repo-reader.d.ts +1 -1
  54. package/dist/actor-store/repo/sql-repo-reader.d.ts.map +1 -1
  55. package/dist/actor-store/repo/sql-repo-transactor.d.ts.map +1 -1
  56. package/dist/actor-store/repo/transactor.d.ts.map +1 -1
  57. package/dist/actor-store/repo/transactor.js.map +1 -1
  58. package/dist/api/app/bsky/util/resolver.d.ts +4 -4
  59. package/dist/api/app/bsky/util/resolver.d.ts.map +1 -1
  60. package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
  61. package/dist/api/com/atproto/admin/deleteAccount.js +9 -4
  62. package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
  63. package/dist/api/com/atproto/admin/getInviteCodes.d.ts.map +1 -1
  64. package/dist/api/com/atproto/admin/updateSubjectStatus.js +1 -1
  65. package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
  66. package/dist/api/com/atproto/identity/submitPlcOperation.js +1 -1
  67. package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
  68. package/dist/api/com/atproto/server/activateAccount.js +1 -3
  69. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  70. package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
  71. package/dist/api/com/atproto/server/createAccount.js +61 -45
  72. package/dist/api/com/atproto/server/createAccount.js.map +1 -1
  73. package/dist/api/com/atproto/server/deactivateAccount.js +1 -1
  74. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  75. package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
  76. package/dist/api/com/atproto/server/deleteAccount.js +9 -4
  77. package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
  78. package/dist/api/com/atproto/server/util.d.ts.map +1 -1
  79. package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
  80. package/dist/api/com/atproto/sync/getRepo.js +5 -1
  81. package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
  82. package/dist/api/com/atproto/sync/listRepos.d.ts.map +1 -1
  83. package/dist/api/com/atproto/sync/util.d.ts.map +1 -1
  84. package/dist/api/proxy.d.ts.map +1 -1
  85. package/dist/app-view.d.ts.map +1 -1
  86. package/dist/auth-routes.d.ts.map +1 -1
  87. package/dist/auth-verifier.d.ts.map +1 -1
  88. package/dist/background.d.ts.map +1 -1
  89. package/dist/basic-routes.d.ts.map +1 -1
  90. package/dist/bsky-app-view.d.ts.map +1 -1
  91. package/dist/config/config.d.ts.map +1 -1
  92. package/dist/config/env.d.ts.map +1 -1
  93. package/dist/config/secrets.d.ts.map +1 -1
  94. package/dist/context.d.ts.map +1 -1
  95. package/dist/crawlers.d.ts.map +1 -1
  96. package/dist/db/db.d.ts.map +1 -1
  97. package/dist/db/migrator.d.ts.map +1 -1
  98. package/dist/db/migrator.js.map +1 -1
  99. package/dist/db/pagination.d.ts +1 -1
  100. package/dist/db/pagination.d.ts.map +1 -1
  101. package/dist/db/pagination.js.map +1 -1
  102. package/dist/db/util.d.ts.map +1 -1
  103. package/dist/did-cache/db/index.d.ts.map +1 -1
  104. package/dist/did-cache/db/migrations.d.ts.map +1 -1
  105. package/dist/did-cache/index.d.ts.map +1 -1
  106. package/dist/did-cache/index.js.map +1 -1
  107. package/dist/disk-blobstore.d.ts.map +1 -1
  108. package/dist/disk-blobstore.js.map +1 -1
  109. package/dist/handle/explicit-slurs.d.ts.map +1 -1
  110. package/dist/handle/index.d.ts.map +1 -1
  111. package/dist/image/image-url-builder.d.ts.map +1 -1
  112. package/dist/image/image-url-builder.js.map +1 -1
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +4 -39
  115. package/dist/index.js.map +1 -1
  116. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +75 -155
  117. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
  118. package/dist/lexicons/app/bsky/actor/profile.defs.d.ts +100 -300
  119. package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
  120. package/dist/lexicons/app/bsky/actor/status.defs.d.ts +40 -40
  121. package/dist/lexicons/app/bsky/actor/status.defs.d.ts.map +1 -1
  122. package/dist/lexicons/app/bsky/authCreatePosts.defs.d.ts +1 -1
  123. package/dist/lexicons/app/bsky/authDeleteContent.defs.d.ts +1 -1
  124. package/dist/lexicons/app/bsky/authFullApp.defs.d.ts +1 -1
  125. package/dist/lexicons/app/bsky/authManageFeedDeclarations.defs.d.ts +1 -1
  126. package/dist/lexicons/app/bsky/authManageLabelerService.defs.d.ts +1 -1
  127. package/dist/lexicons/app/bsky/authManageModeration.defs.d.ts +1 -1
  128. package/dist/lexicons/app/bsky/authManageNotifications.defs.d.ts +1 -1
  129. package/dist/lexicons/app/bsky/authManageProfile.defs.d.ts +1 -1
  130. package/dist/lexicons/app/bsky/authViewAll.defs.d.ts +1 -1
  131. package/dist/lexicons/app/bsky/draft/defs.defs.d.ts +4 -4
  132. package/dist/lexicons/app/bsky/draft/defs.defs.d.ts.map +1 -1
  133. package/dist/lexicons/app/bsky/embed/external.defs.d.ts +10 -10
  134. package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts +10 -42
  135. package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts.map +1 -1
  136. package/dist/lexicons/app/bsky/embed/images.defs.d.ts +10 -10
  137. package/dist/lexicons/app/bsky/embed/record.defs.d.ts +10 -10
  138. package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.d.ts +10 -10
  139. package/dist/lexicons/app/bsky/embed/video.defs.d.ts +50 -162
  140. package/dist/lexicons/app/bsky/embed/video.defs.d.ts.map +1 -1
  141. package/dist/lexicons/app/bsky/feed/generator.defs.d.ts +80 -160
  142. package/dist/lexicons/app/bsky/feed/generator.defs.d.ts.map +1 -1
  143. package/dist/lexicons/app/bsky/feed/like.defs.d.ts +30 -30
  144. package/dist/lexicons/app/bsky/feed/like.defs.d.ts.map +1 -1
  145. package/dist/lexicons/app/bsky/feed/post.defs.d.ts +80 -200
  146. package/dist/lexicons/app/bsky/feed/post.defs.d.ts.map +1 -1
  147. package/dist/lexicons/app/bsky/feed/postgate.defs.d.ts +40 -80
  148. package/dist/lexicons/app/bsky/feed/postgate.defs.d.ts.map +1 -1
  149. package/dist/lexicons/app/bsky/feed/repost.defs.d.ts +30 -30
  150. package/dist/lexicons/app/bsky/feed/repost.defs.d.ts.map +1 -1
  151. package/dist/lexicons/app/bsky/feed/threadgate.defs.d.ts +30 -30
  152. package/dist/lexicons/app/bsky/feed/threadgate.defs.d.ts.map +1 -1
  153. package/dist/lexicons/app/bsky/graph/block.defs.d.ts +20 -20
  154. package/dist/lexicons/app/bsky/graph/block.defs.d.ts.map +1 -1
  155. package/dist/lexicons/app/bsky/graph/follow.defs.d.ts +30 -30
  156. package/dist/lexicons/app/bsky/graph/follow.defs.d.ts.map +1 -1
  157. package/dist/lexicons/app/bsky/graph/list.defs.d.ts +60 -60
  158. package/dist/lexicons/app/bsky/graph/list.defs.d.ts.map +1 -1
  159. package/dist/lexicons/app/bsky/graph/listblock.defs.d.ts +20 -20
  160. package/dist/lexicons/app/bsky/graph/listblock.defs.d.ts.map +1 -1
  161. package/dist/lexicons/app/bsky/graph/listitem.defs.d.ts +20 -20
  162. package/dist/lexicons/app/bsky/graph/listitem.defs.d.ts.map +1 -1
  163. package/dist/lexicons/app/bsky/graph/starterpack.defs.d.ts +50 -90
  164. package/dist/lexicons/app/bsky/graph/starterpack.defs.d.ts.map +1 -1
  165. package/dist/lexicons/app/bsky/graph/verification.defs.d.ts +30 -30
  166. package/dist/lexicons/app/bsky/graph/verification.defs.d.ts.map +1 -1
  167. package/dist/lexicons/app/bsky/labeler/service.defs.d.ts +50 -130
  168. package/dist/lexicons/app/bsky/labeler/service.defs.d.ts.map +1 -1
  169. package/dist/lexicons/app/bsky/notification/declaration.defs.d.ts +10 -10
  170. package/dist/lexicons/app/bsky/notification/declaration.defs.d.ts.map +1 -1
  171. package/dist/lexicons/app/bsky/richtext/facet.defs.d.ts +10 -10
  172. package/dist/lexicons/chat/bsky/actor/declaration.defs.d.ts +20 -20
  173. package/dist/lexicons/chat/bsky/actor/declaration.defs.d.ts.map +1 -1
  174. package/dist/lexicons/chat/bsky/authFullChatClient.defs.d.ts +1 -1
  175. package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts +17 -0
  176. package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts.map +1 -1
  177. package/dist/lexicons/chat/bsky/convo/defs.defs.js +11 -0
  178. package/dist/lexicons/chat/bsky/convo/defs.defs.js.map +1 -1
  179. package/dist/lexicons/chat/bsky/convo/sendMessage.defs.d.ts +1 -1
  180. package/dist/lexicons/chat/bsky/convo/sendMessage.defs.d.ts.map +1 -1
  181. package/dist/lexicons/chat/bsky/convo/sendMessage.defs.js +1 -0
  182. package/dist/lexicons/chat/bsky/convo/sendMessage.defs.js.map +1 -1
  183. package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.d.ts +1 -1
  184. package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.d.ts.map +1 -1
  185. package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.js +1 -0
  186. package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.js.map +1 -1
  187. package/dist/lexicons/chat/bsky/embed/joinLink.defs.d.ts +10 -42
  188. package/dist/lexicons/chat/bsky/embed/joinLink.defs.d.ts.map +1 -1
  189. package/dist/lexicons/com/atproto/lexicon/schema.defs.d.ts +10 -10
  190. package/dist/lexicons/com/atproto/lexicon/schema.defs.d.ts.map +1 -1
  191. package/dist/lexicons/com/atproto/repo/strongRef.defs.d.ts +10 -10
  192. package/dist/lexicons/com/germnetwork/declaration.defs.d.ts +40 -120
  193. package/dist/lexicons/com/germnetwork/declaration.defs.d.ts.map +1 -1
  194. package/dist/lexicons/site/standard/document.defs.d.ts +130 -450
  195. package/dist/lexicons/site/standard/document.defs.d.ts.map +1 -1
  196. package/dist/lexicons/site/standard/graph/recommend.defs.d.ts +10 -10
  197. package/dist/lexicons/site/standard/graph/recommend.defs.d.ts.map +1 -1
  198. package/dist/lexicons/site/standard/graph/subscription.defs.d.ts +20 -60
  199. package/dist/lexicons/site/standard/graph/subscription.defs.d.ts.map +1 -1
  200. package/dist/lexicons/site/standard/publication.defs.d.ts +60 -220
  201. package/dist/lexicons/site/standard/publication.defs.d.ts.map +1 -1
  202. package/dist/lexicons/site/standard/theme/basic.defs.d.ts +10 -10
  203. package/dist/lexicons/site/standard/theme/basic.defs.d.ts.map +1 -1
  204. package/dist/lexicons/tools/ozone/moderation/queryStatuses.defs.d.ts +2 -2
  205. package/dist/lexicons/tools/ozone/set/querySets.defs.d.ts +2 -2
  206. package/dist/logger.d.ts +14 -14
  207. package/dist/logger.d.ts.map +1 -1
  208. package/dist/mailer/index.d.ts.map +1 -1
  209. package/dist/mailer/index.js.map +1 -1
  210. package/dist/mailer/moderation.d.ts.map +1 -1
  211. package/dist/pipethrough.d.ts +1 -1
  212. package/dist/pipethrough.d.ts.map +1 -1
  213. package/dist/pipethrough.js.map +1 -1
  214. package/dist/rate-limits.d.ts +7 -0
  215. package/dist/rate-limits.d.ts.map +1 -0
  216. package/dist/rate-limits.js +50 -0
  217. package/dist/rate-limits.js.map +1 -0
  218. package/dist/read-after-write/util.d.ts.map +1 -1
  219. package/dist/read-after-write/viewer.d.ts +8 -8
  220. package/dist/read-after-write/viewer.d.ts.map +1 -1
  221. package/dist/read-after-write/viewer.js.map +1 -1
  222. package/dist/redis.d.ts.map +1 -1
  223. package/dist/repo/prepare.d.ts.map +1 -1
  224. package/dist/repo/types.d.ts.map +1 -1
  225. package/dist/repo/types.js.map +1 -1
  226. package/dist/scripts/index.d.ts.map +1 -1
  227. package/dist/scripts/publish-identity.d.ts.map +1 -1
  228. package/dist/scripts/publish-identity.js +1 -1
  229. package/dist/scripts/publish-identity.js.map +1 -1
  230. package/dist/scripts/rebuild-repo.d.ts.map +1 -1
  231. package/dist/scripts/rebuild-repo.js +1 -1
  232. package/dist/scripts/rebuild-repo.js.map +1 -1
  233. package/dist/scripts/rotate-keys.d.ts.map +1 -1
  234. package/dist/scripts/rotate-keys.js +2 -2
  235. package/dist/scripts/rotate-keys.js.map +1 -1
  236. package/dist/scripts/sequencer-recovery/index.d.ts.map +1 -1
  237. package/dist/scripts/sequencer-recovery/recoverer.d.ts.map +1 -1
  238. package/dist/scripts/sequencer-recovery/recoverer.js +7 -5
  239. package/dist/scripts/sequencer-recovery/recoverer.js.map +1 -1
  240. package/dist/scripts/sequencer-recovery/recovery-db.d.ts.map +1 -1
  241. package/dist/scripts/sequencer-recovery/repair-repos.d.ts.map +1 -1
  242. package/dist/scripts/sequencer-recovery/user-queues.d.ts.map +1 -1
  243. package/dist/scripts/util.d.ts.map +1 -1
  244. package/dist/sequencer/db/index.d.ts.map +1 -1
  245. package/dist/sequencer/db/migrations/index.d.ts.map +1 -1
  246. package/dist/sequencer/events.d.ts +19 -19
  247. package/dist/sequencer/events.d.ts.map +1 -1
  248. package/dist/sequencer/outbox.d.ts.map +1 -1
  249. package/dist/sequencer/outbox.js.map +1 -1
  250. package/dist/sequencer/sequencer.d.ts +8 -6
  251. package/dist/sequencer/sequencer.d.ts.map +1 -1
  252. package/dist/sequencer/sequencer.js +40 -21
  253. package/dist/sequencer/sequencer.js.map +1 -1
  254. package/dist/util/debug.d.ts.map +1 -1
  255. package/dist/well-known.d.ts.map +1 -1
  256. package/package.json +25 -26
  257. package/src/account-manager/account-manager.ts +26 -23
  258. package/src/account-manager/oauth-store.ts +55 -36
  259. package/src/api/com/atproto/admin/deleteAccount.ts +9 -7
  260. package/src/api/com/atproto/admin/updateSubjectStatus.ts +1 -1
  261. package/src/api/com/atproto/identity/submitPlcOperation.ts +1 -1
  262. package/src/api/com/atproto/server/activateAccount.ts +3 -3
  263. package/src/api/com/atproto/server/createAccount.ts +72 -63
  264. package/src/api/com/atproto/server/deactivateAccount.ts +1 -1
  265. package/src/api/com/atproto/server/deleteAccount.ts +9 -7
  266. package/src/api/com/atproto/sync/getRepo.ts +9 -1
  267. package/src/index.ts +3 -42
  268. package/src/rate-limits.ts +59 -0
  269. package/src/scripts/publish-identity.ts +1 -1
  270. package/src/scripts/rebuild-repo.ts +1 -1
  271. package/src/scripts/rotate-keys.ts +2 -2
  272. package/src/scripts/sequencer-recovery/recoverer.ts +9 -5
  273. package/src/sequencer/sequencer.ts +52 -23
  274. package/tests/db.test.ts +3 -3
  275. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"basic.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/site/standard/theme/basic.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAChC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C,QAAA,MAAM,KAAK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AAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;gBAKtD,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;gBAKhD,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;CAyCC,CAAA;AAC/D,eAAO,MAAM,aAAa;;YAzDhB,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;sBAKtC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;gBAKtD,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;gBAKhD,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,mBAAmB;EA0CS,CAAA"}
@@ -47,7 +47,7 @@ export declare const $params: l.ParamsSchema<{
47
47
  readonly lastReviewedBy: l.OptionalSchema<l.StringSchema<{
48
48
  readonly format: "did";
49
49
  }>>;
50
- readonly sortField: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"priorityScore" | "lastReviewedAt" | "lastReportedAt" | "reportedRecordsCount" | "takendownRecordsCount">>>;
50
+ readonly sortField: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"lastReportedAt" | "lastReviewedAt" | "priorityScore" | "reportedRecordsCount" | "takendownRecordsCount">>>;
51
51
  readonly sortDirection: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"asc" | "desc">>>;
52
52
  readonly takendown: l.OptionalSchema<l.BooleanSchema>;
53
53
  readonly appealed: l.OptionalSchema<l.BooleanSchema>;
@@ -123,7 +123,7 @@ declare const main: l.Query<"tools.ozone.moderation.queryStatuses", l.ParamsSche
123
123
  readonly lastReviewedBy: l.OptionalSchema<l.StringSchema<{
124
124
  readonly format: "did";
125
125
  }>>;
126
- readonly sortField: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"priorityScore" | "lastReviewedAt" | "lastReportedAt" | "reportedRecordsCount" | "takendownRecordsCount">>>;
126
+ readonly sortField: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"lastReportedAt" | "lastReviewedAt" | "priorityScore" | "reportedRecordsCount" | "takendownRecordsCount">>>;
127
127
  readonly sortDirection: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"asc" | "desc">>>;
128
128
  readonly takendown: l.OptionalSchema<l.BooleanSchema>;
129
129
  readonly appealed: l.OptionalSchema<l.BooleanSchema>;
@@ -6,7 +6,7 @@ export declare const $params: l.ParamsSchema<{
6
6
  readonly limit: l.OptionalSchema<l.WithDefaultSchema<l.IntegerSchema>>;
7
7
  readonly cursor: l.OptionalSchema<l.StringSchema<{}>>;
8
8
  readonly namePrefix: l.OptionalSchema<l.StringSchema<{}>>;
9
- readonly sortBy: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"name" | "createdAt" | "updatedAt">>>;
9
+ readonly sortBy: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"createdAt" | "name" | "updatedAt">>>;
10
10
  readonly sortDirection: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"asc" | "desc">>>;
11
11
  }>;
12
12
  export type $Params = l.InferOutput<typeof $params>;
@@ -21,7 +21,7 @@ declare const main: l.Query<"tools.ozone.set.querySets", l.ParamsSchema<{
21
21
  readonly limit: l.OptionalSchema<l.WithDefaultSchema<l.IntegerSchema>>;
22
22
  readonly cursor: l.OptionalSchema<l.StringSchema<{}>>;
23
23
  readonly namePrefix: l.OptionalSchema<l.StringSchema<{}>>;
24
- readonly sortBy: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"name" | "createdAt" | "updatedAt">>>;
24
+ readonly sortBy: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"createdAt" | "name" | "updatedAt">>>;
25
25
  readonly sortDirection: l.OptionalSchema<l.WithDefaultSchema<l.EnumSchema<"asc" | "desc">>>;
26
26
  }>, l.Payload<"application/json", l.ObjectSchema<{
27
27
  sets: l.ArraySchema<l.RefSchema<l.Validator<SetDefs.SetView, SetDefs.SetView>>>;
package/dist/logger.d.ts CHANGED
@@ -1,20 +1,19 @@
1
1
  import { type IncomingMessage } from 'node:http';
2
- export declare const blobStoreLogger: import("pino").default.Logger<never>;
3
- export declare const dbLogger: import("pino").default.Logger<never>;
4
- export declare const didCacheLogger: import("pino").default.Logger<never>;
5
- export declare const readStickyLogger: import("pino").default.Logger<never>;
6
- export declare const redisLogger: import("pino").default.Logger<never>;
7
- export declare const seqLogger: import("pino").default.Logger<never>;
8
- export declare const mailerLogger: import("pino").default.Logger<never>;
9
- export declare const labelerLogger: import("pino").default.Logger<never>;
10
- export declare const crawlerLogger: import("pino").default.Logger<never>;
11
- export declare const httpLogger: import("pino").default.Logger<never>;
12
- export declare const fetchLogger: import("pino").default.Logger<never>;
13
- export declare const oauthLogger: import("pino").default.Logger<never>;
14
- export declare const lexiconResolverLogger: import("pino").default.Logger<never>;
2
+ export declare const blobStoreLogger: import("pino").pino.Logger<never>;
3
+ export declare const dbLogger: import("pino").pino.Logger<never>;
4
+ export declare const didCacheLogger: import("pino").pino.Logger<never>;
5
+ export declare const readStickyLogger: import("pino").pino.Logger<never>;
6
+ export declare const redisLogger: import("pino").pino.Logger<never>;
7
+ export declare const seqLogger: import("pino").pino.Logger<never>;
8
+ export declare const mailerLogger: import("pino").pino.Logger<never>;
9
+ export declare const labelerLogger: import("pino").pino.Logger<never>;
10
+ export declare const crawlerLogger: import("pino").pino.Logger<never>;
11
+ export declare const httpLogger: import("pino").pino.Logger<never>;
12
+ export declare const fetchLogger: import("pino").pino.Logger<never>;
13
+ export declare const oauthLogger: import("pino").pino.Logger<never>;
14
+ export declare const lexiconResolverLogger: import("pino").pino.Logger<never>;
15
15
  export declare const loggerMiddleware: import("pino-http").HttpLogger<IncomingMessage, import("http").ServerResponse<IncomingMessage>, never>;
16
16
  export declare function reqSerializer(req: IncomingMessage): {
17
- headers: Record<string, string>;
18
17
  id: string | undefined;
19
18
  method: string;
20
19
  url: string;
@@ -23,5 +22,6 @@ export declare function reqSerializer(req: IncomingMessage): {
23
22
  params: Record<string, string>;
24
23
  query: Record<string, string>;
25
24
  raw: IncomingMessage;
25
+ headers: Record<string, string>;
26
26
  };
27
27
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAKhD,eAAO,MAAM,eAAe,sCAAoC,CAAA;AAChE,eAAO,MAAM,QAAQ,sCAA4B,CAAA;AACjD,eAAO,MAAM,cAAc,sCAAmC,CAAA;AAC9D,eAAO,MAAM,gBAAgB,sCAAqC,CAAA;AAClE,eAAO,MAAM,WAAW,sCAA+B,CAAA;AACvD,eAAO,MAAM,SAAS,sCAAmC,CAAA;AACzD,eAAO,MAAM,YAAY,sCAAgC,CAAA;AACzD,eAAO,MAAM,aAAa,sCAAiC,CAAA;AAC3D,eAAO,MAAM,aAAa,sCAAiC,CAAA;AAC3D,eAAO,MAAM,UAAU,sCAAyB,CAAA;AAChD,eAAO,MAAM,WAAW,sCAA+B,CAAA;AACvD,eAAO,MAAM,WAAW,sCAA+B,CAAA;AACvD,eAAO,MAAM,qBAAqB,sCAA0C,CAAA;AAE5E,eAAO,MAAM,gBAAgB,wGAS3B,CAAA;AAEF,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe;;;;;;;;;;EAIjD"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAKhD,eAAO,MAAM,eAAe,mCAAoC,CAAA;AAChE,eAAO,MAAM,QAAQ,mCAA4B,CAAA;AACjD,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,CAAC;YAC1C,GAAG,QAAQ;YACX,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,WAAW;YAC9C,IAAI;SACL,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YACzB,YAAY,CAAC,KAAK,CAChB,4DAA4D;gBAC1D,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAC/B,CAAA;QACH,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF","sourcesContent":["import { SendMailOptions, Transporter } from 'nodemailer'\nimport { htmlToText } from 'nodemailer-html-to-text'\nimport { BrandingConfig, EmailConfig } from '../config/index.js'\nimport { mailerLogger } from '../logger.js'\nimport * as templates from './templates.js'\n\n// @TODO Add support for i18n\n\nconst DEFAULT_LOGO_URL =\n 'https://bsky.social/about/images/email/email_logo_default.png'\nconst DEFAULT_MARK_URL =\n 'https://bsky.social/about/images/email/email_mark_dark.png'\nconst DEFAULT_HOME_URL = 'https://bsky.app'\nconst DEFAULT_PRIMARY_COLOR = '#067df7'\n\nexport class ServerMailer {\n private readonly config: templates.Config\n\n constructor(\n public readonly transporter: Transporter,\n private readonly email: EmailConfig | null,\n branding: BrandingConfig,\n ) {\n transporter.use('compile', htmlToText())\n\n this.config = {\n serviceName: branding.name ?? 'Bluesky',\n homeUrl:\n branding.links?.find((link) => link.rel === 'canonical')?.href ??\n DEFAULT_HOME_URL,\n logoUrl: branding.logo ?? DEFAULT_LOGO_URL,\n markUrl: branding.logo ?? DEFAULT_MARK_URL,\n primaryColor: branding.colors?.primary ?? DEFAULT_PRIMARY_COLOR,\n showBskyAppEmailConfirmationLink: email?.disableConfirmationLink !== true,\n }\n }\n\n async sendResetPassword(\n params: { handle: string; token: string },\n mailOpts: SendMailOptions,\n ) {\n await this.sendTemplate('resetPassword', params, {\n subject: 'Password Reset Requested',\n ...mailOpts,\n })\n }\n\n async sendAccountDelete(\n params: { token: string },\n mailOpts: SendMailOptions,\n ) {\n await this.sendTemplate('deleteAccount', params, {\n subject: 'Account Deletion Requested',\n ...mailOpts,\n })\n }\n\n async sendConfirmEmail(\n params: { token: string; locale?: string },\n mailOpts: SendMailOptions,\n ) {\n // @TODO (later) handle locale in the template\n await this.sendTemplate('confirmEmail', params, {\n subject: 'Email Confirmation',\n ...mailOpts,\n })\n }\n\n async sendUpdateEmail(\n params: { token: string; locale?: string },\n mailOpts: SendMailOptions,\n ) {\n // @TODO (later) handle locale in the template\n await this.sendTemplate('updateEmail', params, {\n subject: 'Email Update Requested',\n ...mailOpts,\n })\n }\n\n async sendPlcOperation(params: { token: string }, mailOpts: SendMailOptions) {\n await this.sendTemplate('plcOperation', params, {\n subject: 'PLC Update Operation Requested',\n ...mailOpts,\n })\n }\n\n private async sendTemplate<K extends keyof typeof templates>(\n templateName: K,\n params: Parameters<(typeof templates)[K]>[0],\n mailOpts: SendMailOptions,\n ) {\n const html = templates[templateName]({\n ...params,\n config: this.config,\n } as any)\n const res = await this.transporter.sendMail({\n ...mailOpts,\n from: mailOpts.from ?? this.email?.fromAddress,\n html,\n })\n if (!this.email?.smtpUrl) {\n mailerLogger.debug(\n 'No SMTP URL has been configured. Intended to send email:\\n' +\n JSON.stringify(res, null, 2),\n )\n }\n return res\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mailer/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C,6BAA6B;AAE7B,MAAM,gBAAgB,GACpB,+DAA+D,CAAA;AACjE,MAAM,gBAAgB,GACpB,4DAA4D,CAAA;AAC9D,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAC3C,MAAM,qBAAqB,GAAG,SAAS,CAAA;AAEvC,M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,CAAC,eAAe,CACnB,MAA0C,EAC1C,QAAyB;QAEzB,8CAA8C;QAC9C,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE;YAC7C,OAAO,EAAE,wBAAwB;YACjC,GAAG,QAAQ;SACZ,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,MAAyB,EAAE,QAAyB;QACzE,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE;YAC9C,OAAO,EAAE,gCAAgC;YACzC,GAAG,QAAQ;SACZ,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,YAAY,CACxB,YAAe,EACf,MAA4C,EAC5C,QAAyB;QAEzB,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;YACnC,GAAG,MAAM;YACT,MAAM,EAAE,IAAI,CAAC,MAAM;SACb,CAAC,CAAA;QACT,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;YAC1C,GAAG,QAAQ;YACX,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,WAAW;YAC9C,IAAI;SACL,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YACzB,YAAY,CAAC,KAAK,CAChB,4DAA4D;gBAC1D,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAC/B,CAAA;QACH,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF","sourcesContent":["import { SendMailOptions, Transporter } from 'nodemailer'\nimport { htmlToText } from 'nodemailer-html-to-text'\nimport { BrandingConfig, EmailConfig } from '../config/index.js'\nimport { mailerLogger } from '../logger.js'\nimport * as templates from './templates.js'\n\n// @TODO Add support for i18n\n\nconst DEFAULT_LOGO_URL =\n 'https://bsky.social/about/images/email/email_logo_default.png'\nconst DEFAULT_MARK_URL =\n 'https://bsky.social/about/images/email/email_mark_dark.png'\nconst DEFAULT_HOME_URL = 'https://bsky.app'\nconst DEFAULT_PRIMARY_COLOR = '#067df7'\n\nexport class ServerMailer {\n private readonly config: templates.Config\n\n constructor(\n public readonly transporter: Transporter,\n private readonly email: EmailConfig | null,\n branding: BrandingConfig,\n ) {\n transporter.use('compile', htmlToText())\n\n this.config = {\n serviceName: branding.name ?? 'Bluesky',\n homeUrl:\n branding.links?.find((link) => link.rel === 'canonical')?.href ??\n DEFAULT_HOME_URL,\n logoUrl: branding.logo ?? DEFAULT_LOGO_URL,\n markUrl: branding.logo ?? DEFAULT_MARK_URL,\n primaryColor: branding.colors?.primary ?? DEFAULT_PRIMARY_COLOR,\n showBskyAppEmailConfirmationLink: email?.disableConfirmationLink !== true,\n }\n }\n\n async sendResetPassword(\n params: { handle: string; token: string },\n mailOpts: SendMailOptions,\n ) {\n await this.sendTemplate('resetPassword', params, {\n subject: 'Password Reset Requested',\n ...mailOpts,\n })\n }\n\n async sendAccountDelete(\n params: { token: string },\n mailOpts: SendMailOptions,\n ) {\n await this.sendTemplate('deleteAccount', params, {\n subject: 'Account Deletion Requested',\n ...mailOpts,\n })\n }\n\n async sendConfirmEmail(\n params: { token: string; locale?: string },\n mailOpts: SendMailOptions,\n ) {\n // @TODO (later) handle locale in the template\n await this.sendTemplate('confirmEmail', params, {\n subject: 'Email Confirmation',\n ...mailOpts,\n })\n }\n\n async sendUpdateEmail(\n params: { token: string; locale?: string },\n mailOpts: SendMailOptions,\n ) {\n // @TODO (later) handle locale in the template\n await this.sendTemplate('updateEmail', params, {\n subject: 'Email Update Requested',\n ...mailOpts,\n })\n }\n\n async sendPlcOperation(params: { token: string }, mailOpts: SendMailOptions) {\n await this.sendTemplate('plcOperation', params, {\n subject: 'PLC Update Operation Requested',\n ...mailOpts,\n })\n }\n\n private async sendTemplate<K extends keyof typeof templates>(\n templateName: K,\n params: Parameters<(typeof templates)[K]>[0],\n mailOpts: SendMailOptions,\n ) {\n const html = templates[templateName]({\n ...params,\n config: this.config,\n } as any)\n const res = await this.transporter.sendMail({\n ...mailOpts,\n from: mailOpts.from ?? this.email?.fromAddress,\n html,\n })\n if (!this.email?.smtpUrl) {\n mailerLogger.debug(\n 'No SMTP URL has been configured. Intended to send email:\\n' +\n JSON.stringify(res, null, 2),\n )\n }\n return res\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/mailer/moderation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAc;IAC5B,WAAW,EAAE,WAAW,CAAA;gBAEZ,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY;IAMpD,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,eAAe;CAiBvE"}
1
+ {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/mailer/moderation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAc;IAC5B,WAAW,EAAE,WAAW,CAAA;IAExB,YAAY,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAIzD;IAEK,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,eAAe,gBAgBrE;CACF"}
@@ -33,7 +33,7 @@ export declare function parseProxyInfo(ctx: AppContext, req: Request, lxm: strin
33
33
  did: string;
34
34
  serviceId: string;
35
35
  }>;
36
- export declare const parseProxyHeader: (ctx: Pick<AppContext, "cfg" | "idResolver">, proxyTo: string) => Promise<{
36
+ export declare const parseProxyHeader: (ctx: Pick<AppContext, 'cfg' | 'idResolver'>, proxyTo: string) => Promise<{
37
37
  did: string;
38
38
  url: string;
39
39
  serviceId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"pipethrough.d.ts","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAkB,MAAM,WAAW,CAAA;AAC/D,OAAO,EAAe,QAAQ,EAAY,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AASjC,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EAIxB,SAAS,IAAI,eAAe,EAG7B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIzC,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,eAiG9C,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAsB,WAAW,CAC/B,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CACR,wBAAwB,GAAG;IACzB,MAAM,EAAE,QAAQ,CAAA;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAA;CACjB,CACF,CAsDA;AAKD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,MAAM,GACV,MAAM,CAUR;AAID,wBAAg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wBAAyB,SAAQ,eAAe;IAC3D,YACW,QAGR,EACD,OAA6C,EAC7C,OAAsB;QAEtB,MAAM,MAAM,GACV,QAAQ,CAAC,UAAU,KAAK,GAAG;YACzB,CAAC,CAAC,YAAY,CAAC,eAAe;YAC9B,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAA;QAEzB,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAZ7C,aAAQ,GAAR,QAAQ,CAGhB;IAUH,CAAC;IAED,IAAI,OAAO;QACT,OAAO,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,QAAQ,CAAA;IAC9C,CAAC;CACF","sourcesContent":["import { IncomingHttpHeaders, ServerResponse } from 'node:http'\nimport { PassThrough, Readable, finished } from 'node:stream'\nimport { Request } from 'express'\nimport { Dispatcher } from 'undici'\nimport {\n decodeStream,\n getServiceEndpoint,\n omit,\n streamToNodeBuffer,\n} from '@atproto/common'\nimport { RpcPermissionMatch } from '@atproto/oauth-scopes'\nimport {\n CatchallHandler,\n HandlerPipeThroughBuffer,\n HandlerPipeThroughStream,\n InternalServerError,\n InvalidRequestError,\n ResponseType,\n XRPCError as XRPCServerError,\n excludeErrorResult,\n parseReqNsid,\n} from '@atproto/xrpc-server'\nimport { buildProxiedContentEncoding } from '@atproto-labs/xrpc-utils'\nimport { isAccessPrivileged } from './auth-scope.js'\nimport { AppContext } from './context.js'\nimport { chat, com, tools } from './lexicons/index.js'\nimport { httpLogger } from './logger.js'\n\nexport const proxyHandler = (ctx: AppContext): CatchallHandler => {\n const performAuth = ctx.authVerifier.authorization<RpcPermissionMatch>({\n authorize: (permissions, { params }) => permissions.assertRpc(params),\n })\n\n return async (req, res, next) => {\n // /!\\ Hot path\n try {\n if (\n req.method !== 'GET' &&\n req.method !== 'HEAD' &&\n req.method !== 'POST'\n ) {\n throw new XRPCServerError(\n ResponseType.InvalidRequest,\n 'XRPC requests only supports GET and POST',\n )\n }\n\n const body = req.method === 'POST' ? req : undefined\n if (body != null && !body.readable) {\n // Body was already consumed by a previous middleware\n throw new InternalServerError('Request body is not readable')\n }\n\n const lxm = parseReqNsid(req)\n if (PROTECTED_METHODS.has(lxm)) {\n throw new InvalidRequestError('Bad token method', 'InvalidToken')\n }\n\n const {\n url: origin,\n did,\n serviceId,\n } = await parseProxyInfo(ctx, req, lxm)\n // Phase 1 of service auth updates: the scope check sees the combined\n // did#serviceId form (so OAuth callers' rpc:?aud=did#service scopes\n // match), while the outbound service-auth JWT keeps bare-DID aud\n // regardless of session type.\n const scopeAud = `${did}#${serviceId}`\n const tokenAud = did\n\n const authResult = await performAuth({\n req,\n res,\n params: { lxm, aud: scopeAud },\n })\n\n const { credentials } = excludeErrorResult(authResult)\n\n if (\n credentials.type === 'access' &&\n !isAccessPrivileged(credentials.scope) &&\n PRIVILEGED_METHODS.has(lxm)\n ) {\n throw new InvalidRequestError('Bad token method', 'InvalidToken')\n }\n\n const headers: IncomingHttpHeaders = {\n 'accept-encoding': req.headers['accept-encoding'] || 'identity',\n 'accept-language': req.headers['accept-language'],\n 'atproto-accept-labelers': req.headers['atproto-accept-labelers'],\n 'x-bsky-topics': req.headers['x-bsky-topics'],\n\n 'content-type': body && req.headers['content-type'],\n 'content-encoding': body && req.headers['content-encoding'],\n 'content-length': body && req.headers['content-length'],\n\n authorization: `Bearer ${await ctx.serviceAuthJwt(credentials.did, tokenAud, lxm)}`,\n }\n\n const dispatchOptions: Dispatcher.RequestOptions = {\n origin,\n method: req.method,\n path: req.originalUrl,\n body,\n headers,\n }\n\n await pipethroughStream(ctx, req, dispatchOptions, (upstream) => {\n res.status(upstream.statusCode)\n\n for (const [name, val] of responseHeaders(upstream.headers)) {\n res.setHeader(name, val)\n }\n\n // Note that we should not need to manually handle errors here (e.g. by\n // destroying the response), as the http server will handle them for us.\n res.on('error', logResponseError)\n\n // Tell undici to write the upstream response directly to the response\n return res\n })\n } catch (err) {\n next(err)\n }\n }\n}\n\nexport type PipethroughOptions = {\n /**\n * Specify the issuer (requester) for service auth. If not provided, no\n * authorization headers will be added to the request.\n */\n iss?: string\n\n /**\n * Override the audience for service auth. If not provided, the audience will\n * be determined based on the proxy service.\n */\n aud?: string\n\n /**\n * Override the lexicon method for service auth. If not provided, the lexicon\n * method will be determined based on the request path.\n */\n lxm?: string\n}\n\nexport async function pipethrough(\n ctx: AppContext,\n req: Request,\n options?: PipethroughOptions,\n): Promise<\n HandlerPipeThroughStream & {\n stream: Readable\n headers: Record<string, string>\n encoding: string\n }\n> {\n if (req.method !== 'GET' && req.method !== 'HEAD') {\n // pipethrough() is used from within xrpcServer handlers, which means that\n // the request body either has been parsed or is a readable stream that has\n // been piped for decoding & size limiting. Because of this, forwarding the\n // request body requires re-encoding it. Since we currently do not use\n // pipethrough() with procedures, proxying of request body is not\n // implemented.\n throw new InternalServerError(\n `Proxying of ${req.method} requests is not supported`,\n )\n }\n\n const lxm = parseReqNsid(req)\n\n const { url: origin, did: aud } = await parseProxyInfo(ctx, req, lxm)\n\n const dispatchOptions: Dispatcher.RequestOptions = {\n origin,\n method: req.method,\n path: req.originalUrl,\n headers: {\n 'accept-language': req.headers['accept-language'],\n 'atproto-accept-labelers': req.headers['atproto-accept-labelers'],\n 'x-bsky-topics': req.headers['x-bsky-topics'],\n\n // Because we sometimes need to interpret the response (e.g. during\n // read-after-write, through asPipeThroughBuffer()), we need to ask the\n // upstream server for an encoding that both the requester and the PDS can\n // understand. Since we might have to do the decoding ourselves, we will\n // use our own preferences (and weight) to negotiate the encoding.\n 'accept-encoding': buildProxiedContentEncoding(\n req.headers['accept-encoding'],\n ctx.cfg.proxy.preferCompressed,\n ),\n\n authorization: options?.iss\n ? `Bearer ${await ctx.serviceAuthJwt(options.iss, options.aud ?? aud, options.lxm ?? lxm)}`\n : undefined,\n },\n\n // Use a high water mark to buffer more data while performing async\n // operations before this stream is consumed. This is especially useful\n // while processing read-after-write operations.\n highWaterMark: 2 * 65536, // twice the default (64KiB)\n }\n\n const { headers, body } = await pipethroughRequest(ctx, req, dispatchOptions)\n\n return {\n encoding: safeString(headers['content-type']) ?? 'application/json',\n headers: Object.fromEntries(responseHeaders(headers)),\n stream: body,\n }\n}\n\n// Request setup/formatting\n// -------------------\n\nexport function computeProxyTo(\n ctx: AppContext,\n req: Request,\n lxm: string,\n): string {\n const proxyToHeader = req.header('atproto-proxy')\n if (proxyToHeader) return proxyToHeader\n\n const service = defaultService(ctx, lxm)\n if (service.serviceInfo) {\n return `${service.serviceInfo.did}#${service.serviceId}`\n }\n\n throw new InvalidRequestError(`No service configured for ${lxm}`)\n}\n\n// Bare-DID portion of `proxyTo`, suitable as a service-auth JWT audience\n// (Phase 1 of service auth updates).\nexport function bareDidFromProxyTo(proxyTo: string): string {\n const hashIndex = proxyTo.indexOf('#')\n return hashIndex === -1 ? proxyTo : proxyTo.slice(0, hashIndex)\n}\n\nexport async function parseProxyInfo(\n ctx: AppContext,\n req: Request,\n lxm: string,\n): Promise<{ url: string; did: string; serviceId: string }> {\n // /!\\ Hot path\n\n const proxyToHeader = req.header('atproto-proxy')\n if (proxyToHeader) return parseProxyHeader(ctx, proxyToHeader)\n\n const { serviceId, serviceInfo } = defaultService(ctx, lxm)\n if (serviceInfo) return { ...serviceInfo, serviceId }\n\n throw new InvalidRequestError(`No service configured for ${lxm}`)\n}\n\nexport const parseProxyHeader = async (\n // Using subset of AppContext for testing purposes\n ctx: Pick<AppContext, 'cfg' | 'idResolver'>,\n proxyTo: string,\n): Promise<{ did: string; url: string; serviceId: string }> => {\n // /!\\ Hot path\n\n const hashIndex = proxyTo.indexOf('#')\n\n if (hashIndex === 0) {\n throw new InvalidRequestError('no did specified in proxy header')\n }\n\n if (hashIndex === -1 || hashIndex === proxyTo.length - 1) {\n throw new InvalidRequestError('no service id specified in proxy header')\n }\n\n // More than one hash\n if (proxyTo.indexOf('#', hashIndex + 1) !== -1) {\n throw new InvalidRequestError('invalid proxy header format')\n }\n\n // Basic validation\n if (proxyTo.includes(' ')) {\n throw new InvalidRequestError('proxy header cannot contain spaces')\n }\n\n const did = proxyTo.slice(0, hashIndex)\n const serviceId = proxyTo.slice(hashIndex + 1)\n\n // Special case a configured appview, while still proxying correctly any other appview\n if (\n ctx.cfg.bskyAppView &&\n proxyTo === `${ctx.cfg.bskyAppView.did}#bsky_appview`\n ) {\n return { did, url: ctx.cfg.bskyAppView.url, serviceId }\n }\n\n const didDoc = await ctx.idResolver.did.resolve(did)\n if (!didDoc) {\n throw new InvalidRequestError('could not resolve proxy did')\n }\n\n const url = getServiceEndpoint(didDoc, { id: `#${serviceId}` })\n if (!url) {\n throw new InvalidRequestError('could not resolve proxy did service url')\n }\n\n return { did, url, serviceId }\n}\n\n/**\n * Utility function that wraps the undici stream() function and handles request\n * and response errors by wrapping them in XRPCError instances. This function is\n * more efficient than \"pipethroughRequest\" when a writable stream to pipe the\n * upstream response to is available.\n */\nasync function pipethroughStream(\n ctx: AppContext,\n req: Request,\n dispatchOptions: Dispatcher.RequestOptions,\n successStreamFactory: Dispatcher.StreamFactory,\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n void ctx.proxyAgent\n .stream(dispatchOptions, (upstream) => {\n if (upstream.statusCode >= 400) {\n const passThrough = new PassThrough()\n\n void tryParsingError(upstream.headers, passThrough).then((parsed) => {\n const xrpcError = new PipethroughUpstreamError(upstream, parsed, {\n cause: dispatchOptions,\n })\n\n reject(xrpcError)\n }, reject)\n\n return passThrough\n }\n\n const writable = successStreamFactory(upstream)\n\n // As soon as the control was passed to the writable stream (i.e. by\n // returning the writable hereafter), pipethroughStream() is considered\n // to have succeeded. Any error occurring while writing upstream data to\n // the writable stream should be handled through the stream's error\n // state (i.e. successStreamFactory() must ensure that error events on\n // the returned writable will be handled).\n resolve()\n\n return writable\n })\n // The following catch block will be triggered with either network errors\n // or writable stream errors. In the latter case, the promise will already\n // be resolved, and reject()ing it there after will have no effect. Those\n // error would still be logged by the successStreamFactory() function.\n .catch(handleUpstreamRequestError.bind(req))\n .catch(reject)\n })\n}\n\n/**\n * Utility function that wraps the undici request() function and handles request\n * and response errors by wrapping them in XRPCError instances.\n */\nasync function pipethroughRequest(\n ctx: AppContext,\n req: Request,\n dispatchOptions: Dispatcher.RequestOptions,\n) {\n // HandlerPipeThroughStream requires a readable stream to be returned, so we\n // use the (less efficient) request() function instead.\n\n const upstream = await ctx.proxyAgent\n .request(dispatchOptions)\n .catch(handleUpstreamRequestError.bind(req))\n\n if (upstream.statusCode >= 400) {\n const parsed = await tryParsingError(upstream.headers, upstream.body)\n\n throw new PipethroughUpstreamError(upstream, parsed, {\n cause: dispatchOptions,\n })\n }\n\n return upstream\n}\n\nfunction handleUpstreamRequestError(\n this: Request,\n err: unknown,\n message = 'Upstream service unreachable',\n): never {\n const logger = isPinoHttpRequest(this) ? this.log : httpLogger\n logger.error({ err }, message)\n throw new XRPCServerError(ResponseType.UpstreamFailure, message, undefined, {\n cause: err,\n })\n}\n\nfunction isPinoHttpRequest(req: Request): req is Request & {\n log: { error: (obj: unknown, msg: string) => void }\n} {\n return typeof (req as { log?: any }).log?.error === 'function'\n}\n\n// Request parsing/forwarding\n// -------------------\n\nexport function isJsonContentType(contentType?: string): boolean | undefined {\n if (!contentType) return undefined\n return /application\\/(?:\\w+\\+)?json/i.test(contentType)\n}\n\nasync function tryParsingError(\n headers: IncomingHttpHeaders,\n readable: Readable,\n): Promise<{ error?: string; message?: string }> {\n if (isJsonContentType(headers['content-type']) === false) {\n // We don't known how to parse non JSON content types so we can discard the\n // whole response.\n\n // Since we don't care about the response, we would normally just destroy\n // the stream. However, if the underlying HTTP connection is an HTTP/1.1\n // connection, this also destroys the underlying (keep-alive) TCP socket. In\n // order to avoid destroying the TCP socket, while avoiding the cost of\n // consuming too much IO, we give it a chance to finish first.\n\n // @NOTE we need to listen (and ignore) \"error\" events, otherwise the\n // process could crash (since we drain the stream asynchronously here). This\n // is performed through the \"finished\" call below.\n\n const to = setTimeout(() => {\n readable.destroy()\n }, 100)\n finished(readable, (_err) => {\n clearTimeout(to)\n })\n readable.resume()\n\n return {}\n }\n\n try {\n const buffer = await bufferUpstreamResponse(\n readable,\n headers['content-encoding'],\n )\n\n const errInfo: unknown = JSON.parse(buffer.toString('utf8'))\n return {\n error: safeString(errInfo?.['error']),\n message: safeString(errInfo?.['message']),\n }\n } catch (err) {\n // Failed to read, decode, buffer or parse. No big deal.\n return {}\n }\n}\n\nasync function bufferUpstreamResponse(\n readable: Readable,\n contentEncoding?: string | string[],\n): Promise<Buffer> {\n try {\n return await streamToNodeBuffer(decodeStream(readable, contentEncoding))\n } catch (err) {\n if (!readable.destroyed) readable.destroy()\n\n throw new XRPCServerError(\n ResponseType.UpstreamFailure,\n err instanceof TypeError ? err.message : 'unable to decode request body',\n undefined,\n { cause: err },\n )\n }\n}\n\nexport async function asPipeThroughBuffer(\n input: HandlerPipeThroughStream,\n): Promise<HandlerPipeThroughBuffer> {\n return {\n buffer: await bufferUpstreamResponse(\n input.stream,\n input.headers?.['content-encoding'],\n ),\n headers: omit(input.headers, ['content-encoding', 'content-length']),\n encoding: input.encoding,\n }\n}\n\n// Response parsing/forwarding\n// -------------------\n\nconst RES_HEADERS_TO_FORWARD = [\n 'atproto-repo-rev',\n 'atproto-content-labelers',\n 'retry-after',\n]\n\nfunction* responseHeaders(\n headers: IncomingHttpHeaders,\n includeContentHeaders = true,\n): Generator<[string, string]> {\n if (includeContentHeaders) {\n const length = headers['content-length']\n if (length) yield ['content-length', length]\n\n const encoding = headers['content-encoding']\n if (encoding) yield ['content-encoding', encoding]\n\n const type = headers['content-type']\n if (type) yield ['content-type', type]\n\n const language = headers['content-language']\n if (language) yield ['content-language', language]\n }\n\n for (let i = 0; i < RES_HEADERS_TO_FORWARD.length; i++) {\n const name = RES_HEADERS_TO_FORWARD[i]\n const val = headers[name]\n\n if (val != null) {\n const value: string = Array.isArray(val) ? val.join(',') : val\n yield [name, value]\n }\n }\n}\n\n// Utils\n// -------------------\n\n/**\n * Performs lexicon method matching on a set of methods,\n * taking into account that they are treated case-insensitively.\n */\nexport class LxmSet {\n private inner: Set<string>\n private original: Iterable<string>\n constructor(items: Iterable<string>) {\n this.inner = new Set(Array.from(items, normalizeLxm))\n this.original = items\n }\n has(lxm: string) {\n return this.inner.has(normalizeLxm(lxm))\n }\n *[Symbol.iterator](): Iterator<string> {\n yield* this.original\n }\n}\n\nexport function normalizeLxm(lxm: string) {\n return lxm.toLowerCase()\n}\n\nexport const CHAT_BSKY_METHODS = new LxmSet([\n chat.bsky.actor.deleteAccount.$lxm,\n chat.bsky.actor.exportAccountData.$lxm,\n chat.bsky.convo.deleteMessageForSelf.$lxm,\n chat.bsky.convo.getConvo.$lxm,\n chat.bsky.convo.getConvoForMembers.$lxm,\n chat.bsky.convo.getLog.$lxm,\n chat.bsky.convo.getMessages.$lxm,\n chat.bsky.convo.leaveConvo.$lxm,\n chat.bsky.convo.listConvos.$lxm,\n chat.bsky.convo.muteConvo.$lxm,\n chat.bsky.convo.sendMessage.$lxm,\n chat.bsky.convo.sendMessageBatch.$lxm,\n chat.bsky.convo.unmuteConvo.$lxm,\n chat.bsky.convo.updateRead.$lxm,\n])\n\nexport const PRIVILEGED_METHODS = new LxmSet([\n ...CHAT_BSKY_METHODS,\n com.atproto.server.createAccount.$lxm,\n])\n\n// These endpoints are related to account management and must be used directly,\n// not proxied or service-authed. Service auth may be utilized between PDS and\n// entryway for these methods.\nexport const PROTECTED_METHODS = new LxmSet([\n com.atproto.admin.sendEmail.$lxm,\n com.atproto.identity.requestPlcOperationSignature.$lxm,\n com.atproto.identity.signPlcOperation.$lxm,\n com.atproto.identity.updateHandle.$lxm,\n com.atproto.server.activateAccount.$lxm,\n com.atproto.server.confirmEmail.$lxm,\n com.atproto.server.createAppPassword.$lxm,\n com.atproto.server.deactivateAccount.$lxm,\n com.atproto.server.getAccountInviteCodes.$lxm,\n com.atproto.server.getSession.$lxm,\n com.atproto.server.listAppPasswords.$lxm,\n com.atproto.server.requestAccountDelete.$lxm,\n com.atproto.server.requestEmailConfirmation.$lxm,\n com.atproto.server.requestEmailUpdate.$lxm,\n com.atproto.server.revokeAppPassword.$lxm,\n com.atproto.server.updateEmail.$lxm,\n])\n\nconst defaultService = (\n ctx: AppContext,\n nsid: string,\n): {\n serviceId: string\n serviceInfo: { url: string; did: string } | null\n} => {\n switch (nsid) {\n case tools.ozone.communication.createTemplate.$lxm:\n case tools.ozone.communication.deleteTemplate.$lxm:\n case tools.ozone.communication.listTemplates.$lxm:\n case tools.ozone.communication.updateTemplate.$lxm:\n case tools.ozone.moderation.cancelScheduledActions.$lxm:\n case tools.ozone.moderation.emitEvent.$lxm:\n case tools.ozone.moderation.getAccountTimeline.$lxm:\n case tools.ozone.moderation.getEvent.$lxm:\n case tools.ozone.moderation.getRecord.$lxm:\n case tools.ozone.moderation.getRepo.$lxm:\n case tools.ozone.moderation.listScheduledActions.$lxm:\n case tools.ozone.moderation.queryEvents.$lxm:\n case tools.ozone.moderation.queryStatuses.$lxm:\n case tools.ozone.moderation.scheduleAction.$lxm:\n case tools.ozone.moderation.searchRepos.$lxm:\n case tools.ozone.safelink.addRule.$lxm:\n case tools.ozone.safelink.queryEvents.$lxm:\n case tools.ozone.safelink.queryRules.$lxm:\n case tools.ozone.safelink.removeRule.$lxm:\n case tools.ozone.safelink.updateRule.$lxm:\n case tools.ozone.team.addMember.$lxm:\n case tools.ozone.team.deleteMember.$lxm:\n case tools.ozone.team.listMembers.$lxm:\n case tools.ozone.team.updateMember.$lxm:\n case tools.ozone.verification.grantVerifications.$lxm:\n case tools.ozone.verification.listVerifications.$lxm:\n case tools.ozone.verification.revokeVerifications.$lxm:\n return {\n serviceId: 'atproto_labeler',\n serviceInfo: ctx.cfg.modService,\n }\n case com.atproto.moderation.createReport.$lxm:\n return {\n serviceId: 'atproto_labeler',\n serviceInfo: ctx.cfg.reportService,\n }\n default:\n return {\n serviceId: 'bsky_appview',\n serviceInfo: ctx.cfg.bskyAppView,\n }\n }\n}\n\nconst safeString = (str: unknown): string | undefined => {\n return typeof str === 'string' ? str : undefined\n}\n\nfunction logResponseError(this: ServerResponse, err: unknown): void {\n httpLogger.warn({ err }, 'error forwarding upstream response')\n}\n\nexport class PipethroughUpstreamError extends XRPCServerError {\n constructor(\n readonly upstream: {\n statusCode: number\n headers: IncomingHttpHeaders\n },\n payload: { message?: string; error?: string },\n options?: ErrorOptions,\n ) {\n const status =\n upstream.statusCode === 500\n ? ResponseType.UpstreamFailure\n : upstream.statusCode\n\n super(status, payload.message, payload.error, options)\n }\n\n get headers(): Record<string, string> {\n return Object.fromEntries(responseHeaders(this.upstream.headers, false))\n }\n\n get error() {\n return this.customErrorName ?? this.typeName\n }\n}\n"]}
1
+ {"version":3,"file":"pipethrough.js","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAY,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG7D,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAIL,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,SAAS,IAAI,eAAe,EAC5B,kBAAkB,EAClB,YAAY,GACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAe,EAAmB,EAAE;IAC/D,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY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EAAE,GAAG,EAAE,EAAE,oCAAoC,CAAC,CAAA;AAChE,CAAC;AAED,MAAM,OAAO,wBAAyB,SAAQ,eAAe;IAC3D,YACW,QAGR,EACD,OAA6C,EAC7C,OAAsB;QAEtB,MAAM,MAAM,GACV,QAAQ,CAAC,UAAU,KAAK,GAAG;YACzB,CAAC,CAAC,YAAY,CAAC,eAAe;YAC9B,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAA;QAEzB,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;wBAZ7C,QAAQ;IAanB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,QAAQ,CAAA;IAC9C,CAAC;CACF","sourcesContent":["import { IncomingHttpHeaders, ServerResponse } from 'node:http'\nimport { PassThrough, Readable, finished } from 'node:stream'\nimport { Request } from 'express'\nimport { Dispatcher } from 'undici'\nimport {\n decodeStream,\n getServiceEndpoint,\n omit,\n streamToNodeBuffer,\n} from '@atproto/common'\nimport { RpcPermissionMatch } from '@atproto/oauth-scopes'\nimport {\n CatchallHandler,\n HandlerPipeThroughBuffer,\n HandlerPipeThroughStream,\n InternalServerError,\n InvalidRequestError,\n ResponseType,\n XRPCError as XRPCServerError,\n excludeErrorResult,\n parseReqNsid,\n} from '@atproto/xrpc-server'\nimport { buildProxiedContentEncoding } from '@atproto-labs/xrpc-utils'\nimport { isAccessPrivileged } from './auth-scope.js'\nimport { AppContext } from './context.js'\nimport { chat, com, tools } from './lexicons/index.js'\nimport { httpLogger } from './logger.js'\n\nexport const proxyHandler = (ctx: AppContext): CatchallHandler => {\n const performAuth = ctx.authVerifier.authorization<RpcPermissionMatch>({\n authorize: (permissions, { params }) => permissions.assertRpc(params),\n })\n\n return async (req, res, next) => {\n // /!\\ Hot path\n try {\n if (\n req.method !== 'GET' &&\n req.method !== 'HEAD' &&\n req.method !== 'POST'\n ) {\n throw new XRPCServerError(\n ResponseType.InvalidRequest,\n 'XRPC requests only supports GET and POST',\n )\n }\n\n const body = req.method === 'POST' ? req : undefined\n if (body != null && !body.readable) {\n // Body was already consumed by a previous middleware\n throw new InternalServerError('Request body is not readable')\n }\n\n const lxm = parseReqNsid(req)\n if (PROTECTED_METHODS.has(lxm)) {\n throw new InvalidRequestError('Bad token method', 'InvalidToken')\n }\n\n const {\n url: origin,\n did,\n serviceId,\n } = await parseProxyInfo(ctx, req, lxm)\n // Phase 1 of service auth updates: the scope check sees the combined\n // did#serviceId form (so OAuth callers' rpc:?aud=did#service scopes\n // match), while the outbound service-auth JWT keeps bare-DID aud\n // regardless of session type.\n const scopeAud = `${did}#${serviceId}`\n const tokenAud = did\n\n const authResult = await performAuth({\n req,\n res,\n params: { lxm, aud: scopeAud },\n })\n\n const { credentials } = excludeErrorResult(authResult)\n\n if (\n credentials.type === 'access' &&\n !isAccessPrivileged(credentials.scope) &&\n PRIVILEGED_METHODS.has(lxm)\n ) {\n throw new InvalidRequestError('Bad token method', 'InvalidToken')\n }\n\n const headers: IncomingHttpHeaders = {\n 'accept-encoding': req.headers['accept-encoding'] || 'identity',\n 'accept-language': req.headers['accept-language'],\n 'atproto-accept-labelers': req.headers['atproto-accept-labelers'],\n 'x-bsky-topics': req.headers['x-bsky-topics'],\n\n 'content-type': body && req.headers['content-type'],\n 'content-encoding': body && req.headers['content-encoding'],\n 'content-length': body && req.headers['content-length'],\n\n authorization: `Bearer ${await ctx.serviceAuthJwt(credentials.did, tokenAud, lxm)}`,\n }\n\n const dispatchOptions: Dispatcher.RequestOptions = {\n origin,\n method: req.method,\n path: req.originalUrl,\n body,\n headers,\n }\n\n await pipethroughStream(ctx, req, dispatchOptions, (upstream) => {\n res.status(upstream.statusCode)\n\n for (const [name, val] of responseHeaders(upstream.headers)) {\n res.setHeader(name, val)\n }\n\n // Note that we should not need to manually handle errors here (e.g. by\n // destroying the response), as the http server will handle them for us.\n res.on('error', logResponseError)\n\n // Tell undici to write the upstream response directly to the response\n return res\n })\n } catch (err) {\n next(err)\n }\n }\n}\n\nexport type PipethroughOptions = {\n /**\n * Specify the issuer (requester) for service auth. If not provided, no\n * authorization headers will be added to the request.\n */\n iss?: string\n\n /**\n * Override the audience for service auth. If not provided, the audience will\n * be determined based on the proxy service.\n */\n aud?: string\n\n /**\n * Override the lexicon method for service auth. If not provided, the lexicon\n * method will be determined based on the request path.\n */\n lxm?: string\n}\n\nexport async function pipethrough(\n ctx: AppContext,\n req: Request,\n options?: PipethroughOptions,\n): Promise<\n HandlerPipeThroughStream & {\n stream: Readable\n headers: Record<string, string>\n encoding: string\n }\n> {\n if (req.method !== 'GET' && req.method !== 'HEAD') {\n // pipethrough() is used from within xrpcServer handlers, which means that\n // the request body either has been parsed or is a readable stream that has\n // been piped for decoding & size limiting. Because of this, forwarding the\n // request body requires re-encoding it. Since we currently do not use\n // pipethrough() with procedures, proxying of request body is not\n // implemented.\n throw new InternalServerError(\n `Proxying of ${req.method} requests is not supported`,\n )\n }\n\n const lxm = parseReqNsid(req)\n\n const { url: origin, did: aud } = await parseProxyInfo(ctx, req, lxm)\n\n const dispatchOptions: Dispatcher.RequestOptions = {\n origin,\n method: req.method,\n path: req.originalUrl,\n headers: {\n 'accept-language': req.headers['accept-language'],\n 'atproto-accept-labelers': req.headers['atproto-accept-labelers'],\n 'x-bsky-topics': req.headers['x-bsky-topics'],\n\n // Because we sometimes need to interpret the response (e.g. during\n // read-after-write, through asPipeThroughBuffer()), we need to ask the\n // upstream server for an encoding that both the requester and the PDS can\n // understand. Since we might have to do the decoding ourselves, we will\n // use our own preferences (and weight) to negotiate the encoding.\n 'accept-encoding': buildProxiedContentEncoding(\n req.headers['accept-encoding'],\n ctx.cfg.proxy.preferCompressed,\n ),\n\n authorization: options?.iss\n ? `Bearer ${await ctx.serviceAuthJwt(options.iss, options.aud ?? aud, options.lxm ?? lxm)}`\n : undefined,\n },\n\n // Use a high water mark to buffer more data while performing async\n // operations before this stream is consumed. This is especially useful\n // while processing read-after-write operations.\n highWaterMark: 2 * 65536, // twice the default (64KiB)\n }\n\n const { headers, body } = await pipethroughRequest(ctx, req, dispatchOptions)\n\n return {\n encoding: safeString(headers['content-type']) ?? 'application/json',\n headers: Object.fromEntries(responseHeaders(headers)),\n stream: body,\n }\n}\n\n// Request setup/formatting\n// -------------------\n\nexport function computeProxyTo(\n ctx: AppContext,\n req: Request,\n lxm: string,\n): string {\n const proxyToHeader = req.header('atproto-proxy')\n if (proxyToHeader) return proxyToHeader\n\n const service = defaultService(ctx, lxm)\n if (service.serviceInfo) {\n return `${service.serviceInfo.did}#${service.serviceId}`\n }\n\n throw new InvalidRequestError(`No service configured for ${lxm}`)\n}\n\n// Bare-DID portion of `proxyTo`, suitable as a service-auth JWT audience\n// (Phase 1 of service auth updates).\nexport function bareDidFromProxyTo(proxyTo: string): string {\n const hashIndex = proxyTo.indexOf('#')\n return hashIndex === -1 ? proxyTo : proxyTo.slice(0, hashIndex)\n}\n\nexport async function parseProxyInfo(\n ctx: AppContext,\n req: Request,\n lxm: string,\n): Promise<{ url: string; did: string; serviceId: string }> {\n // /!\\ Hot path\n\n const proxyToHeader = req.header('atproto-proxy')\n if (proxyToHeader) return parseProxyHeader(ctx, proxyToHeader)\n\n const { serviceId, serviceInfo } = defaultService(ctx, lxm)\n if (serviceInfo) return { ...serviceInfo, serviceId }\n\n throw new InvalidRequestError(`No service configured for ${lxm}`)\n}\n\nexport const parseProxyHeader = async (\n // Using subset of AppContext for testing purposes\n ctx: Pick<AppContext, 'cfg' | 'idResolver'>,\n proxyTo: string,\n): Promise<{ did: string; url: string; serviceId: string }> => {\n // /!\\ Hot path\n\n const hashIndex = proxyTo.indexOf('#')\n\n if (hashIndex === 0) {\n throw new InvalidRequestError('no did specified in proxy header')\n }\n\n if (hashIndex === -1 || hashIndex === proxyTo.length - 1) {\n throw new InvalidRequestError('no service id specified in proxy header')\n }\n\n // More than one hash\n if (proxyTo.indexOf('#', hashIndex + 1) !== -1) {\n throw new InvalidRequestError('invalid proxy header format')\n }\n\n // Basic validation\n if (proxyTo.includes(' ')) {\n throw new InvalidRequestError('proxy header cannot contain spaces')\n }\n\n const did = proxyTo.slice(0, hashIndex)\n const serviceId = proxyTo.slice(hashIndex + 1)\n\n // Special case a configured appview, while still proxying correctly any other appview\n if (\n ctx.cfg.bskyAppView &&\n proxyTo === `${ctx.cfg.bskyAppView.did}#bsky_appview`\n ) {\n return { did, url: ctx.cfg.bskyAppView.url, serviceId }\n }\n\n const didDoc = await ctx.idResolver.did.resolve(did)\n if (!didDoc) {\n throw new InvalidRequestError('could not resolve proxy did')\n }\n\n const url = getServiceEndpoint(didDoc, { id: `#${serviceId}` })\n if (!url) {\n throw new InvalidRequestError('could not resolve proxy did service url')\n }\n\n return { did, url, serviceId }\n}\n\n/**\n * Utility function that wraps the undici stream() function and handles request\n * and response errors by wrapping them in XRPCError instances. This function is\n * more efficient than \"pipethroughRequest\" when a writable stream to pipe the\n * upstream response to is available.\n */\nasync function pipethroughStream(\n ctx: AppContext,\n req: Request,\n dispatchOptions: Dispatcher.RequestOptions,\n successStreamFactory: Dispatcher.StreamFactory,\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n void ctx.proxyAgent\n .stream(dispatchOptions, (upstream) => {\n if (upstream.statusCode >= 400) {\n const passThrough = new PassThrough()\n\n void tryParsingError(upstream.headers, passThrough).then((parsed) => {\n const xrpcError = new PipethroughUpstreamError(upstream, parsed, {\n cause: dispatchOptions,\n })\n\n reject(xrpcError)\n }, reject)\n\n return passThrough\n }\n\n const writable = successStreamFactory(upstream)\n\n // As soon as the control was passed to the writable stream (i.e. by\n // returning the writable hereafter), pipethroughStream() is considered\n // to have succeeded. Any error occurring while writing upstream data to\n // the writable stream should be handled through the stream's error\n // state (i.e. successStreamFactory() must ensure that error events on\n // the returned writable will be handled).\n resolve()\n\n return writable\n })\n // The following catch block will be triggered with either network errors\n // or writable stream errors. In the latter case, the promise will already\n // be resolved, and reject()ing it there after will have no effect. Those\n // error would still be logged by the successStreamFactory() function.\n .catch(handleUpstreamRequestError.bind(req))\n .catch(reject)\n })\n}\n\n/**\n * Utility function that wraps the undici request() function and handles request\n * and response errors by wrapping them in XRPCError instances.\n */\nasync function pipethroughRequest(\n ctx: AppContext,\n req: Request,\n dispatchOptions: Dispatcher.RequestOptions,\n) {\n // HandlerPipeThroughStream requires a readable stream to be returned, so we\n // use the (less efficient) request() function instead.\n\n const upstream = await ctx.proxyAgent\n .request(dispatchOptions)\n .catch(handleUpstreamRequestError.bind(req))\n\n if (upstream.statusCode >= 400) {\n const parsed = await tryParsingError(upstream.headers, upstream.body)\n\n throw new PipethroughUpstreamError(upstream, parsed, {\n cause: dispatchOptions,\n })\n }\n\n return upstream\n}\n\nfunction handleUpstreamRequestError(\n this: Request,\n err: unknown,\n message = 'Upstream service unreachable',\n): never {\n const logger = isPinoHttpRequest(this) ? this.log : httpLogger\n logger.error({ err }, message)\n throw new XRPCServerError(ResponseType.UpstreamFailure, message, undefined, {\n cause: err,\n })\n}\n\nfunction isPinoHttpRequest(req: Request): req is Request & {\n log: { error: (obj: unknown, msg: string) => void }\n} {\n return typeof (req as { log?: any }).log?.error === 'function'\n}\n\n// Request parsing/forwarding\n// -------------------\n\nexport function isJsonContentType(contentType?: string): boolean | undefined {\n if (!contentType) return undefined\n return /application\\/(?:\\w+\\+)?json/i.test(contentType)\n}\n\nasync function tryParsingError(\n headers: IncomingHttpHeaders,\n readable: Readable,\n): Promise<{ error?: string; message?: string }> {\n if (isJsonContentType(headers['content-type']) === false) {\n // We don't known how to parse non JSON content types so we can discard the\n // whole response.\n\n // Since we don't care about the response, we would normally just destroy\n // the stream. However, if the underlying HTTP connection is an HTTP/1.1\n // connection, this also destroys the underlying (keep-alive) TCP socket. In\n // order to avoid destroying the TCP socket, while avoiding the cost of\n // consuming too much IO, we give it a chance to finish first.\n\n // @NOTE we need to listen (and ignore) \"error\" events, otherwise the\n // process could crash (since we drain the stream asynchronously here). This\n // is performed through the \"finished\" call below.\n\n const to = setTimeout(() => {\n readable.destroy()\n }, 100)\n finished(readable, (_err) => {\n clearTimeout(to)\n })\n readable.resume()\n\n return {}\n }\n\n try {\n const buffer = await bufferUpstreamResponse(\n readable,\n headers['content-encoding'],\n )\n\n const errInfo: unknown = JSON.parse(buffer.toString('utf8'))\n return {\n error: safeString(errInfo?.['error']),\n message: safeString(errInfo?.['message']),\n }\n } catch (err) {\n // Failed to read, decode, buffer or parse. No big deal.\n return {}\n }\n}\n\nasync function bufferUpstreamResponse(\n readable: Readable,\n contentEncoding?: string | string[],\n): Promise<Buffer> {\n try {\n return await streamToNodeBuffer(decodeStream(readable, contentEncoding))\n } catch (err) {\n if (!readable.destroyed) readable.destroy()\n\n throw new XRPCServerError(\n ResponseType.UpstreamFailure,\n err instanceof TypeError ? err.message : 'unable to decode request body',\n undefined,\n { cause: err },\n )\n }\n}\n\nexport async function asPipeThroughBuffer(\n input: HandlerPipeThroughStream,\n): Promise<HandlerPipeThroughBuffer> {\n return {\n buffer: await bufferUpstreamResponse(\n input.stream,\n input.headers?.['content-encoding'],\n ),\n headers: omit(input.headers, ['content-encoding', 'content-length']),\n encoding: input.encoding,\n }\n}\n\n// Response parsing/forwarding\n// -------------------\n\nconst RES_HEADERS_TO_FORWARD = [\n 'atproto-repo-rev',\n 'atproto-content-labelers',\n 'retry-after',\n]\n\nfunction* responseHeaders(\n headers: IncomingHttpHeaders,\n includeContentHeaders = true,\n): Generator<[string, string]> {\n if (includeContentHeaders) {\n const length = headers['content-length']\n if (length) yield ['content-length', length]\n\n const encoding = headers['content-encoding']\n if (encoding) yield ['content-encoding', encoding]\n\n const type = headers['content-type']\n if (type) yield ['content-type', type]\n\n const language = headers['content-language']\n if (language) yield ['content-language', language]\n }\n\n for (let i = 0; i < RES_HEADERS_TO_FORWARD.length; i++) {\n const name = RES_HEADERS_TO_FORWARD[i]\n const val = headers[name]\n\n if (val != null) {\n const value: string = Array.isArray(val) ? val.join(',') : val\n yield [name, value]\n }\n }\n}\n\n// Utils\n// -------------------\n\n/**\n * Performs lexicon method matching on a set of methods,\n * taking into account that they are treated case-insensitively.\n */\nexport class LxmSet {\n private inner: Set<string>\n private original: Iterable<string>\n constructor(items: Iterable<string>) {\n this.inner = new Set(Array.from(items, normalizeLxm))\n this.original = items\n }\n has(lxm: string) {\n return this.inner.has(normalizeLxm(lxm))\n }\n *[Symbol.iterator](): Iterator<string> {\n yield* this.original\n }\n}\n\nexport function normalizeLxm(lxm: string) {\n return lxm.toLowerCase()\n}\n\nexport const CHAT_BSKY_METHODS = new LxmSet([\n chat.bsky.actor.deleteAccount.$lxm,\n chat.bsky.actor.exportAccountData.$lxm,\n chat.bsky.convo.deleteMessageForSelf.$lxm,\n chat.bsky.convo.getConvo.$lxm,\n chat.bsky.convo.getConvoForMembers.$lxm,\n chat.bsky.convo.getLog.$lxm,\n chat.bsky.convo.getMessages.$lxm,\n chat.bsky.convo.leaveConvo.$lxm,\n chat.bsky.convo.listConvos.$lxm,\n chat.bsky.convo.muteConvo.$lxm,\n chat.bsky.convo.sendMessage.$lxm,\n chat.bsky.convo.sendMessageBatch.$lxm,\n chat.bsky.convo.unmuteConvo.$lxm,\n chat.bsky.convo.updateRead.$lxm,\n])\n\nexport const PRIVILEGED_METHODS = new LxmSet([\n ...CHAT_BSKY_METHODS,\n com.atproto.server.createAccount.$lxm,\n])\n\n// These endpoints are related to account management and must be used directly,\n// not proxied or service-authed. Service auth may be utilized between PDS and\n// entryway for these methods.\nexport const PROTECTED_METHODS = new LxmSet([\n com.atproto.admin.sendEmail.$lxm,\n com.atproto.identity.requestPlcOperationSignature.$lxm,\n com.atproto.identity.signPlcOperation.$lxm,\n com.atproto.identity.updateHandle.$lxm,\n com.atproto.server.activateAccount.$lxm,\n com.atproto.server.confirmEmail.$lxm,\n com.atproto.server.createAppPassword.$lxm,\n com.atproto.server.deactivateAccount.$lxm,\n com.atproto.server.getAccountInviteCodes.$lxm,\n com.atproto.server.getSession.$lxm,\n com.atproto.server.listAppPasswords.$lxm,\n com.atproto.server.requestAccountDelete.$lxm,\n com.atproto.server.requestEmailConfirmation.$lxm,\n com.atproto.server.requestEmailUpdate.$lxm,\n com.atproto.server.revokeAppPassword.$lxm,\n com.atproto.server.updateEmail.$lxm,\n])\n\nconst defaultService = (\n ctx: AppContext,\n nsid: string,\n): {\n serviceId: string\n serviceInfo: { url: string; did: string } | null\n} => {\n switch (nsid) {\n case tools.ozone.communication.createTemplate.$lxm:\n case tools.ozone.communication.deleteTemplate.$lxm:\n case tools.ozone.communication.listTemplates.$lxm:\n case tools.ozone.communication.updateTemplate.$lxm:\n case tools.ozone.moderation.cancelScheduledActions.$lxm:\n case tools.ozone.moderation.emitEvent.$lxm:\n case tools.ozone.moderation.getAccountTimeline.$lxm:\n case tools.ozone.moderation.getEvent.$lxm:\n case tools.ozone.moderation.getRecord.$lxm:\n case tools.ozone.moderation.getRepo.$lxm:\n case tools.ozone.moderation.listScheduledActions.$lxm:\n case tools.ozone.moderation.queryEvents.$lxm:\n case tools.ozone.moderation.queryStatuses.$lxm:\n case tools.ozone.moderation.scheduleAction.$lxm:\n case tools.ozone.moderation.searchRepos.$lxm:\n case tools.ozone.safelink.addRule.$lxm:\n case tools.ozone.safelink.queryEvents.$lxm:\n case tools.ozone.safelink.queryRules.$lxm:\n case tools.ozone.safelink.removeRule.$lxm:\n case tools.ozone.safelink.updateRule.$lxm:\n case tools.ozone.team.addMember.$lxm:\n case tools.ozone.team.deleteMember.$lxm:\n case tools.ozone.team.listMembers.$lxm:\n case tools.ozone.team.updateMember.$lxm:\n case tools.ozone.verification.grantVerifications.$lxm:\n case tools.ozone.verification.listVerifications.$lxm:\n case tools.ozone.verification.revokeVerifications.$lxm:\n return {\n serviceId: 'atproto_labeler',\n serviceInfo: ctx.cfg.modService,\n }\n case com.atproto.moderation.createReport.$lxm:\n return {\n serviceId: 'atproto_labeler',\n serviceInfo: ctx.cfg.reportService,\n }\n default:\n return {\n serviceId: 'bsky_appview',\n serviceInfo: ctx.cfg.bskyAppView,\n }\n }\n}\n\nconst safeString = (str: unknown): string | undefined => {\n return typeof str === 'string' ? str : undefined\n}\n\nfunction logResponseError(this: ServerResponse, err: unknown): void {\n httpLogger.warn({ err }, 'error forwarding upstream response')\n}\n\nexport class PipethroughUpstreamError extends XRPCServerError {\n constructor(\n readonly upstream: {\n statusCode: number\n headers: IncomingHttpHeaders\n },\n payload: { message?: string; error?: string },\n options?: ErrorOptions,\n ) {\n const status =\n upstream.statusCode === 500\n ? ResponseType.UpstreamFailure\n : upstream.statusCode\n\n super(status, payload.message, payload.error, options)\n }\n\n get headers(): Record<string, string> {\n return Object.fromEntries(responseHeaders(this.upstream.headers, false))\n }\n\n get error() {\n return this.customErrorName ?? this.typeName\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { Redis } from 'ioredis';
2
+ import type { Options } from '@atproto/xrpc-server';
3
+ import type { RateLimitsConfig } from './config/index.js';
4
+ type RateLimitDescriptions = NonNullable<Options['rateLimits']>;
5
+ export declare const buildRateLimitsConfig: (rateLimits: RateLimitsConfig, redisScratch?: Redis) => RateLimitDescriptions | undefined;
6
+ export {};
7
+ //# sourceMappingURL=rate-limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.d.ts","sourceRoot":"","sources":["../src/rate-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,KAAK,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA;AAI/D,eAAO,MAAM,qBAAqB,eACpB,gBAAgB,iBACb,KAAK,KACnB,qBAAqB,GAAG,SA6C1B,CAAA"}
@@ -0,0 +1,50 @@
1
+ import { DAY, HOUR, MINUTE } from '@atproto/common';
2
+ import { MemoryRateLimiter, RedisRateLimiter } from '@atproto/xrpc-server';
3
+ const SYNC_GET_REPO_PATH = '/xrpc/com.atproto.sync.getRepo';
4
+ export const buildRateLimitsConfig = (rateLimits, redisScratch) => {
5
+ if (!rateLimits.enabled)
6
+ return undefined;
7
+ return {
8
+ creator: redisScratch
9
+ ? (opts) => new RedisRateLimiter(redisScratch, opts)
10
+ : (opts) => new MemoryRateLimiter(opts),
11
+ bypass: ({ req }) => {
12
+ const { bypassKey, bypassIps } = rateLimits;
13
+ if (bypassKey && bypassKey === req.headers['x-ratelimit-bypass']) {
14
+ return true;
15
+ }
16
+ if (bypassIps && bypassIps.includes(req.ip)) {
17
+ return true;
18
+ }
19
+ return false;
20
+ },
21
+ global: [
22
+ {
23
+ name: 'global-ip',
24
+ durationMs: 5 * MINUTE,
25
+ points: 3000,
26
+ // getRepo can be a high-volume sync path, so it has its own endpoint
27
+ // limit and should not consume the shared global read bucket.
28
+ calcKey: ({ req }) => {
29
+ if (req.path === SYNC_GET_REPO_PATH) {
30
+ return null;
31
+ }
32
+ return req.ip;
33
+ },
34
+ },
35
+ ],
36
+ shared: [
37
+ {
38
+ name: 'repo-write-hour',
39
+ durationMs: HOUR,
40
+ points: 5000, // creates=3, puts=2, deletes=1
41
+ },
42
+ {
43
+ name: 'repo-write-day',
44
+ durationMs: DAY,
45
+ points: 35000, // creates=3, puts=2, deletes=1
46
+ },
47
+ ],
48
+ };
49
+ };
50
+ //# sourceMappingURL=rate-limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.js","sourceRoot":"","sources":["../src/rate-limits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,iBAA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UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,IAAI,EAAE,+BAA+B;aAC9C;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,UAAU,EAAE,GAAG;gBACf,MAAM,EAAE,KAAK,EAAE,+BAA+B;aAC/C;SACF;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import type { Redis } from 'ioredis'\nimport { DAY, HOUR, MINUTE } from '@atproto/common'\nimport { MemoryRateLimiter, RedisRateLimiter } from '@atproto/xrpc-server'\nimport type { Options } from '@atproto/xrpc-server'\nimport type { RateLimitsConfig } from './config/index.js'\n\ntype RateLimitDescriptions = NonNullable<Options['rateLimits']>\n\nconst SYNC_GET_REPO_PATH = '/xrpc/com.atproto.sync.getRepo'\n\nexport const buildRateLimitsConfig = (\n rateLimits: RateLimitsConfig,\n redisScratch?: Redis,\n): RateLimitDescriptions | undefined => {\n if (!rateLimits.enabled) return undefined\n\n return {\n creator: redisScratch\n ? (opts) => new RedisRateLimiter(redisScratch, opts)\n : (opts) => new MemoryRateLimiter(opts),\n bypass: ({ req }) => {\n const { bypassKey, bypassIps } = rateLimits\n if (bypassKey && bypassKey === req.headers['x-ratelimit-bypass']) {\n return true\n }\n if (bypassIps && bypassIps.includes(req.ip)) {\n return true\n }\n return false\n },\n global: [\n {\n name: 'global-ip',\n durationMs: 5 * MINUTE,\n points: 3000,\n // getRepo can be a high-volume sync path, so it has its own endpoint\n // limit and should not consume the shared global read bucket.\n calcKey: ({ req }) => {\n if (req.path === SYNC_GET_REPO_PATH) {\n return null\n }\n return req.ip\n },\n },\n ],\n shared: [\n {\n name: 'repo-write-hour',\n durationMs: HOUR,\n points: 5000, // creates=3, puts=2, deletes=1\n },\n {\n name: 'repo-write-day',\n durationMs: DAY,\n points: 35000, // creates=3, puts=2, deletes=1\n },\n ],\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/read-after-write/util.ts"],"names":[],"mappings":"AAAA,OAAO,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O,EACL,kBAAkB,EAEnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAO1C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEnE,eAAO,MAAM,WAAW,UAAW,YAAY,KAAG,MAAM,GAAG,SAS1D,CAAA;AAED,eAAO,MAAM,yBAAyB,GACpC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG;IAClC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;CAC1D,OAEI,UAAU,UACP;IAAE,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;IAAC,IAAI,EAAE;QAAE,WAAW,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,MACpE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SACN,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KACzC,OAAO,CACR,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAiDjE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,QAC9B,CAAC,QACD,MAAM,KACX,eAAe,CAAC,CAAC,CASlB,CAAA"}
@@ -27,34 +27,34 @@ export declare class LocalViewer {
27
27
  formatAndInsertPostsInFeed(feed: app.bsky.feed.defs.FeedViewPost[], posts: RecordDescript<app.bsky.feed.post.Main>[]): Promise<app.bsky.feed.defs.FeedViewPost[]>;
28
28
  getPost(descript: RecordDescript<app.bsky.feed.post.Main>): Promise<app.bsky.feed.defs.PostView | null>;
29
29
  formatPostEmbed(post: app.bsky.feed.post.Main): Promise<{
30
- $type: "app.bsky.embed.images#view";
30
+ $type: 'app.bsky.embed.images#view';
31
31
  images: app.bsky.embed.images.ViewImage[];
32
32
  } | {
33
- $type: "app.bsky.embed.external#view";
33
+ $type: 'app.bsky.embed.external#view';
34
34
  external: app.bsky.embed.external.ViewExternal;
35
35
  } | {
36
- $type: "app.bsky.embed.record#view";
36
+ $type: 'app.bsky.embed.record#view';
37
37
  record: import("@atproto/lex").$Typed<app.bsky.embed.record.ViewRecord> | import("@atproto/lex").$Typed<app.bsky.embed.record.ViewNotFound> | import("@atproto/lex").$Typed<app.bsky.embed.record.ViewBlocked> | import("@atproto/lex").$Typed<app.bsky.embed.record.ViewDetached> | import("@atproto/lex").$Typed<app.bsky.feed.defs.GeneratorView> | import("@atproto/lex").$Typed<app.bsky.graph.defs.ListView> | import("@atproto/lex").$Typed<app.bsky.labeler.defs.LabelerView> | import("@atproto/lex").$Typed<app.bsky.graph.defs.StarterPackViewBasic> | import("@atproto/lex").Unknown$TypedObject;
38
38
  } | {
39
- $type: "app.bsky.embed.recordWithMedia#view";
39
+ $type: 'app.bsky.embed.recordWithMedia#view';
40
40
  record: app.bsky.embed.record.View;
41
41
  media: import("@atproto/lex").$Typed<app.bsky.embed.images.View> | import("@atproto/lex").$Typed<app.bsky.embed.video.View> | import("@atproto/lex").$Typed<app.bsky.embed.gallery.View> | import("@atproto/lex").$Typed<app.bsky.embed.external.View> | import("@atproto/lex").Unknown$TypedObject;
42
42
  } | undefined>;
43
43
  formatImageEmbed(embed: app.bsky.embed.images.Main): {
44
- $type: "app.bsky.embed.images#view";
44
+ $type: 'app.bsky.embed.images#view';
45
45
  images: app.bsky.embed.images.ViewImage[];
46
46
  };
47
47
  formatExternalEmbed(embed: app.bsky.embed.external.Main): {
48
- $type: "app.bsky.embed.external#view";
48
+ $type: 'app.bsky.embed.external#view';
49
49
  external: app.bsky.embed.external.ViewExternal;
50
50
  };
51
51
  formatRecordEmbed(embed: app.bsky.embed.record.Main): Promise<{
52
- $type: "app.bsky.embed.record#view";
52
+ $type: 'app.bsky.embed.record#view';
53
53
  record: import("@atproto/lex").$Typed<app.bsky.embed.record.ViewRecord> | import("@atproto/lex").$Typed<app.bsky.embed.record.ViewNotFound> | import("@atproto/lex").$Typed<app.bsky.embed.record.ViewBlocked> | import("@atproto/lex").$Typed<app.bsky.embed.record.ViewDetached> | import("@atproto/lex").$Typed<app.bsky.feed.defs.GeneratorView> | import("@atproto/lex").$Typed<app.bsky.graph.defs.ListView> | import("@atproto/lex").$Typed<app.bsky.labeler.defs.LabelerView> | import("@atproto/lex").$Typed<app.bsky.graph.defs.StarterPackViewBasic> | import("@atproto/lex").Unknown$TypedObject;
54
54
  }>;
55
55
  private formatRecordEmbedInternal;
56
56
  formatRecordWithMediaEmbed(embed: app.bsky.embed.recordWithMedia.Main): Promise<{
57
- $type: "app.bsky.embed.recordWithMedia#view";
57
+ $type: 'app.bsky.embed.recordWithMedia#view';
58
58
  record: app.bsky.embed.record.View;
59
59
  media: import("@atproto/lex").$Typed<app.bsky.embed.images.View> | import("@atproto/lex").$Typed<app.bsky.embed.video.View> | import("@atproto/lex").$Typed<app.bsky.embed.gallery.View> | import("@atproto/lex").$Typed<app.bsky.embed.external.View> | import("@atproto/lex").Unknown$TypedObject;
60
60
  } | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../src/read-after-write/viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAoB,MAAM,cAAc,CAAA;AAClE,OAAO,EAAS,SAAS,EAAgC,MAAM,iBAAiB,CAAA;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MA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