@atproto/pds 0.4.34 → 0.4.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/account-manager/db/migrations/004-oauth.d.ts +4 -0
  3. package/dist/account-manager/db/migrations/004-oauth.d.ts.map +1 -0
  4. package/dist/account-manager/db/migrations/004-oauth.js +106 -0
  5. package/dist/account-manager/db/migrations/004-oauth.js.map +1 -0
  6. package/dist/account-manager/db/migrations/index.d.ts +2 -0
  7. package/dist/account-manager/db/migrations/index.d.ts.map +1 -1
  8. package/dist/account-manager/db/migrations/index.js +2 -0
  9. package/dist/account-manager/db/migrations/index.js.map +1 -1
  10. package/dist/account-manager/db/schema/authorization-request.d.ts +19 -0
  11. package/dist/account-manager/db/schema/authorization-request.d.ts.map +1 -0
  12. package/dist/account-manager/db/schema/authorization-request.js +5 -0
  13. package/dist/account-manager/db/schema/authorization-request.js.map +1 -0
  14. package/dist/account-manager/db/schema/device-account.d.ts +14 -0
  15. package/dist/account-manager/db/schema/device-account.d.ts.map +1 -0
  16. package/dist/account-manager/db/schema/device-account.js +5 -0
  17. package/dist/account-manager/db/schema/device-account.js.map +1 -0
  18. package/dist/account-manager/db/schema/device.d.ts +16 -0
  19. package/dist/account-manager/db/schema/device.d.ts.map +1 -0
  20. package/dist/account-manager/db/schema/device.js +5 -0
  21. package/dist/account-manager/db/schema/device.js.map +1 -0
  22. package/dist/account-manager/db/schema/index.d.ts +11 -1
  23. package/dist/account-manager/db/schema/index.d.ts.map +1 -1
  24. package/dist/account-manager/db/schema/token.d.ts +24 -0
  25. package/dist/account-manager/db/schema/token.d.ts.map +1 -0
  26. package/dist/account-manager/db/schema/token.js +5 -0
  27. package/dist/account-manager/db/schema/token.js.map +1 -0
  28. package/dist/account-manager/db/schema/used-refresh-token.d.ts +12 -0
  29. package/dist/account-manager/db/schema/used-refresh-token.d.ts.map +1 -0
  30. package/dist/account-manager/db/schema/used-refresh-token.js +5 -0
  31. package/dist/account-manager/db/schema/used-refresh-token.js.map +1 -0
  32. package/dist/account-manager/helpers/account.d.ts +27 -5
  33. package/dist/account-manager/helpers/account.d.ts.map +1 -1
  34. package/dist/account-manager/helpers/account.js +15 -14
  35. package/dist/account-manager/helpers/account.js.map +1 -1
  36. package/dist/account-manager/helpers/authorization-request.d.ts +12 -0
  37. package/dist/account-manager/helpers/authorization-request.d.ts.map +1 -0
  38. package/dist/account-manager/helpers/authorization-request.js +59 -0
  39. package/dist/account-manager/helpers/authorization-request.js.map +1 -0
  40. package/dist/account-manager/helpers/device-account.d.ts +108 -0
  41. package/dist/account-manager/helpers/device-account.d.ts.map +1 -0
  42. package/dist/account-manager/helpers/device-account.js +82 -0
  43. package/dist/account-manager/helpers/device-account.js.map +1 -0
  44. package/dist/account-manager/helpers/device.d.ts +9 -0
  45. package/dist/account-manager/helpers/device.d.ts.map +1 -0
  46. package/dist/account-manager/helpers/device.js +32 -0
  47. package/dist/account-manager/helpers/device.js.map +1 -0
  48. package/dist/account-manager/helpers/token.d.ts +485 -0
  49. package/dist/account-manager/helpers/token.d.ts.map +1 -0
  50. package/dist/account-manager/helpers/token.js +123 -0
  51. package/dist/account-manager/helpers/token.js.map +1 -0
  52. package/dist/account-manager/helpers/used-refresh-token.d.ts +10 -0
  53. package/dist/account-manager/helpers/used-refresh-token.d.ts.map +1 -0
  54. package/dist/account-manager/helpers/used-refresh-token.js +25 -0
  55. package/dist/account-manager/helpers/used-refresh-token.js.map +1 -0
  56. package/dist/account-manager/index.d.ts +36 -6
  57. package/dist/account-manager/index.d.ts.map +1 -1
  58. package/dist/account-manager/index.js +223 -22
  59. package/dist/account-manager/index.js.map +1 -1
  60. package/dist/actor-store/preference/reader.js.map +1 -1
  61. package/dist/actor-store/record/reader.d.ts +1 -1
  62. package/dist/api/app/bsky/util/resolver.d.ts +1 -1
  63. package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
  64. package/dist/api/com/atproto/server/createSession.js +7 -31
  65. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  66. package/dist/api/com/atproto/server/deleteSession.d.ts.map +1 -1
  67. package/dist/api/com/atproto/server/deleteSession.js +14 -13
  68. package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
  69. package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
  70. package/dist/api/com/atproto/server/getSession.js +4 -2
  71. package/dist/api/com/atproto/server/getSession.js.map +1 -1
  72. package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
  73. package/dist/api/com/atproto/server/refreshSession.js +4 -2
  74. package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
  75. package/dist/api/com/atproto/sync/getRepoStatus.d.ts.map +1 -1
  76. package/dist/api/com/atproto/sync/getRepoStatus.js +2 -1
  77. package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
  78. package/dist/api/com/atproto/sync/listRepos.js +2 -2
  79. package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
  80. package/dist/api/proxy.d.ts.map +1 -1
  81. package/dist/api/proxy.js +15 -2
  82. package/dist/api/proxy.js.map +1 -1
  83. package/dist/auth-routes.d.ts +4 -0
  84. package/dist/auth-routes.d.ts.map +1 -0
  85. package/dist/auth-routes.js +24 -0
  86. package/dist/auth-routes.js.map +1 -0
  87. package/dist/auth-verifier.d.ts +32 -11
  88. package/dist/auth-verifier.d.ts.map +1 -1
  89. package/dist/auth-verifier.js +238 -79
  90. package/dist/auth-verifier.js.map +1 -1
  91. package/dist/config/config.d.ts +12 -0
  92. package/dist/config/config.d.ts.map +1 -1
  93. package/dist/config/config.js +45 -0
  94. package/dist/config/config.js.map +1 -1
  95. package/dist/config/env.d.ts +8 -0
  96. package/dist/config/env.d.ts.map +1 -1
  97. package/dist/config/env.js +10 -0
  98. package/dist/config/env.js.map +1 -1
  99. package/dist/config/secrets.d.ts +1 -0
  100. package/dist/config/secrets.d.ts.map +1 -1
  101. package/dist/config/secrets.js +1 -0
  102. package/dist/config/secrets.js.map +1 -1
  103. package/dist/context.d.ts +6 -0
  104. package/dist/context.d.ts.map +1 -1
  105. package/dist/context.js +71 -13
  106. package/dist/context.js.map +1 -1
  107. package/dist/db/cast.d.ts +15 -0
  108. package/dist/db/cast.d.ts.map +1 -0
  109. package/dist/db/cast.js +66 -0
  110. package/dist/db/cast.js.map +1 -0
  111. package/dist/db/db.d.ts +2 -2
  112. package/dist/db/db.d.ts.map +1 -1
  113. package/dist/db/db.js +9 -7
  114. package/dist/db/db.js.map +1 -1
  115. package/dist/db/index.d.ts +1 -0
  116. package/dist/db/index.d.ts.map +1 -1
  117. package/dist/db/index.js +1 -0
  118. package/dist/db/index.js.map +1 -1
  119. package/dist/error.d.ts.map +1 -1
  120. package/dist/error.js +5 -0
  121. package/dist/error.js.map +1 -1
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +2 -0
  124. package/dist/index.js.map +1 -1
  125. package/dist/logger.d.ts +13 -11
  126. package/dist/logger.d.ts.map +1 -1
  127. package/dist/logger.js +80 -64
  128. package/dist/logger.js.map +1 -1
  129. package/dist/oauth/detailed-account-store.d.ts +27 -0
  130. package/dist/oauth/detailed-account-store.d.ts.map +1 -0
  131. package/dist/oauth/detailed-account-store.js +76 -0
  132. package/dist/oauth/detailed-account-store.js.map +1 -0
  133. package/dist/oauth/provider.d.ts +16 -0
  134. package/dist/oauth/provider.d.ts.map +1 -0
  135. package/dist/oauth/provider.js +45 -0
  136. package/dist/oauth/provider.js.map +1 -0
  137. package/dist/pipethrough.d.ts.map +1 -1
  138. package/dist/pipethrough.js.map +1 -1
  139. package/dist/sequencer/events.d.ts +2 -2
  140. package/example.env +21 -3
  141. package/package.json +9 -7
  142. package/src/account-manager/db/migrations/004-oauth.ts +122 -0
  143. package/src/account-manager/db/migrations/index.ts +2 -0
  144. package/src/account-manager/db/schema/authorization-request.ts +26 -0
  145. package/src/account-manager/db/schema/device-account.ts +15 -0
  146. package/src/account-manager/db/schema/device.ts +18 -0
  147. package/src/account-manager/db/schema/index.ts +15 -0
  148. package/src/account-manager/db/schema/token.ts +34 -0
  149. package/src/account-manager/db/schema/used-refresh-token.ts +13 -0
  150. package/src/account-manager/helpers/account.ts +16 -21
  151. package/src/account-manager/helpers/authorization-request.ts +82 -0
  152. package/src/account-manager/helpers/device-account.ts +135 -0
  153. package/src/account-manager/helpers/device.ts +45 -0
  154. package/src/account-manager/helpers/token.ts +185 -0
  155. package/src/account-manager/helpers/used-refresh-token.ts +30 -0
  156. package/src/account-manager/index.ts +325 -20
  157. package/src/actor-store/preference/reader.ts +1 -1
  158. package/src/api/com/atproto/server/createSession.ts +8 -44
  159. package/src/api/com/atproto/server/deleteSession.ts +14 -20
  160. package/src/api/com/atproto/server/getSession.ts +7 -2
  161. package/src/api/com/atproto/server/refreshSession.ts +6 -2
  162. package/src/api/com/atproto/sync/getRepoStatus.ts +3 -1
  163. package/src/api/com/atproto/sync/listRepos.ts +1 -1
  164. package/src/api/proxy.ts +18 -2
  165. package/src/auth-routes.ts +27 -0
  166. package/src/auth-verifier.ts +312 -92
  167. package/src/config/config.ts +66 -0
  168. package/src/config/env.ts +24 -0
  169. package/src/config/secrets.ts +2 -0
  170. package/src/context.ts +80 -14
  171. package/src/db/cast.ts +59 -0
  172. package/src/db/db.ts +15 -12
  173. package/src/db/index.ts +1 -0
  174. package/src/error.ts +7 -0
  175. package/src/index.ts +2 -0
  176. package/src/logger.ts +83 -38
  177. package/src/oauth/detailed-account-store.ts +96 -0
  178. package/src/oauth/provider.ts +77 -0
  179. package/src/pipethrough.ts +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAC5B,8DAAgC;AAChC,4CAAmD;AAGnD,iCAAiC;AACjC,gEAAgE;AAEzD,MAAM,QAAQ,GAAG,CAAC,GAAsB,EAAgB,EAAE;IAC/D,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,CAAA;IAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,I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C,YAAY;wBACzB,KAAK,EAAE,GAAG,CAAC,UAAU;qBACtB;oBACD,KAAK,EAAE;wBACL;4BACE,KAAK,EAAE,MAAM;4BACb,IAAI,EAAE,GAAG,CAAC,OAAO;4BACjB,GAAG,EAAE,UAAU;yBAChB;wBACD;4BACE,KAAK,EAAE,kBAAkB;4BACzB,IAAI,EAAE,GAAG,CAAC,iBAAiB;4BAC3B,GAAG,EAAE,kBAAkB;yBACxB;wBACD;4BACE,KAAK,EAAE,gBAAgB;4BACvB,IAAI,EAAE,GAAG,CAAC,gBAAgB;4BAC1B,GAAG,EAAE,gBAAgB;yBACtB;wBACD;4BACE,KAAK,EAAE,SAAS;4BAChB,IAAI,EAAE,GAAG,CAAC,UAAU;4BACpB,GAAG,EAAE,MAAM;yBACZ;qBACF,CAAC,MAAM,CACN,CAAC,CAAC,EAA6D,EAAE,CAC/D,CAAC,CAAC,IAAI,IAAI,IAAI,CACjB;iBACF;aACF;SACF,CAAA;IAEL,OAAO;QACL,OAAO,EAAE,UAAU;QACnB,EAAE,EAAE,KAAK;QACT,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,OAAO,EAAE,UAAU;QACnB,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE,kBAAkB;QACnC,YAAY,EAAE,eAAe;QAC7B,WAAW,EAAE,cAAc;QAC3B,UAAU,EAAE,aAAa;QACzB,aAAa,EAAE,gBAAgB;QAC/B,KAAK,EAAE,QAAQ;QACf,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,WAAW;QACrB,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;KAChB,CAAA;AACH,CAAC,CAAA;AAxSY,QAAA,QAAQ,YAwSpB"}
