@atproto/pds 0.4.104 → 0.4.106

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 (209) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/account-manager/{index.d.ts → account-manager.d.ts} +26 -35
  3. package/dist/account-manager/account-manager.d.ts.map +1 -0
  4. package/dist/account-manager/{index.js → account-manager.js} +52 -207
  5. package/dist/account-manager/account-manager.js.map +1 -0
  6. package/dist/account-manager/helpers/account.d.ts +3 -3
  7. package/dist/account-manager/helpers/device-account.d.ts +15 -15
  8. package/dist/account-manager/helpers/device-account.d.ts.map +1 -1
  9. package/dist/account-manager/helpers/device-account.js +2 -1
  10. package/dist/account-manager/helpers/device-account.js.map +1 -1
  11. package/dist/account-manager/helpers/token.d.ts +98 -98
  12. package/dist/account-manager/oauth-store.d.ts +58 -0
  13. package/dist/account-manager/oauth-store.d.ts.map +1 -0
  14. package/dist/account-manager/oauth-store.js +417 -0
  15. package/dist/account-manager/oauth-store.js.map +1 -0
  16. package/dist/actor-store/record/reader.d.ts +3 -3
  17. package/dist/actor-store/repo/reader.d.ts +2 -0
  18. package/dist/actor-store/repo/reader.d.ts.map +1 -1
  19. package/dist/actor-store/repo/reader.js +9 -0
  20. package/dist/actor-store/repo/reader.js.map +1 -1
  21. package/dist/actor-store/repo/sql-repo-reader.d.ts +1 -1
  22. package/dist/actor-store/repo/transactor.d.ts.map +1 -1
  23. package/dist/actor-store/repo/transactor.js +13 -4
  24. package/dist/actor-store/repo/transactor.js.map +1 -1
  25. package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
  26. package/dist/api/com/atproto/admin/deleteAccount.js +2 -3
  27. package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
  28. package/dist/api/com/atproto/admin/updateAccountHandle.d.ts.map +1 -1
  29. package/dist/api/com/atproto/admin/updateAccountHandle.js +2 -6
  30. package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
  31. package/dist/api/com/atproto/identity/resolveHandle.d.ts.map +1 -1
  32. package/dist/api/com/atproto/identity/resolveHandle.js +2 -36
  33. package/dist/api/com/atproto/identity/resolveHandle.js.map +1 -1
  34. package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
  35. package/dist/api/com/atproto/identity/updateHandle.js +1 -7
  36. package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
  37. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  38. package/dist/api/com/atproto/server/activateAccount.js +2 -18
  39. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  40. package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
  41. package/dist/api/com/atproto/server/createAccount.js +7 -7
  42. package/dist/api/com/atproto/server/createAccount.js.map +1 -1
  43. package/dist/api/com/atproto/server/createSession.js +1 -1
  44. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  45. package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
  46. package/dist/api/com/atproto/server/deleteAccount.js +2 -3
  47. package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
  48. package/dist/api/com/atproto/server/getSession.js +1 -1
  49. package/dist/api/com/atproto/server/getSession.js.map +1 -1
  50. package/dist/api/com/atproto/server/refreshSession.js +1 -1
  51. package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
  52. package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
  53. package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
  54. package/dist/api/com/atproto/sync/getRepoStatus.js +1 -1
  55. package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
  56. package/dist/api/com/atproto/sync/listRepos.js +1 -1
  57. package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
  58. package/dist/api/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  59. package/dist/api/com/atproto/sync/subscribeRepos.js +2 -10
  60. package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
  61. package/dist/app-view.d.ts +14 -0
  62. package/dist/app-view.d.ts.map +1 -0
  63. package/dist/app-view.js +36 -0
  64. package/dist/app-view.js.map +1 -0
  65. package/dist/auth-routes.d.ts +1 -1
  66. package/dist/auth-routes.d.ts.map +1 -1
  67. package/dist/auth-routes.js +9 -3
  68. package/dist/auth-routes.js.map +1 -1
  69. package/dist/auth-verifier.d.ts +1 -1
  70. package/dist/auth-verifier.d.ts.map +1 -1
  71. package/dist/config/config.d.ts +3 -2
  72. package/dist/config/config.d.ts.map +1 -1
  73. package/dist/config/config.js +17 -7
  74. package/dist/config/config.js.map +1 -1
  75. package/dist/config/env.d.ts +4 -0
  76. package/dist/config/env.d.ts.map +1 -1
  77. package/dist/config/env.js +5 -0
  78. package/dist/config/env.js.map +1 -1
  79. package/dist/context.d.ts +4 -4
  80. package/dist/context.d.ts.map +1 -1
  81. package/dist/context.js +24 -18
  82. package/dist/context.js.map +1 -1
  83. package/dist/handle/index.d.ts +0 -7
  84. package/dist/handle/index.d.ts.map +1 -1
  85. package/dist/handle/index.js +4 -58
  86. package/dist/handle/index.js.map +1 -1
  87. package/dist/image/image-url.d.ts +8 -0
  88. package/dist/image/image-url.d.ts.map +1 -0
  89. package/dist/image/image-url.js +26 -0
  90. package/dist/image/image-url.js.map +1 -0
  91. package/dist/lexicon/index.d.ts +6 -0
  92. package/dist/lexicon/index.d.ts.map +1 -1
  93. package/dist/lexicon/index.js +12 -0
  94. package/dist/lexicon/index.js.map +1 -1
  95. package/dist/lexicon/lexicons.d.ts +310 -130
  96. package/dist/lexicon/lexicons.d.ts.map +1 -1
  97. package/dist/lexicon/lexicons.js +171 -67
  98. package/dist/lexicon/lexicons.js.map +1 -1
  99. package/dist/lexicon/types/app/bsky/embed/video.d.ts +1 -0
  100. package/dist/lexicon/types/app/bsky/embed/video.d.ts.map +1 -1
  101. package/dist/lexicon/types/app/bsky/embed/video.js.map +1 -1
  102. package/dist/lexicon/types/com/atproto/identity/defs.d.ts +17 -0
  103. package/dist/lexicon/types/com/atproto/identity/defs.d.ts.map +1 -0
  104. package/dist/lexicon/types/com/atproto/identity/defs.js +16 -0
  105. package/dist/lexicon/types/com/atproto/identity/defs.js.map +1 -0
  106. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts +39 -0
  107. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts.map +1 -0
  108. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js +7 -0
  109. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js.map +1 -0
  110. package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts +40 -0
  111. package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts.map +1 -0
  112. package/dist/lexicon/types/com/atproto/identity/resolveDid.js +7 -0
  113. package/dist/lexicon/types/com/atproto/identity/resolveDid.js.map +1 -0
  114. package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts +1 -0
  115. package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts.map +1 -1
  116. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts +36 -0
  117. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts.map +1 -0
  118. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js +7 -0
  119. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js.map +1 -0
  120. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +1 -30
  121. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  122. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +0 -27
  123. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
  124. package/dist/lexicon/types/tools/ozone/team/listMembers.d.ts +1 -0
  125. package/dist/lexicon/types/tools/ozone/team/listMembers.d.ts.map +1 -1
  126. package/dist/mailer/index.d.ts +5 -5
  127. package/dist/mailer/index.d.ts.map +1 -1
  128. package/dist/mailer/index.js +6 -5
  129. package/dist/mailer/index.js.map +1 -1
  130. package/dist/read-after-write/viewer.d.ts +1 -1
  131. package/dist/read-after-write/viewer.d.ts.map +1 -1
  132. package/dist/repo/types.d.ts +6 -2
  133. package/dist/repo/types.d.ts.map +1 -1
  134. package/dist/repo/types.js.map +1 -1
  135. package/dist/scripts/rebuild-repo.d.ts.map +1 -1
  136. package/dist/scripts/rebuild-repo.js +2 -1
  137. package/dist/scripts/rebuild-repo.js.map +1 -1
  138. package/dist/sequencer/db/schema.d.ts +1 -1
  139. package/dist/sequencer/db/schema.d.ts.map +1 -1
  140. package/dist/sequencer/events.d.ts +27 -38
  141. package/dist/sequencer/events.d.ts.map +1 -1
  142. package/dist/sequencer/events.js +40 -58
  143. package/dist/sequencer/events.js.map +1 -1
  144. package/dist/sequencer/sequencer.d.ts +2 -3
  145. package/dist/sequencer/sequencer.d.ts.map +1 -1
  146. package/dist/sequencer/sequencer.js +5 -17
  147. package/dist/sequencer/sequencer.js.map +1 -1
  148. package/package.json +15 -15
  149. package/src/account-manager/{index.ts → account-manager.ts} +107 -307
  150. package/src/account-manager/helpers/device-account.ts +1 -0
  151. package/src/account-manager/oauth-store.ts +494 -0
  152. package/src/actor-store/repo/reader.ts +11 -0
  153. package/src/actor-store/repo/transactor.ts +15 -4
  154. package/src/api/com/atproto/admin/deleteAccount.ts +2 -3
  155. package/src/api/com/atproto/admin/updateAccountHandle.ts +7 -8
  156. package/src/api/com/atproto/identity/resolveHandle.ts +2 -11
  157. package/src/api/com/atproto/identity/updateHandle.ts +4 -7
  158. package/src/api/com/atproto/server/activateAccount.ts +4 -18
  159. package/src/api/com/atproto/server/createAccount.ts +15 -11
  160. package/src/api/com/atproto/server/createSession.ts +1 -1
  161. package/src/api/com/atproto/server/deleteAccount.ts +2 -3
  162. package/src/api/com/atproto/server/getSession.ts +1 -1
  163. package/src/api/com/atproto/server/refreshSession.ts +1 -1
  164. package/src/api/com/atproto/sync/getRecord.ts +0 -1
  165. package/src/api/com/atproto/sync/getRepoStatus.ts +1 -1
  166. package/src/api/com/atproto/sync/listRepos.ts +1 -1
  167. package/src/api/com/atproto/sync/subscribeRepos.ts +2 -9
  168. package/src/app-view.ts +24 -0
  169. package/src/auth-routes.ts +9 -3
  170. package/src/auth-verifier.ts +1 -1
  171. package/src/config/config.ts +25 -13
  172. package/src/config/env.ts +12 -0
  173. package/src/context.ts +44 -24
  174. package/src/handle/index.ts +6 -52
  175. package/src/image/image-url.ts +16 -0
  176. package/src/lexicon/index.ts +36 -0
  177. package/src/lexicon/lexicons.ts +186 -67
  178. package/src/lexicon/types/app/bsky/embed/video.ts +1 -0
  179. package/src/lexicon/types/com/atproto/identity/defs.ts +30 -0
  180. package/src/lexicon/types/com/atproto/identity/refreshIdentity.ts +52 -0
  181. package/src/lexicon/types/com/atproto/identity/resolveDid.ts +52 -0
  182. package/src/lexicon/types/com/atproto/identity/resolveHandle.ts +1 -0
  183. package/src/lexicon/types/com/atproto/identity/resolveIdentity.ts +48 -0
  184. package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +0 -59
  185. package/src/lexicon/types/tools/ozone/team/listMembers.ts +1 -0
  186. package/src/mailer/index.ts +7 -5
  187. package/src/read-after-write/viewer.ts +1 -1
  188. package/src/repo/types.ts +7 -2
  189. package/src/scripts/rebuild-repo.ts +4 -1
  190. package/src/sequencer/db/schema.ts +1 -8
  191. package/src/sequencer/events.ts +47 -75
  192. package/src/sequencer/sequencer.ts +9 -23
  193. package/tests/account-deletion.test.ts +3 -5
  194. package/tests/oauth.test.ts +286 -71
  195. package/tests/sequencer.test.ts +20 -29
  196. package/tests/sync/subscribe-repos.test.ts +89 -45
  197. package/tsconfig.build.tsbuildinfo +1 -1
  198. package/dist/account-manager/index.d.ts.map +0 -1
  199. package/dist/account-manager/index.js.map +0 -1
  200. package/dist/actor-store/repo/util.d.ts +0 -5
  201. package/dist/actor-store/repo/util.d.ts.map +0 -1
  202. package/dist/actor-store/repo/util.js +0 -25
  203. package/dist/actor-store/repo/util.js.map +0 -1
  204. package/dist/oauth/provider.d.ts +0 -10
  205. package/dist/oauth/provider.d.ts.map +0 -1
  206. package/dist/oauth/provider.js +0 -38
  207. package/dist/oauth/provider.js.map +0 -1
  208. package/src/actor-store/repo/util.ts +0 -22
  209. package/src/oauth/provider.ts +0 -59