@@ -3,13 +3,19 @@ export type ServerEnvironment = {
3
3
  port?: number;
4
4
  hostname?: string;
5
5
  serviceDid?: string;
6
+ serviceName?: string;
6
7
  version?: string;
8
+ homeUrl?: string;
9
+ logoUrl?: string;
7
10
  privacyPolicyUrl?: string;
11
+ supportUrl?: string;
8
12
  termsOfServiceUrl?: string;
9
13
  contactEmailAddress?: string;
10
14
  acceptingImports?: boolean;
11
15
  blobUploadLimit?: number;
12
16
  devMode?: boolean;
17
+ primaryColor?: string;
18
+ errorColor?: string;
13
19
  dataDirectory?: string;
14
20
  disableWalAutoCheckpoint?: boolean;
15
21
  accountDbLocation?: string;
@@ -60,9 +66,11 @@ export type ServerEnvironment = {
60
66
  redisScratchAddress?: string;
61
67
  redisScratchPassword?: string;
62
68
  crawlers?: string[];
69
+ dpopSecret?: string;
63
70
  jwtSecret?: string;
64
71
  adminPassword?: string;
65
72
  plcRotationKeyKmsKeyId?: string;
66
73
  plcRotationKeyK256PrivateKeyHex?: string;
74
+ fetchDisableSsrfProtection?: boolean;
67
75
  };
68
76
  //# sourceMappingURL=env.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAAO,iBA2G1B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAE9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IAGjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mBAAmB,CAAC,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const readEnv = () => {
8
8
  port: (0, common_1.envInt)('PDS_PORT'),
9
9
  hostname: (0, common_1.envStr)('PDS_HOSTNAME'),
10
10
  serviceDid: (0, common_1.envStr)('PDS_SERVICE_DID'),
11
+ serviceName: (0, common_1.envStr)('PDS_SERVICE_NAME'),
11
12
  version: (0, common_1.envStr)('PDS_VERSION'),
13
+ homeUrl: (0, common_1.envStr)('PDS_HOME_URL'),
14
+ logoUrl: (0, common_1.envStr)('PDS_LOGO_URL'),
12
15
  privacyPolicyUrl: (0, common_1.envStr)('PDS_PRIVACY_POLICY_URL'),
16
+ supportUrl: (0, common_1.envStr)('PDS_SUPPORT_URL'),
13
17
  termsOfServiceUrl: (0, common_1.envStr)('PDS_TERMS_OF_SERVICE_URL'),
14
18
  contactEmailAddress: (0, common_1.envStr)('PDS_CONTACT_EMAIL_ADDRESS'),
15
19
  acceptingImports: (0, common_1.envBool)('PDS_ACCEPTING_REPO_IMPORTS'),
16
20
  blobUploadLimit: (0, common_1.envInt)('PDS_BLOB_UPLOAD_LIMIT'),
17
21
  devMode: (0, common_1.envBool)('PDS_DEV_MODE'),
22
+ // branding
23
+ primaryColor: (0, common_1.envStr)('PDS_PRIMARY_COLOR'),
24
+ errorColor: (0, common_1.envStr)('PDS_ERROR_COLOR'),
18
25
  // database
19
26
  dataDirectory: (0, common_1.envStr)('PDS_DATA_DIRECTORY'),
20
27
  disableWalAutoCheckpoint: (0, common_1.envBool)('PDS_SQLITE_DISABLE_WAL_AUTO_CHECKPOINT'),
@@ -82,12 +89,15 @@ const readEnv = () => {
82
89
  // crawlers
83
90
  crawlers: (0, common_1.envList)('PDS_CRAWLERS'),
84
91
  // secrets
92
+ dpopSecret: (0, common_1.envStr)('PDS_DPOP_SECRET'),
85
93
  jwtSecret: (0, common_1.envStr)('PDS_JWT_SECRET'),
86
94
  adminPassword: (0, common_1.envStr)('PDS_ADMIN_PASSWORD'),
87
95
  // kms
88
96
  plcRotationKeyKmsKeyId: (0, common_1.envStr)('PDS_PLC_ROTATION_KEY_KMS_KEY_ID'),
89
97
  // memory
90
98
  plcRotationKeyK256PrivateKeyHex: (0, common_1.envStr)('PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX'),
99
+ // fetch
100
+ fetchDisableSsrfProtection: (0, common_1.envBool)('PDS_DISABLE_SSRF_PROTECTION'),
91
101
  };
92
102
  };
93
103
  exports.readEnv = readEnv;
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":";;;AAAA,4CAAkE;AAE3D,MAAM,OAAO,GAAG,GAAsB,EAAE;IAC7C,OAAO;QACL,UAAU;QACV,IAAI,EAAE,IAAA,eAAM,EAAC,UAAU,CAAC;QACxB,QAAQ,EAAE,IAAA,eAAM,EAAC,cAAc,CAAC;QAChC,UAAU,EAAE,IAAA,eAAM,EAAC,iBAAiB,CAAC;QACrC,OAAO,EAAE,IAAA,eAAM,EAAC,aAAa,CAAC;QAC9B,gBAAgB,EAAE,IAAA,eAAM,EAAC,wBAAwB,CAAC;QAClD,iBAAiB,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC;QACrD,mBAAmB,EAAE,IAAA,eAAM,EAAC,2BAA2B,CAAC;QACxD,gBAAgB,EAAE,IAAA,gBAAO,EAAC,4BAA4B,CAAC;QACvD,eAAe,EAAE,IAAA,eAAM,EAAC,uBAAuB,CAAC;QAChD,OAAO,EAAE,IAAA,gBAAO,EAAC,cAAc,CAAC;QAEhC,WAAW;QACX,aAAa,EAAE,IAAA,eAAM,EAAC,oBAAoB,CAAC;QAC3C,wBAAwB,EAAE,IAAA,gBAAO,EAAC,wCAAwC,CAAC;QAC3E,iBAAiB,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC;QACpD,mBAAmB,EAAE,IAAA,eAAM,EAAC,2BAA2B,CAAC;QACxD,kBAAkB,EAAE,IAAA,eAAM,EAAC,2BAA2B,CAAC;QAEvD,cAAc;QACd,mBAAmB,EAAE,IAAA,e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gBAAgB,EAAE,IAAA,eAAM,EAAC,wBAAwB,CAAC;QAClD,gBAAgB,EAAE,IAAA,eAAM,EAAC,wBAAwB,CAAC;QAElD,cAAc;QACd,iBAAiB,EAAE,IAAA,gBAAO,EAAC,yBAAyB,CAAC;QACrD,kBAAkB,EAAE,IAAA,eAAM,EAAC,2BAA2B,CAAC;QACvD,kBAAkB,EAAE,IAAA,gBAAO,EAAC,2BAA2B,CAAC;QAExD,QAAQ;QACR,mBAAmB,EAAE,IAAA,eAAM,EAAC,2BAA2B,CAAC;QACxD,oBAAoB,EAAE,IAAA,eAAM,EAAC,4BAA4B,CAAC;QAE1D,WAAW;QACX,QAAQ,EAAE,IAAA,gBAAO,EAAC,cAAc,CAAC;QAEjC,UAAU;QACV,UAAU,EAAE,IAAA,eAAM,EAAC,iBAAiB,CAAC;QACrC,SAAS,EAAE,IAAA,eAAM,EAAC,gBAAgB,CAAC;QACnC,aAAa,EAAE,IAAA,eAAM,EAAC,oBAAoB,CAAC;QAE3C,MAAM;QACN,sBAAsB,EAAE,IAAA,eAAM,EAAC,iCAAiC,CAAC;QACjE,SAAS;QACT,+BAA+B,EAAE,IAAA,eAAM,EACrC,2CAA2C,CAC5C;QAED,QAAQ;QACR,0BAA0B,EAAE,IAAA,gBAAO,EAAC,6BAA6B,CAAC;KACnE,CAAA;AACH,CAAC,CAAA;AAvHY,QAAA,OAAO,WAuHnB"}
@@ -1,6 +1,7 @@
1
1
  import { ServerEnvironment } from './env';