@@ -1,59 +0,0 @@
1
- import {
2
- AccessTokenType,
3
- OAuthProvider,
4
- OAuthProviderOptions,
5
- } from '@atproto/oauth-provider'
6
- import { AccountManager } from '../account-manager/index'
7
- import { oauthLogger } from '../logger'
8
-
9
- export type AuthProviderOptions = {
10
- accountManager: AccountManager
11
- } & Pick<
12
- OAuthProviderOptions,
13
- 'issuer' | 'redis' | 'keyset' | 'dpopSecret' | 'customization' | 'trustProxy'
14
- > &
15
- Required<Pick<OAuthProviderOptions, 'safeFetch'>>
16
-
17
- export class PdsOAuthProvider extends OAuthProvider {
18
- constructor({
19
- accountManager,
20
- keyset,
21
- redis,
22
- dpopSecret,
23
- issuer,
24
- customization,
25
- safeFetch,
26
- trustProxy,
27
- }: AuthProviderOptions) {
28
- super({
29
- issuer,
30
- keyset,
31
- dpopSecret,
32
- redis,
33
- safeFetch,
34
- customization,
35
- store: accountManager,
36
- trustProxy,
37
- metadata: {
38
- // PdsOAuthProvider is used when the PDS is both an authorization server
39
- // & resource server, in which case the issuer origin is also the
40
- // resource server uri.
41
- protected_resources: [new URL(issuer).origin],
42
-
43
- scopes_supported: ['transition:generic', 'transition:chat.bsky'],
44
- },
45
-
46
- // If the PDS is both an authorization server & resource server (no
47
- // entryway), there is no need to use JWTs as access tokens. Instead,
48
- // the PDS can use tokenId as access tokens. This allows the PDS to
49
- // always use up-to-date token data from the token store.
50
- accessTokenType: AccessTokenType.id,
51
- })
52
- }
53
-
54
- createRouter() {
55
- return this.httpHandler({
56
- onError: (req, res, err, message) => oauthLogger.error({ err }, message),
57
- })
58
- }
59
- }