2
2
  export declare const envToSecrets: (env: ServerEnvironment) => ServerSecrets;
3
3
  export type ServerSecrets = {
4
+ dpopSecret?: string;
4
5
  jwtSecret: string;
5
6
  adminPassword: string;
6
7
  plcRotationKey: SigningKeyKms | SigningKeyMemory;
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/config/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,eAAO,MAAM,YAAY,QAAS,iBAAiB,KAAG,aA+BrD,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,aAAa,GAAG,gBAAgB,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA"}
1
+ {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/config/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,eAAO,MAAM,YAAY,QAAS,iBAAiB,KAAG,aAgCrD,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,aAAa,GAAG,gBAAgB,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA"}
@@ -28,6 +28,7 @@ const envToSecrets = (env) => {
28
28
  throw new Error('Must provide an admin password');
29
29
  }
30
30
  return {
31
+ dpopSecret: env.dpopSecret,
31
32
  jwtSecret: env.jwtSecret,
32
33
  adminPassword: env.adminPassword,
33
34
  plcRotationKey,
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/config/secrets.ts"],"names":[],"mappings":";;;A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AC;SAAM,IAAI,GAAG,CAAC,sBAAsB,EAAE,CAAC;QACtC,cAAc,GAAG;YACf,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,GAAG,CAAC,sBAAsB;SAClC,CAAA;IACH,CAAC;SAAM,IAAI,GAAG,CAAC,+BAA+B,EAAE,CAAC;QAC/C,cAAc,GAAG;YACf,QAAQ,EAAE,QAAQ;YAClB,aAAa,EAAE,GAAG,CAAC,+BAA+B;SACnD,CAAA;IACH,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC9C,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACnD,CAAC;IAED,OAAO;QACL,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,cAAc;KACf,CAAA;AACH,CAAC,CAAA;AAhCY,QAAA,YAAY,gBAgCxB"}
package/dist/context.d.ts CHANGED
@@ -4,7 +4,9 @@ import * as crypto from '@atproto/crypto';
4
4
  import { IdResolver } from '@atproto/identity';
5
5
  import { AtpAgent } from '@atproto/api';
6
6
  import { RateLimiterCreator } from '@atproto/xrpc-server';
7
+ import { Fetch } from '@atproto/oauth-provider';
7
8
  import { ServerConfig, ServerSecrets } from './config';
9
+ import { PdsOAuthProvider } from './oauth/provider';
8
10
  import { AuthVerifier } from './auth-verifier';
9
11
  import { ServerMailer } from './mailer';
10
12
  import { ModerationMailer } from './mailer/moderation';
@@ -35,6 +37,8 @@ export type AppContextOptions = {
35
37
  moderationAgent?: AtpAgent;
36
38
  reportingAgent?: AtpAgent;
37
39
  entrywayAgent?: AtpAgent;
40
+ safeFetch: Fetch;
41
+ authProvider?: PdsOAuthProvider;
38
42
  authVerifier: AuthVerifier;
39
43
  plcRotationKey: crypto.Keypair;
40
44
  cfg: ServerConfig;
@@ -58,7 +62,9 @@ export declare class AppContext {
58
62
  moderationAgent: AtpAgent | undefined;
59
63
  reportingAgent: AtpAgent | undefined;
60
64
  entrywayAgent: AtpAgent | undefined;
65
+ safeFetch: Fetch;
61
66
  authVerifier: AuthVerifier;
67
+ authProvider?: PdsOAuthProvider;
62
68
  plcRotationKey: crypto.Keypair;
63
69
  cfg: ServerConfig;
64
70
  constructor(opts: AppContextOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAEL,kBAAkB,EAGnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EACL,YAAY,EAGb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,QA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AAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,OAAO,CAAC,UAAU,CAAC;IA6NhB,kBAAkB,CAAC,GAAG,EAAE,MAAM;;;;;IAK9B,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;;;;;CAQlD;AAED,eAAe,UAAU,CAAA"}
package/dist/context.js CHANGED
@@ -35,7 +35,10 @@ const identity_1 = require("@atproto/identity");
35
35
  const api_1 = require("@atproto/api");
36
36
  const aws_1 = require("@atproto/aws");
37
37
  const xrpc_server_1 = require("@atproto/xrpc-server");
38
+ const oauth_provider_1 = require("@atproto/oauth-provider");
39
+ const provider_1 = require("./oauth/provider");
38
40
  const auth_verifier_1 = require("./auth-verifier");
41
+ const logger_1 = require("./logger");
39
42
  const mailer_1 = require("./mailer");
40
43
  const moderation_1 = require("./mailer/moderation");
41
44
  const account_manager_1 = require("./account-manager");
@@ -157,12 +160,24 @@ class AppContext {
157
160
  writable: true,
158
161
  value: void 0
159
162
  });
163
+ Object.defineProperty(this, "safeFetch", {
164
+ enumerable: true,
165
+ configurable: true,
166
+ writable: true,
167
+ value: void 0
168
+ });
160
169
  Object.defineProperty(this, "authVerifier", {
161
170
  enumerable: true,
162
171
  configurable: true,
163
172
  writable: true,
164
173
  value: void 0
165
174
  });
175
+ Object.defineProperty(this, "authProvider", {
176
+ enumerable: true,
177
+ configurable: true,
178
+ writable: true,
179
+ value: void 0
180
+ });
166
181
  Object.defineProperty(this, "plcRotationKey", {
167
182
  enumerable: true,
168
183
  configurable: true,
@@ -193,7 +208,9 @@ class AppContext {
193
208
  this.moderationAgent = opts.moderationAgent;
194
209
  this.reportingAgent = opts.reportingAgent;
195
210
  this.entrywayAgent = opts.entrywayAgent;
211
+ this.safeFetch = opts.safeFetch;
196
212
  this.authVerifier = opts.authVerifier;
213
+ this.authProvider = opts.authProvider;
197
214
  this.plcRotationKey = opts.plcRotationKey;
198
215
  this.cfg = opts.cfg;
199
216
  }
@@ -266,20 +283,11 @@ class AppContext {
266
283
  ? new api_1.AtpAgent({ service: cfg.entryway.url })
267
284
  : undefined;
268
285
  const jwtSecretKey = (0, auth_verifier_1.createSecretKeyObject)(secrets.jwtSecret);
269
- const accountManager = new account_manager_1.AccountManager(cfg.db.accountDbLoc, jwtSecretKey, cfg.service.did, cfg.db.disableWalAutoCheckpoint);
270
- await accountManager.migrateOrThrow();
271
- const jwtKey = cfg.entryway
286
+ const jwtPublicKey = cfg.entryway
272
287
  ? (0, auth_verifier_1.createPublicKeyObject)(cfg.entryway.jwtPublicKeyHex)
273
- : jwtSecretKey;
274
- const authVerifier = new auth_verifier_1.AuthVerifier(accountManager, idResolver, {
275
- jwtKey, // @TODO support multiple keys?
276
- adminPass: secrets.adminPassword,
277
- dids: {
278
- pds: cfg.service.did,
279
- entryway: cfg.entryway?.did,
280
- modService: cfg.modService?.did,
281
- },
282
- });
288
+ : null;
289
+ const accountManager = new account_manager_1.AccountManager(backgroundQueue, cfg.db.accountDbLoc, jwtSecretKey, cfg.service.did, cfg.db.disableWalAutoCheckpoint);
290
+ await accountManager.migrateOrThrow();
283
291
  const plcRotationKey = secrets.plcRotationKey.provider === 'kms'
284
292
  ? await aws_1.KmsKeypair.load({
285
293
  keyId: secrets.plcRotationKey.keyId,
@@ -296,6 +304,54 @@ class AppContext {
296
304
  appviewDid: cfg.bskyAppView?.did,
297
305
  appviewCdnUrlPattern: cfg.bskyAppView?.cdnUrlPattern,
298
306
  });
307
+ // A fetch() function that protects against SSRF attacks, large responses &
308
+ // known bad domains. This function can safely be used to fetch user
309
+ // provided URLs (unless "disableSsrfProtection" is true, of course).
310
+ const safeFetch = (0, oauth_provider_1.safeFetchWrap)({
311
+ allowHttp: cfg.fetch.disableSsrfProtection,
312
+ responseMaxSize: 512 * 1024, // 512kB
313
+ ssrfProtection: !cfg.fetch.disableSsrfProtection,
314
+ fetch: async (input, init) => {
315
+ const request = input instanceof Request ? input : null;
316
+ const method = init?.method ?? request?.method ?? 'GET';
317
+ const uri = request?.url ?? String(input);
318
+ logger_1.fetchLogger.debug({ method, uri }, 'fetch');
319
+ return globalThis.fetch(input, init);
320
+ },
321
+ });
322
+ const authProvider = cfg.oauth.provider
323
+ ? new provider_1.PdsOAuthProvider({
324
+ issuer: cfg.oauth.issuer,
325
+ keyset: [
326
+ // Note: OpenID compatibility would require an RS256 private key in this list
327
+ await oauth_provider_1.JoseKey.fromKeyLike(jwtSecretKey, undefined, 'HS256'),
328
+ ],
329
+ accountManager,
330
+ actorStore,
331
+ localViewer,
332
+ redis: redisScratch,
333
+ dpopSecret: secrets.dpopSecret,
334
+ customization: cfg.oauth.provider.customization,
335
+ safeFetch,
336
+ })
337
+ : undefined;
338
+ const oauthVerifier = authProvider ?? // OAuthProvider extends OAuthVerifier
339
+ new oauth_provider_1.OAuthVerifier({
340
+ issuer: cfg.oauth.issuer,
341
+ keyset: [await oauth_provider_1.JoseKey.fromKeyLike(jwtPublicKey, undefined, 'ES256K')],
342
+ dpopSecret: secrets.dpopSecret,
343
+ redis: redisScratch,
344
+ });
345
+ const authVerifier = new auth_verifier_1.AuthVerifier(accountManager, idResolver, oauthVerifier, {
346
+ publicUrl: cfg.service.publicUrl,
347
+ jwtKey: jwtPublicKey ?? jwtSecretKey,
348
+ adminPass: secrets.adminPassword,
349
+ dids: {
350
+ pds: cfg.service.did,
351
+ entryway: cfg.entryway?.did,
352
+ modService: cfg.modService?.did,
353
+ },
354
+ });
299
355
  return new AppContext({
300
356
  actorStore,
301
357
  blobstore,
@@ -315,7 +371,9 @@ class AppContext {
315
371
  moderationAgent,
316
372
  reportingAgent,
317
373
  entrywayAgent,
374
+ safeFetch,
318
375
  authVerifier,
376
+ authProvider,
319
377
  plcRotationKey,
320
378
  cfg,
321
379
  ...(overrides ?? {}),
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAgC;AAChC,uDAA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AAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAC/D,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,GAAW,EAAE,GAAW;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAClD,OAAO,IAAA,sCAAwB,EAAC;YAC9B,GAAG,EAAE,GAAG;YACR,GAAG;YACH,OAAO;SACR,CAAC,CAAA;IACJ,CAAC;CACF;AAjSD,gCAiSC;AAED,kBAAe,UAAU,CAAA"}
@@ -0,0 +1,15 @@
1
+ export type DateISO = `${string}T${string}Z`;
2
+ export declare const toDateISO: (date: Date) => DateISO;
3
+ export declare const fromDateISO: (date: DateISO) => Date;
4
+ export type Json = string;
5
+ export declare const toJson: (obj: unknown) => Json;
6
+ export declare const fromJson: <T>(json: Json) => T;
7
+ export type JsonArray = `[${string}]`;
8
+ export declare const isJsonArray: (json: string) => json is `[${string}]`;
9
+ export declare function assertJsonArray(json: string): asserts json is JsonArray;
10
+ export declare const toJsonArray: (obj: readonly unknown[]) => JsonArray;
11
+ export declare const fromJsonArray: <T>(json: JsonArray) => T[];
12
+ export type JsonObject = `{${string}}`;
13
+ export declare const toJsonObject: (obj: Readonly<Record<string, unknown>>) => JsonObject;
14
+ export declare const fromJsonObject: <T extends Record<string, unknown>>(json: JsonObject) => T;
15
+ //# sourceMappingURL=cast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast.d.ts","sourceRoot":"","sources":["../../src/db/cast.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,GAAG,MAAM,IAAI,MAAM,GAAG,CAAA;AAC5C,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,OAAwC,CAAA;AAC/E,eAAO,MAAM,WAAW,SAAU,OAAO,KAAG,IAAsB,CAAA;AAElE,MAAM,MAAM,IAAI,GAAG,MAAM,CAAA;AACzB,eAAO,MAAM,MAAM,QAAS,OAAO,KAAG,IAIrC,CAAA;AACD,eAAO,MAAM,QAAQ,YAAa,IAAI,KAAG,CAMxC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,MAAM,GAAG,CAAA;AACrC,eAAO,MAAM,WAAW,SAAU,MAAM,0BAI0B,CAAA;AAClE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAEvE;AACD,eAAO,MAAM,WAAW,QAAS,SAAS,OAAO,EAAE,KAAG,SAIrD,CAAA;AACD,eAAO,MAAM,aAAa,YAAa,SAAS,KAAG,CAAC,EAGnD,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,MAAM,GAAG,CAAA;AAStC,eAAO,MAAM,YAAY,QAClB,SAAS,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,KACrC,UAIF,CAAA;AACD,eAAO,MAAM,cAAc,4CACnB,UAAU,KACf,CAGF,CAAA"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fromJsonObject = exports.toJsonObject = exports.fromJsonArray = exports.toJsonArray = exports.assertJsonArray = exports.isJsonArray = exports.fromJson = exports.toJson = exports.fromDateISO = exports.toDateISO = void 0;
4
+ const toDateISO = (date) => date.toISOString();
5
+ exports.toDateISO = toDateISO;
6
+ const fromDateISO = (date) => new Date(date);
7
+ exports.fromDateISO = fromDateISO;
8
+ const toJson = (obj) => {
9
+ const json = JSON.stringify(obj);
10
+ if (json === undefined)
11
+ throw new TypeError('Input not JSONifyable');
12
+ return json;
13
+ };
14
+ exports.toJson = toJson;
15
+ const fromJson = (json) => {
16
+ try {
17
+ return JSON.parse(json);
18
+ }
19
+ catch (cause) {
20
+ throw new TypeError('Database contains invalid JSON', { cause });
21
+ }
22
+ };
23
+ exports.fromJson = fromJson;
24
+ const isJsonArray = (json) =>
25
+ // Although the JSON in the DB should have been encoded using toJson,
26
+ // there should not be any leading or trailing whitespace. We will still trim
27
+ // the string to protect against any manual editing of the DB.
28
+ json.trimStart().startsWith('[') && json.trimEnd().endsWith(']');
29
+ exports.isJsonArray = isJsonArray;
30
+ function assertJsonArray(json) {
31
+ if (!(0, exports.isJsonArray)(json))
32
+ throw new TypeError('Not an Array');
33
+ }
34
+ exports.assertJsonArray = assertJsonArray;
35
+ const toJsonArray = (obj) => {
36
+ const json = (0, exports.toJson)(obj);
37
+ assertJsonArray(json);
38
+ return json;
39
+ };
40
+ exports.toJsonArray = toJsonArray;
41
+ const fromJsonArray = (json) => {
42
+ assertJsonArray(json);
43
+ return (0, exports.fromJson)(json);
44
+ };
45
+ exports.fromJsonArray = fromJsonArray;
46
+ const isJsonObject = (json) =>
47
+ // Although the JSON in the DB should have been encoded using toJson,
48
+ // there should not be any leading or trailing whitespace. We will still trim
49
+ // the string to protect against any manual editing of the DB.
50
+ json.trimStart().startsWith('{') && json.trimEnd().endsWith('}');
51
+ function assertJsonObject(json) {
52
+ if (!isJsonObject(json))
53
+ throw new TypeError('Not an Object');
54
+ }
55
+ const toJsonObject = (obj) => {
56
+ const json = (0, exports.toJson)(obj);
57
+ assertJsonObject(json);
58
+ return json;
59
+ };
60
+ exports.toJsonObject = toJsonObject;
61
+ const fromJsonObject = (json) => {
62
+ assertJsonObject(json);
63
+ return (0, exports.fromJson)(json);
64
+ };
65
+ exports.fromJsonObject = fromJsonObject;
66
+ //# sourceMappingURL=cast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast.js","sourceRoot":"","sources":["../../src/db/cast.ts"],"names":[],"mappings":";;;AACO,MAAM,SAAS,GAAG,CAAC,IAAU,EAAW,EAAE,CAAC,IAAI,CAAC,WAAW,EAAa,CAAA;AAAlE,QAAA,SAAS,aAAyD;AACxE,MAAM,WAAW,GAAG,CAAC,IAAa,EAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAA;AAArD,QAAA,WAAW,eAA0C;AAG3D,MAAM,MAAM,GAAG,CAAC,GAAY,EAAQ,EAAE;I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Q,EAAC,IAAI,CAAQ,CAAA;AAC9B,CAAC,CAAA;AAHY,QAAA,aAAa,iBAGzB;AAGD,MAAM,YAAY,GAAG,CAAC,IAAY,EAAsB,EAAE;AACxD,qEAAqE;AACrE,6EAA6E;AAC7E,8DAA8D;AAC9D,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAClE,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,eAAe,CAAC,CAAA;AAC/D,CAAC;AACM,MAAM,YAAY,GAAG,CAC1B,GAAsC,EAC1B,EAAE;IACd,MAAM,IAAI,GAAG,IAAA,cAAM,EAAC,GAAG,CAAC,CAAA;IACxB,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACtB,OAAO,IAAkB,CAAA;AAC3B,CAAC,CAAA;AANY,QAAA,YAAY,gBAMxB;AACM,MAAM,cAAc,GAAG,CAC5B,IAAgB,EACb,EAAE;IACL,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACtB,OAAO,IAAA,gBAAQ,EAAC,IAAI,CAAM,CAAA;AAC5B,CAAC,CAAA;AALY,QAAA,cAAc,kBAK1B"}
package/dist/db/db.d.ts CHANGED
@@ -8,8 +8,8 @@ export declare class Database<Schema> {
8
8
  pragmas?: Record<string, string>;
9
9
  }): Database<T>;
10
10
  ensureWal(): Promise<void>;
11
- transactionNoRetry<T>(fn: (db: Database<Schema>) => Promise<T>): Promise<T>;
12
- transaction<T>(fn: (db: Database<Schema>) => Promise<T>): Promise<T>;
11
+ transactionNoRetry<T>(fn: (db: Database<Schema>) => T | Promise<T>): Promise<T>;
12
+ transaction<T>(fn: (db: Database<Schema>) => T | Promise<T>): Promise<T>;
13
13
  executeWithRetry<T>(query: {
14
14
  execute: () => Promise<T>;
15
15
  }): Promise<T>;
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IP,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;IAHrC,SAAS,UAAQ;IACjB,WAAW,EAAE,UAAU,EAAE,CAAK;gBAEX,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;IAErC,MAAM,CAAC,MAAM,CAAC,CAAC,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAC1C,QAAQ,CAAC,CAAC,CAAC;IAmBR,SAAS;IAIT,kBAAkB,CAAC,CAAC,EACxB,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC3C,OAAO,CAAC,CAAC,CAAC;IAwBP,WAAW,CAAC,CAAC,EACjB,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC3C,OAAO,CAAC,CAAC,CAAC;IAIP,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE;IAQ9D,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI;IAKvB,IAAI,aAAa,YAEhB;IAED,iBAAiB;IAIjB,oBAAoB;IAIpB,KAAK,IAAI,IAAI;CAOd;AAED,KAAK,UAAU,GAAG,MAAM,IAAI,CAAA"}
package/dist/db/db.js CHANGED
@@ -62,16 +62,18 @@ class Database {
62
62
  .transaction()
63
63
  .execute(async (txn) => {
64
64
  const dbTxn = new Database(txn);
65
- const txRes = await fn(dbTxn)
66
- .catch(async (err) => {
65
+ try {
66
+ const txRes = await fn(dbTxn);
67
+ leakyTxPlugin.endTx();
68
+ const hooks = dbTxn.commitHooks;
69
+ return { hooks, txRes };
70
+ }
71
+ catch (err) {
67
72
  leakyTxPlugin.endTx();
68
73
  // ensure that all in-flight queries are flushed & the connection is open
69
- await dbTxn.db.getExecutor().provideConnection(async () => { });
74
+ await txn.getExecutor().provideConnection(async () => { });
70
75
  throw err;
71
- })
72
- .finally(() => leakyTxPlugin.endTx());
73
- const hooks = dbTxn.commitHooks;
74
- return { hooks, txRes };
76
+ }
75
77
  });
76
78
  hooks.map((hook) => hook());
77
79
  return txRes;
package/dist/db/db.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/db/db.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA2B;AAC3B,mCAUe;AACf,oEAAqC;AACrC,sCAAoC;AACpC,iCAAoC;AAEpC,MAAM,eAAe,GAAG;AACtB,sEAAsE;CACvE,CAAA;AAED,MAAa,QAAQ;IAInB,YAAmB,EAAkB;QAAzB;;;;mBAAO,EAAE;WAAgB;QAHrC;;;;mBAAY,KAAK;WAAA;QACjB;;;;mBAA4B,EAAE;WAAA;IAEU,CAAC;IAEzC,MAAM,CAAC,MAAM,CACX,QAAgB,EAChB,IAA2C;QAE3C,MAAM,QAAQ,GAAG,IAAI,wBAAQ,CAAC,QAAQ,EAAE;YACtC,OAAO,EAAE,CAAC,EAAE,yBAAyB;SACtC,CAAC,CAAA;QACF,MAAM,OAAO,GAAG;YACd,GAAG,eAAe;YAClB,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;SACzB,CAAA;QACD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1C,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACnD,CAAC;QACD,MAAM,EAAE,GAAG,IAAI,eAAM,CAAI;YACvB,OAAO,EAAE,IAAI,sBAAa,CAAC;gBACzB,QAAQ,EAAE,QAAQ;aACnB,CAAC;SACH,CAAC,CAAA;QACF,OAAO,IAAI,QAAQ,CAAC,EA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,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,IAA+B;QAE/B,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF"}
@@ -1,4 +1,5 @@
1
1
  export * from './db';
2
+ export * from './cast';
2
3
  export * from './migrator';
3
4
  export * from './util';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA"}
package/dist/db/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./db"), exports);
18
+ __exportStar(require("./cast"), exports);
18
19
  __exportStar(require("./migrator"), exports);
19
20
  __exportStar(require("./util"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB;AACpB,6CAA0B;AAC1B,yCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB;AACpB,yCAAsB;AACtB,6CAA0B;AAC1B,yCAAsB"}
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAG7C,eAAO,MAAM,OAAO,EAAE,mBAOrB,CAAA"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAI7C,eAAO,MAAM,OAAO,EAAE,mBAarB,CAAA"}
package/dist/error.js CHANGED
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = void 0;
4
4
  const xrpc_server_1 = require("@atproto/xrpc-server");
5
5
  const logger_1 = require("./logger");
6
+ const oauth_provider_1 = require("@atproto/oauth-provider");
6
7
  const handler = (err, _req, res, next) => {
7
8
  logger_1.httpLogger.error(err, 'unexpected internal server error');
8
9
  if (res.headersSent) {
9
10
  return next(err);
10
11
  }
12
+ if (err instanceof oauth_provider_1.OAuthError) {
13
+ res.status(err.status).json(err.toJSON());
14
+ return;
15
+ }
11
16
  const serverError = xrpc_server_1.XRPCError.fromError(err);
12
17
  res.status(serverError.type).json(serverError.payload);
13
18
  };
package/dist/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA,sDAAgD;AAEhD,qCAA4C;AAErC,MAAM,OAAO,GAAwB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACnE,mBAAG,CAAC,KAAK,CAAC,GAAG,EAAE,kCAAkC,CAAC,CAAA;IAClD,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;IACD,MAAM,WAAW,GAAG,uBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC5C,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACxD,CAAC,CAAA;AAPY,QAAA,OAAO,WAOnB"}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA,sDAAgD;AAEhD,qCAA4C;AAC5C,4DAAoD;AAE7C,MAAM,OAAO,GAAwB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACnE,mBAAG,CAAC,KAAK,CAAC,GAAG,EAAE,kCAAkC,CAAC,CAAA;IAClD,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;IAED,IAAI,GAAG,YAAY,2BAAU,EAAE,CAAC;QAC9B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;QACzC,OAAM;IACR,CAAC;IAED,MAAM,WAAW,GAAG,uBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC5C,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACxD,CAAC,CAAA;AAbY,QAAA,OAAO,WAanB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAIA,OAAO,sBAAsB,CAAA;AAE7B,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,IAAI,MAAM,MAAM,CAAA;AASvB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGtD,OAAO,UAAU,EAAE,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAIzD,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,UAAU,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