@atproto/pds 0.4.53 → 0.4.55

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/account-manager/helpers/auth.d.ts.map +1 -1
  3. package/dist/account-manager/helpers/auth.js +8 -2
  4. package/dist/account-manager/helpers/auth.js.map +1 -1
  5. package/dist/api/com/atproto/admin/sendEmail.js +1 -4
  6. package/dist/api/com/atproto/admin/sendEmail.js.map +1 -1
  7. package/dist/api/com/atproto/admin/updateAccountEmail.js +2 -2
  8. package/dist/api/com/atproto/admin/updateAccountEmail.js.map +1 -1
  9. package/dist/api/com/atproto/admin/updateAccountPassword.js +2 -2
  10. package/dist/api/com/atproto/admin/updateAccountPassword.js.map +1 -1
  11. package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts +1 -1
  12. package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts.map +1 -1
  13. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +8 -3
  14. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
  15. package/dist/api/com/atproto/identity/signPlcOperation.d.ts +1 -1
  16. package/dist/api/com/atproto/identity/signPlcOperation.d.ts.map +1 -1
  17. package/dist/api/com/atproto/identity/signPlcOperation.js +9 -3
  18. package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
  19. package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
  20. package/dist/api/com/atproto/identity/updateHandle.js +8 -3
  21. package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
  22. package/dist/api/com/atproto/server/activateAccount.d.ts +1 -1
  23. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  24. package/dist/api/com/atproto/server/activateAccount.js +9 -4
  25. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  26. package/dist/api/com/atproto/server/confirmEmail.d.ts +1 -1
  27. package/dist/api/com/atproto/server/confirmEmail.d.ts.map +1 -1
  28. package/dist/api/com/atproto/server/confirmEmail.js +8 -3
  29. package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
  30. package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
  31. package/dist/api/com/atproto/server/createAppPassword.js +8 -2
  32. package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
  33. package/dist/api/com/atproto/server/deactivateAccount.d.ts +1 -1
  34. package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
  35. package/dist/api/com/atproto/server/deactivateAccount.js +8 -3
  36. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  37. package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts +1 -1
  38. package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts.map +1 -1
  39. package/dist/api/com/atproto/server/getAccountInviteCodes.js +9 -3
  40. package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
  41. package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
  42. package/dist/api/com/atproto/server/getServiceAuth.js +7 -4
  43. package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
  44. package/dist/api/com/atproto/server/listAppPasswords.d.ts.map +1 -1
  45. package/dist/api/com/atproto/server/listAppPasswords.js +8 -2
  46. package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
  47. package/dist/api/com/atproto/server/requestAccountDelete.d.ts +1 -1
  48. package/dist/api/com/atproto/server/requestAccountDelete.d.ts.map +1 -1
  49. package/dist/api/com/atproto/server/requestAccountDelete.js +8 -3
  50. package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
  51. package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts +1 -1
  52. package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts.map +1 -1
  53. package/dist/api/com/atproto/server/requestEmailConfirmation.js +8 -3
  54. package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
  55. package/dist/api/com/atproto/server/requestEmailUpdate.d.ts +1 -1
  56. package/dist/api/com/atproto/server/requestEmailUpdate.d.ts.map +1 -1
  57. package/dist/api/com/atproto/server/requestEmailUpdate.js +8 -2
  58. package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
  59. package/dist/api/com/atproto/server/revokeAppPassword.d.ts.map +1 -1
  60. package/dist/api/com/atproto/server/revokeAppPassword.js +8 -3
  61. package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
  62. package/dist/api/com/atproto/server/updateEmail.d.ts +1 -1
  63. package/dist/api/com/atproto/server/updateEmail.d.ts.map +1 -1
  64. package/dist/api/com/atproto/server/updateEmail.js +6 -4
  65. package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
  66. package/dist/api/proxy.js +5 -1
  67. package/dist/api/proxy.js.map +1 -1
  68. package/dist/auth-routes.d.ts.map +1 -1
  69. package/dist/auth-routes.js +3 -1
  70. package/dist/auth-routes.js.map +1 -1
  71. package/dist/auth-verifier.d.ts +2 -2
  72. package/dist/auth-verifier.d.ts.map +1 -1
  73. package/dist/auth-verifier.js +46 -15
  74. package/dist/auth-verifier.js.map +1 -1
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +6 -6
  77. package/dist/index.js.map +1 -1
  78. package/dist/lexicon/lexicons.d.ts +4 -0
  79. package/dist/lexicon/lexicons.d.ts.map +1 -1
  80. package/dist/lexicon/lexicons.js +4 -0
  81. package/dist/lexicon/lexicons.js.map +1 -1
  82. package/dist/lexicon/types/app/bsky/feed/getPostThread.d.ts +1 -0
  83. package/dist/lexicon/types/app/bsky/feed/getPostThread.d.ts.map +1 -1
  84. package/dist/oauth/provider.d.ts.map +1 -1
  85. package/dist/oauth/provider.js +1 -0
  86. package/dist/oauth/provider.js.map +1 -1
  87. package/dist/pipethrough.d.ts +1 -0
  88. package/dist/pipethrough.d.ts.map +1 -1
  89. package/dist/pipethrough.js +23 -2
  90. package/dist/pipethrough.js.map +1 -1
  91. package/package.json +11 -11
  92. package/src/account-manager/helpers/auth.ts +8 -2
  93. package/src/api/com/atproto/admin/sendEmail.ts +5 -5
  94. package/src/api/com/atproto/admin/updateAccountEmail.ts +1 -1
  95. package/src/api/com/atproto/admin/updateAccountPassword.ts +1 -1
  96. package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +13 -5
  97. package/src/api/com/atproto/identity/signPlcOperation.ts +15 -6
  98. package/src/api/com/atproto/identity/updateHandle.ts +10 -3
  99. package/src/api/com/atproto/server/activateAccount.ts +14 -5
  100. package/src/api/com/atproto/server/confirmEmail.ts +13 -5
  101. package/src/api/com/atproto/server/createAppPassword.ts +12 -3
  102. package/src/api/com/atproto/server/deactivateAccount.ts +11 -4
  103. package/src/api/com/atproto/server/getAccountInviteCodes.ts +14 -5
  104. package/src/api/com/atproto/server/getServiceAuth.ts +14 -9
  105. package/src/api/com/atproto/server/listAppPasswords.ts +11 -3
  106. package/src/api/com/atproto/server/requestAccountDelete.ts +12 -4
  107. package/src/api/com/atproto/server/requestEmailConfirmation.ts +12 -4
  108. package/src/api/com/atproto/server/requestEmailUpdate.ts +13 -4
  109. package/src/api/com/atproto/server/revokeAppPassword.ts +10 -3
  110. package/src/api/com/atproto/server/updateEmail.ts +14 -6
  111. package/src/api/proxy.ts +5 -1
  112. package/src/auth-routes.ts +3 -1
  113. package/src/auth-verifier.ts +63 -21
  114. package/src/index.ts +6 -7
  115. package/src/lexicon/lexicons.ts +4 -0
  116. package/src/lexicon/types/app/bsky/feed/getPostThread.ts +1 -0
  117. package/src/oauth/provider.ts +2 -0
  118. package/src/pipethrough.ts +25 -1
  119. package/tests/app-passwords.test.ts +2 -2
  120. package/tests/auth.test.ts +1 -1
  121. package/tests/entryway.test.ts +30 -4
@@ -18,6 +18,7 @@ export interface OutputSchema {
18
18
  $type: string;
19
19
  [k: string]: unknown;
20
20
  };
21
+ threadgate?: AppBskyFeedDefs.ThreadgateView;
21
22
  [k: string]: unknown;
22
23
  }
23
24
  export type HandlerInput = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"getPostThread.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/app/bsky/feed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CAAA;AAEnD,qBAAa,gBAAiB,SAAQ,aAAa;gBACrC,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACN,aAAa,EACb,SAAS,GACV,EAAE,mBAAmB;IAsCtB,YAAY;CAKb"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/oauth/provider.ts"],"names":[],"mappings":";;AAAA,OAAO,EAEL,aAAa,EACb,oBAAoB,EACrB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAG9D,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,kBAAkB,CAAA;CAChC,GAAG,IAAI,CACN,oBAAoB,EACpB,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,eAAe,CAC/D,GACC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC,CAAA;AAEnD,qBAAa,gBAAiB,SAAQ,aAAa;gBACrC,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACN,aAAa,EACb,SAAS,GACV,EAAE,mBAAmB;IAwCtB,YAAY;CAKb"}
@@ -18,6 +18,7 @@ class PdsOAuthProvider extends oauth_provider_1.OAuthProvider {
18
18
  // & resource server, in which case the issuer origin is also the
19
19
  // resource server uri.
20
20
  protected_resources: [new URL(issuer).origin],
21
+ scopes_supported: ['transition:generic', 'transition:chat.bsky'],
21
22
  },
22
23
  accountStore: new detailed_account_store_1.DetailedAccountStore(accountManager, actorStore, localViewer),
23
24
  requestStore: accountManager,
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/oauth/provider.ts"],"names":[],"mappings":";;;AAAA,4DAIgC;AAIhC,sCAAuC;AAEvC,qEAA+D;AAY/D,MAAa,gBAAiB,SAAQ,8BAAa;IACjD,YAAY,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACN,aAAa,EACb,SAAS,GACW;QACpB,KAAK,CAAC;YACJ,MAAM;YACN,MAAM;YACN,UAAU;YACV,KAAK;YACL,SAAS;YACT,aAAa;YACb,QAAQ,EAAE;gBACR,wEAAwE;gBACxE,iEAAiE;gBACjE,uBAAuB;gBACvB,mBAAmB,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;aAC9C;YAED,YAAY,EAAE,IAAI,6CAAoB,CACpC,cAAc,EACd,UAAU,EACV,WAAW,CACZ;YACD,YAAY,EAAE,cAAc;YAC5B,WAAW,EAAE,cAAc;YAC3B,UAAU,EAAE,cAAc;YAE1B,mEAAmE;YACnE,qEAAqE;YACrE,mEAAmE;YACnE,yDAAyD;YACzD,eAAe,EAAE,gCAAe,CAAC,EAAE;YAEnC,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC3B,YAAY,EAAE,QAAQ,KAAK,mBAAmB;gBAC9C,8CAA8C;gBAC9C,SAAS,EAAE,SAAS;aACrB,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;YACtB,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,oBAAW,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC;SACzE,CAAC,CAAA;IACJ,CAAC;CACF;AAtDD,4CAsDC"}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/oauth/provider.ts"],"names":[],"mappings":";;;AAAA,4DAIgC;AAIhC,sCAAuC;AAEvC,qEAA+D;AAY/D,MAAa,gBAAiB,SAAQ,8BAAa;IACjD,YAAY,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACN,aAAa,EACb,SAAS,GACW;QACpB,KAAK,CAAC;YACJ,MAAM;YACN,MAAM;YACN,UAAU;YACV,KAAK;YACL,SAAS;YACT,aAAa;YACb,QAAQ,EAAE;gBACR,wEAAwE;gBACxE,iEAAiE;gBACjE,uBAAuB;gBACvB,mBAAmB,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;gBAE7C,gBAAgB,EAAE,CAAC,oBAAoB,EAAE,sBAAsB,CAAC;aACjE;YAED,YAAY,EAAE,IAAI,6CAAoB,CACpC,cAAc,EACd,UAAU,EACV,WAAW,CACZ;YACD,YAAY,EAAE,cAAc;YAC5B,WAAW,EAAE,cAAc;YAC3B,UAAU,EAAE,cAAc;YAE1B,mEAAmE;YACnE,qEAAqE;YACrE,mEAAmE;YACnE,yDAAyD;YACzD,eAAe,EAAE,gCAAe,CAAC,EAAE;YAEnC,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC3B,YAAY,EAAE,QAAQ,KAAK,mBAAmB;gBAC9C,8CAA8C;gBAC9C,SAAS,EAAE,SAAS;aACrB,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;YACtB,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,oBAAW,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC;SACzE,CAAC,CAAA;IACJ,CAAC;CACF;AAxDD,4CAwDC"}
@@ -34,5 +34,6 @@ export declare const parseProxyRes: (res: Response) => Promise<{
34
34
  headers: Record<string, string>;
35
35
  }>;
36
36
  export declare const PRIVILEGED_METHODS: Set<string>;
37
+ export declare const PROTECTED_METHODS: Set<string>;
37
38
  export declare const parseRes: <T>(nsid: string, res: HandlerPipeThrough) => T;
38
39
  //# sourceMappingURL=pipethrough.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipethrough.d.ts","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":";;AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,QAAQ,EAA2B,MAAM,kBAAkB,CAAA;AACpE,OAAO,EACL,eAAe,EACf,kBAAkB,EAGnB,MAAM,sBAAsB,CAAA;AAK7B,OAAO,UAAU,MAAM,WAAW,CAAA;AAElC,eAAO,MAAM,YAAY,QAAS,UAAU,KAAG,eAwB9C,CAAA;AAED,eAAO,MAAM,WAAW,QACjB,UAAU,OACV,eAAe,aACT,MAAM,GAAG,IAAI,aACd;IACR,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,KACA,QAAQ,kBAAkB,CAO5B,CAAA;AAED,eAAO,MAAM,oBAAoB,QAC1B,UAAU,OACV,eAAe,aACT,MAAM,GAAG,IAAI,SACjB,QAAQ,KACd,QAAQ,kBAAkB,CAS5B,CAAA;AAYD,eAAO,MAAM,eAAe,QACrB,UAAU,OACV,eAAe,gBACN,MAAM,KACnB,QAAQ;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAcjD,CAAA;AAED,eAAO,MAAM,aAAa,QACnB,UAAU,OACV,eAAe,QACd;IACJ,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,KACA,QAAQ;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAapC,CAAA;AA6BD,eAAO,MAAM,gBAAgB,QAC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AAE,CAcjD,CAAA;AAED,eAAO,MAAM,aAAa,QACnB,UAAU,OACV,eAAe,QACd;IACJ,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,KACA,QAAQ;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAapC,CAAA;AA6BD,eAAO,MAAM,gBAAgB,QACtB,UAAU,OACV,eAAe,KACnB,QAAQ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAgBzD,CAAA;AAKD,eAAO,MAAM,WAAW,QACjB,GAAG,WACC,WAAW,KACnB,QAAQ,QAAQ,CAoBlB,CAAA;AAYD,eAAO,MAAM,YAAY,gBACV,QAAQ,UACb,gBAAgB,kBAwBzB,CAAA;AAED,eAAO,MAAM,aAAa,QAAe,QAAQ;;;;EAWhD,CAAA;AAKD,eAAO,MAAM,kBAAkB,aAgB7B,CAAA;AAKF,eAAO,MAAM,iBAAiB,aAgB5B,CAAA;AA8BF,eAAO,MAAM,QAAQ,YAAa,MAAM,OAAO,kBAAkB,KAAG,CAKnE,CAAA"}
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.parseRes = exports.PRIVILEGED_METHODS = exports.parseProxyRes = exports.pipeProxyRes = exports.makeRequest = exports.parseProxyHeader = exports.formatHeaders = exports.formatUrlAndAud = exports.pipethroughProcedure = exports.pipethrough = exports.proxyHandler = void 0;
29
+ exports.parseRes = exports.PROTECTED_METHODS = exports.PRIVILEGED_METHODS = exports.parseProxyRes = exports.pipeProxyRes = exports.makeRequest = exports.parseProxyHeader = exports.formatHeaders = exports.formatUrlAndAud = exports.pipethroughProcedure = exports.pipethrough = exports.proxyHandler = void 0;
30
30
  const ui8 = __importStar(require("uint8arrays"));
31
31
  const node_net_1 = __importDefault(require("node:net"));
32
32
  const node_stream_1 = __importDefault(require("node:stream"));
@@ -42,7 +42,8 @@ const proxyHandler = (ctx) => {
42
42
  try {
43
43
  const { url, aud, nsid } = await (0, exports.formatUrlAndAud)(ctx, req);
44
44
  const auth = await accessStandard({ req, res });
45
- if (!auth.credentials.isPrivileged && exports.PRIVILEGED_METHODS.has(nsid)) {
45
+ if (exports.PROTECTED_METHODS.has(nsid) ||
46
+ (!auth.credentials.isPrivileged && exports.PRIVILEGED_METHODS.has(nsid))) {
46
47
  throw new xrpc_server_1.InvalidRequestError('Bad token method', 'InvalidToken');
47
48
  }
48
49
  const headers = await (0, exports.formatHeaders)(ctx, req, {
@@ -247,6 +248,26 @@ exports.PRIVILEGED_METHODS = new Set([
247
248
  lexicons_1.ids.ChatBskyConvoUpdateRead,
248
249
  lexicons_1.ids.ComAtprotoServerCreateAccount,
249
250
  ]);
251
+ // These endpoints are related to account management and must be used directly,
252
+ // not proxied or service-authed. Service auth may be utilized between PDS and
253
+ // entryway for these methods.
254
+ exports.PROTECTED_METHODS = new Set([
255
+ lexicons_1.ids.ComAtprotoAdminSendEmail,
256
+ lexicons_1.ids.ComAtprotoIdentityRequestPlcOperationSignature,
257
+ lexicons_1.ids.ComAtprotoIdentitySignPlcOperation,
258
+ lexicons_1.ids.ComAtprotoIdentityUpdateHandle,
259
+ lexicons_1.ids.ComAtprotoServerActivateAccount,
260
+ lexicons_1.ids.ComAtprotoServerConfirmEmail,
261
+ lexicons_1.ids.ComAtprotoServerCreateAppPassword,
262
+ lexicons_1.ids.ComAtprotoServerDeactivateAccount,
263
+ lexicons_1.ids.ComAtprotoServerGetAccountInviteCodes,
264
+ lexicons_1.ids.ComAtprotoServerListAppPasswords,
265
+ lexicons_1.ids.ComAtprotoServerRequestAccountDelete,
266
+ lexicons_1.ids.ComAtprotoServerRequestEmailConfirmation,
267
+ lexicons_1.ids.ComAtprotoServerRequestEmailUpdate,
268
+ lexicons_1.ids.ComAtprotoServerRevokeAppPassword,
269
+ lexicons_1.ids.ComAtprotoServerUpdateEmail,
270
+ ]);
250
271
  const defaultService = (ctx, nsid) => {
251
272
  switch (nsid) {
252
273
  case lexicons_1.ids.ToolsOzoneTeamAddMember:
@@ -1 +1 @@
1
- {"version":3,"file":"pipethrough.js","sourceRoot":"","sources":["../src/pipethrough.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAAkC;AAClC,wDAA0B;AAC1B,8DAAgC;AAEhC,8CAAoE;AACpE,sDAK6B;AAC7B,wCAAuD;AACvD,4CAAqE;AACrE,iDAAkD;AAClD,qCAAqC;AAG9B,MAAM,YAAY,GAAG,CAAC,GAAe,EAAmB,EAAE;IAC/D,MAAM,cAAc,GAAG,GAAG,CAAC,YAAY,CAAC,cAAc,EAAE,CAAA;IACxD,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,uBAAe,EAAC,GAAG,EAAE,GAAG,CAAC,CAAA;YAC1D,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YAC/C,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,IAAI,0BAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnE,MAAM,IAAI,iCAAmB,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAA;YACnE,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,IAAA,qBAAa,EAAC,GAAG,EAAE,GAAG,EAAE;gBAC5C,GAAG;gBACH,GAAG,EAAE,IAAI;gBACT,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG;aAChC,CAAC,CAAA;YACF,MAAM,IAAI,GACR,qBAAM,CAAC,QAAQ,C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,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;IACnB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/pds",
3
- "version": "0.4.53",
3
+ "version": "0.4.55",
4
4
  "license": "MIT",
5
5
  "description": "Reference implementation of atproto Personal Data Server (PDS)",
6
6
  "keywords": [
@@ -44,17 +44,17 @@
44
44
  "uint8arrays": "3.0.0",
45
45
  "zod": "^3.23.8",
46
46
  "@atproto-labs/fetch-node": "0.1.0",
47
- "@atproto/api": "^0.13.3",
48
- "@atproto/aws": "^0.2.2",
47
+ "@atproto/api": "^0.13.4",
48
+ "@atproto/aws": "^0.2.3",
49
49
  "@atproto/common": "^0.4.1",
50
- "@atproto/crypto": "^0.4.0",
51
- "@atproto/identity": "^0.4.0",
50
+ "@atproto/crypto": "^0.4.1",
51
+ "@atproto/identity": "^0.4.1",
52
52
  "@atproto/lexicon": "^0.4.1",
53
- "@atproto/oauth-provider": "^0.1.3",
54
- "@atproto/repo": "^0.4.2",
53
+ "@atproto/oauth-provider": "^0.2.1",
54
+ "@atproto/repo": "^0.4.3",
55
55
  "@atproto/syntax": "^0.3.0",
56
- "@atproto/xrpc": "^0.6.0",
57
- "@atproto/xrpc-server": "^0.6.2"
56
+ "@atproto/xrpc": "^0.6.1",
57
+ "@atproto/xrpc-server": "^0.6.3"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@atproto/pds-entryway": "npm:@atproto/pds@0.3.0-entryway.3",
@@ -72,8 +72,8 @@
72
72
  "jest": "^28.1.2",
73
73
  "ts-node": "^10.8.2",
74
74
  "ws": "^8.12.0",
75
- "@atproto/api": "^0.13.3",
76
- "@atproto/bsky": "^0.0.78",
75
+ "@atproto/api": "^0.13.4",
76
+ "@atproto/bsky": "^0.0.79",
77
77
  "@atproto/lex-cli": "^0.5.0"
78
78
  },
79
79
  "scripts": {
@@ -46,7 +46,10 @@ export const createAccessToken = (opts: {
46
46
  expiresIn = '120mins',
47
47
  } = opts
48
48
  const signer = new jose.SignJWT({ scope })
49
- .setProtectedHeader({ alg: 'HS256' }) // only symmetric keys supported
49
+ .setProtectedHeader({
50
+ typ: 'at+jwt', // https://www.rfc-editor.org/rfc/rfc9068.html
51
+ alg: 'HS256', // only symmetric keys supported
52
+ })
50
53
  .setAudience(serviceDid)
51
54
  .setSubject(did)
52
55
  .setIssuedAt()
@@ -69,7 +72,10 @@ export const createRefreshToken = (opts: {
69
72
  expiresIn = '90days',
70
73
  } = opts
71
74
  const signer = new jose.SignJWT({ scope: AuthScope.Refresh })
72
- .setProtectedHeader({ alg: 'HS256' }) // only symmetric keys supported
75
+ .setProtectedHeader({
76
+ typ: 'refresh+jwt',
77
+ alg: 'HS256', // only symmetric keys supported
78
+ })
73
79
  .setAudience(serviceDid)
74
80
  .setSubject(did)
75
81
  .setJti(jti)
@@ -26,14 +26,14 @@ export default function (server: Server, ctx: AppContext) {
26
26
  if (ctx.entrywayAgent) {
27
27
  assert(ctx.cfg.entryway)
28
28
  return resultPassthru(
29
- await ctx.entrywayAgent.com.atproto.admin.sendEmail(input.body, {
30
- encoding: 'application/json',
31
- ...(await ctx.serviceAuthHeaders(
29
+ await ctx.entrywayAgent.com.atproto.admin.sendEmail(
30
+ input.body,
31
+ await ctx.serviceAuthHeaders(
32
32
  recipientDid,
33
33
  ctx.cfg.entryway.did,
34
34
  ids.ComAtprotoAdminSendEmail,
35
- )),
36
- }),
35
+ ),
36
+ ),
37
37
  )
38
38
  }
39
39
 
@@ -1,7 +1,7 @@
1
1
  import { InvalidRequestError } from '@atproto/xrpc-server'
2
2
  import { Server } from '../../../../lexicon'
3
3
  import AppContext from '../../../../context'
4
- import { authPassthru } from '../../../proxy'
4
+ import { authPassthru } from './util'
5
5
 
6
6
  export default function (server: Server, ctx: AppContext) {
7
7
  server.com.atproto.admin.updateAccountEmail({
@@ -1,6 +1,6 @@
1
1
  import { Server } from '../../../../lexicon'
2
2
  import AppContext from '../../../../context'
3
- import { authPassthru } from '../../../proxy'
3
+ import { authPassthru } from './util'
4
4
 
5
5
  export default function (server: Server, ctx: AppContext) {
6
6
  server.com.atproto.admin.updateAccountPassword({
@@ -1,16 +1,24 @@
1
- import { Server } from '../../../../lexicon'
2
- import AppContext from '../../../../context'
1
+ import assert from 'node:assert'
2
+
3
3
  import { InvalidRequestError } from '@atproto/xrpc-server'
4
- import { authPassthru } from '../../../proxy'
4
+
5
+ import AppContext from '../../../../context'
6
+ import { Server } from '../../../../lexicon'
7
+ import { ids } from '../../../../lexicon/lexicons'
5
8
 
6
9
  export default function (server: Server, ctx: AppContext) {
7
10
  server.com.atproto.identity.requestPlcOperationSignature({
8
11
  auth: ctx.authVerifier.accessFull(),
9
- handler: async ({ auth, req }) => {
12
+ handler: async ({ auth }) => {
10
13
  if (ctx.entrywayAgent) {
14
+ assert(ctx.cfg.entryway)
11
15
  await ctx.entrywayAgent.com.atproto.identity.requestPlcOperationSignature(
12
16
  undefined,
13
- authPassthru(req),
17
+ await ctx.serviceAuthHeaders(
18
+ auth.credentials.did,
19
+ ctx.cfg.entryway.did,
20
+ ids.ComAtprotoIdentityRequestPlcOperationSignature,
21
+ ),
14
22
  )
15
23
  return
16
24
  }
@@ -1,19 +1,28 @@
1
- import { Server } from '../../../../lexicon'
2
- import AppContext from '../../../../context'
3
- import * as plc from '@did-plc/lib'
1
+ import assert from 'node:assert'
2
+
4
3
  import { check } from '@atproto/common'
5
4
  import { InvalidRequestError } from '@atproto/xrpc-server'
6
- import { authPassthru, resultPassthru } from '../../../proxy'
5
+ import * as plc from '@did-plc/lib'
6
+
7
+ import AppContext from '../../../../context'
8
+ import { Server } from '../../../../lexicon'
9
+ import { ids } from '../../../../lexicon/lexicons'
10
+ import { resultPassthru } from '../../../proxy'
7
11
 
8
12
  export default function (server: Server, ctx: AppContext) {
9
13
  server.com.atproto.identity.signPlcOperation({
10
14
  auth: ctx.authVerifier.accessFull(),
11
- handler: async ({ auth, input, req }) => {
15
+ handler: async ({ auth, input }) => {
12
16
  if (ctx.entrywayAgent) {
17
+ assert(ctx.cfg.entryway)
13
18
  return resultPassthru(
14
19
  await ctx.entrywayAgent.com.atproto.identity.signPlcOperation(
15
20
  input.body,
16
- authPassthru(req, true),
21
+ await ctx.serviceAuthHeaders(
22
+ auth.credentials.did,
23
+ ctx.cfg.entryway.did,
24
+ ids.ComAtprotoIdentitySignPlcOperation,
25
+ ),
17
26
  ),
18
27
  )
19
28
  }
@@ -1,10 +1,11 @@
1
+ import assert from 'node:assert'
1
2
  import { InvalidRequestError } from '@atproto/xrpc-server'
2
3
  import { DAY, MINUTE } from '@atproto/common'
3
4
  import { normalizeAndValidateHandle } from '../../../../handle'
4
5
  import { Server } from '../../../../lexicon'
5
6
  import AppContext from '../../../../context'
6
7
  import { httpLogger } from '../../../../logger'
7
- import { authPassthru } from '../../../proxy'
8
+ import { ids } from '../../../../lexicon/lexicons'
8
9
 
9
10
  export default function (server: Server, ctx: AppContext) {
10
11
  server.com.atproto.identity.updateHandle({
@@ -21,16 +22,22 @@ export default function (server: Server, ctx: AppContext) {
21
22
  calcKey: ({ auth }) => auth.credentials.did,
22
23
  },
23
24
  ],
24
- handler: async ({ auth, input, req }) => {
25
+ handler: async ({ auth, input }) => {
25
26
  const requester = auth.credentials.did
26
27
 
27
28
  if (ctx.entrywayAgent) {
29
+ assert(ctx.cfg.entryway)
30
+
28
31
  // the full flow is:
29
32
  // -> entryway(identity.updateHandle) [update handle, submit plc op]
30
33
  // -> pds(admin.updateAccountHandle) [track handle, sequence handle update]
31
34
  await ctx.entrywayAgent.com.atproto.identity.updateHandle(
32
35
  { did: requester, handle: input.body.handle },
33
- authPassthru(req, true),
36
+ await ctx.serviceAuthHeaders(
37
+ auth.credentials.did,
38
+ ctx.cfg.entryway.did,
39
+ ids.ComAtprotoIdentityUpdateHandle,
40
+ ),
34
41
  )
35
42
  return
36
43
  }
@@ -1,20 +1,29 @@
1
+ import assert from 'node:assert'
2
+
1
3
  import { CidSet } from '@atproto/repo'
2
- import { InvalidRequestError } from '@atproto/xrpc-server'
3
4
  import { INVALID_HANDLE } from '@atproto/syntax'
4
- import { Server } from '../../../../lexicon'
5
+ import { InvalidRequestError } from '@atproto/xrpc-server'
6
+
5
7
  import AppContext from '../../../../context'
8
+ import { Server } from '../../../../lexicon'
9
+ import { ids } from '../../../../lexicon/lexicons'
6
10
  import { assertValidDidDocumentForService } from './util'
7
- import { authPassthru } from '../../../proxy'
8
11
 
9
12
  export default function (server: Server, ctx: AppContext) {
10
13
  server.com.atproto.server.activateAccount({
11
14
  auth: ctx.authVerifier.accessFull(),
12
- handler: async ({ auth, req }) => {
15
+ handler: async ({ auth }) => {
13
16
  // in the case of entryway, the full flow is activateAccount (PDS) -> activateAccount (Entryway) -> updateSubjectStatus(PDS)
14
17
  if (ctx.entrywayAgent) {
18
+ assert(ctx.cfg.entryway)
19
+
15
20
  await ctx.entrywayAgent.com.atproto.server.activateAccount(
16
21
  undefined,
17
- authPassthru(req),
22
+ await ctx.serviceAuthHeaders(
23
+ auth.credentials.did,
24
+ ctx.cfg.entryway.did,
25
+ ids.ComAtprotoServerActivateAccount,
26
+ ),
18
27
  )
19
28
  return
20
29
  }
@@ -1,12 +1,15 @@
1
- import { Server } from '../../../../lexicon'
2
- import AppContext from '../../../../context'
1
+ import assert from 'node:assert'
2
+
3
3
  import { InvalidRequestError } from '@atproto/xrpc-server'
4
- import { authPassthru } from '../../../proxy'
4
+
5
+ import AppContext from '../../../../context'
6
+ import { Server } from '../../../../lexicon'
7
+ import { ids } from '../../../../lexicon/lexicons'
5
8
 
6
9
  export default function (server: Server, ctx: AppContext) {
7
10
  server.com.atproto.server.confirmEmail({
8
11
  auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
9
- handler: async ({ auth, input, req }) => {
12
+ handler: async ({ auth, input }) => {
10
13
  const did = auth.credentials.did
11
14
 
12
15
  const user = await ctx.accountManager.getAccount(did, {
@@ -17,9 +20,14 @@ export default function (server: Server, ctx: AppContext) {
17
20
  }
18
21
 
19
22
  if (ctx.entrywayAgent) {
23
+ assert(ctx.cfg.entryway)
20
24
  await ctx.entrywayAgent.com.atproto.server.confirmEmail(
21
25
  input.body,
22
- authPassthru(req, true),
26
+ await ctx.serviceAuthHeaders(
27
+ auth.credentials.did,
28
+ ctx.cfg.entryway.did,
29
+ ids.ComAtprotoServerConfirmEmail,
30
+ ),
23
31
  )
24
32
  return
25
33
  }
@@ -1,18 +1,27 @@
1
+ import assert from 'node:assert'
2
+
1
3
  import AppContext from '../../../../context'
2
4
  import { Server } from '../../../../lexicon'
3
- import { authPassthru, resultPassthru } from '../../../proxy'
5
+ import { ids } from '../../../../lexicon/lexicons'
6
+ import { resultPassthru } from '../../../proxy'
4
7
 
5
8
  export default function (server: Server, ctx: AppContext) {
6
9
  server.com.atproto.server.createAppPassword({
7
10
  auth: ctx.authVerifier.accessFull({
8
11
  checkTakedown: true,
9
12
  }),
10
- handler: async ({ auth, input, req }) => {
13
+ handler: async ({ auth, input }) => {
11
14
  if (ctx.entrywayAgent) {
15
+ assert(ctx.cfg.entryway)
16
+
12
17
  return resultPassthru(
13
18
  await ctx.entrywayAgent.com.atproto.server.createAppPassword(
14
19
  input.body,
15
- authPassthru(req, true),
20
+ await ctx.serviceAuthHeaders(
21
+ auth.credentials.did,
22
+ ctx.cfg.entryway.did,
23
+ ids.ComAtprotoServerCreateAppPassword,
24
+ ),
16
25
  ),
17
26
  )
18
27
  }
@@ -1,16 +1,23 @@
1
- import { Server } from '../../../../lexicon'
1
+ import assert from 'node:assert'
2
+
2
3
  import AppContext from '../../../../context'
3
- import { authPassthru } from '../../../proxy'
4
+ import { Server } from '../../../../lexicon'
5
+ import { ids } from '../../../../lexicon/lexicons'
4
6
 
5
7
  export default function (server: Server, ctx: AppContext) {
6
8
  server.com.atproto.server.deactivateAccount({
7
9
  auth: ctx.authVerifier.accessFull(),
8
- handler: async ({ auth, input, req }) => {
10
+ handler: async ({ auth, input }) => {
9
11
  // in the case of entryway, the full flow is deactivateAccount (PDS) -> deactivateAccount (Entryway) -> updateSubjectStatus(PDS)
10
12
  if (ctx.entrywayAgent) {
13
+ assert(ctx.cfg.entryway)
11
14
  await ctx.entrywayAgent.com.atproto.server.deactivateAccount(
12
15
  input.body,
13
- authPassthru(req, true),
16
+ await ctx.serviceAuthHeaders(
17
+ auth.credentials.did,
18
+ ctx.cfg.entryway.did,
19
+ ids.ComAtprotoServerDeactivateAccount,
20
+ ),
14
21
  )
15
22
  return
16
23
  }
@@ -1,19 +1,28 @@
1
+ import assert from 'node:assert'
2
+
1
3
  import { InvalidRequestError } from '@atproto/xrpc-server'
2
- import { Server } from '../../../../lexicon'
4
+
5
+ import { CodeDetail } from '../../../../account-manager/helpers/invite'
3
6
  import AppContext from '../../../../context'
7
+ import { Server } from '../../../../lexicon'
8
+ import { resultPassthru } from '../../../proxy'
4
9
  import { genInvCodes } from './util'
5
- import { CodeDetail } from '../../../../account-manager/helpers/invite'
6
- import { authPassthru, resultPassthru } from '../../../proxy'
10
+ import { ids } from '../../../../lexicon/lexicons'
7
11
 
8
12
  export default function (server: Server, ctx: AppContext) {
9
13
  server.com.atproto.server.getAccountInviteCodes({
10
14
  auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
11
- handler: async ({ params, auth, req }) => {
15
+ handler: async ({ params, auth }) => {
12
16
  if (ctx.entrywayAgent) {
17
+ assert(ctx.cfg.entryway)
13
18
  return resultPassthru(
14
19
  await ctx.entrywayAgent.com.atproto.server.getAccountInviteCodes(
15
20
  params,
16
- authPassthru(req),
21
+ await ctx.serviceAuthHeaders(
22
+ auth.credentials.did,
23
+ ctx.cfg.entryway.did,
24
+ ids.ComAtprotoServerGetAccountInviteCodes,
25
+ ),
17
26
  ),
18
27
  )
19
28
  }
@@ -2,7 +2,7 @@ import { InvalidRequestError, createServiceJwt } from '@atproto/xrpc-server'
2
2
  import { HOUR, MINUTE } from '@atproto/common'
3
3
  import AppContext from '../../../../context'
4
4
  import { Server } from '../../../../lexicon'
5
- import { PRIVILEGED_METHODS } from '../../../../pipethrough'
5
+ import { PRIVILEGED_METHODS, PROTECTED_METHODS } from '../../../../pipethrough'
6
6
 
7
7
  export default function (server: Server, ctx: AppContext) {
8
8
  server.com.atproto.server.getServiceAuth({
@@ -30,15 +30,20 @@ export default function (server: Server, ctx: AppContext) {
30
30
  )
31
31
  }
32
32
  }
33
- if (
34
- !auth.credentials.isPrivileged &&
35
- lxm &&
36
- PRIVILEGED_METHODS.has(lxm)
37
- ) {
38
- throw new InvalidRequestError(
39
- `cannot request a service auth token for the following method with an app password: ${lxm}`,
40
- )
33
+
34
+ if (lxm) {
35
+ if (PROTECTED_METHODS.has(lxm)) {
36
+ throw new InvalidRequestError(
37
+ `cannot request a service auth token for the following protected method: ${lxm}`,
38
+ )
39
+ }
40
+ if (!auth.credentials.isPrivileged && PRIVILEGED_METHODS.has(lxm)) {
41
+ throw new InvalidRequestError(
42
+ `insufficient access to request a service auth token for the following method: ${lxm}`,
43
+ )
44
+ }
41
45
  }
46
+
42
47
  const keypair = await ctx.actorStore.keypair(did)
43
48
 
44
49
  const token = await createServiceJwt({
@@ -1,16 +1,24 @@
1
+ import assert from 'node:assert'
2
+
1
3
  import AppContext from '../../../../context'
2
4
  import { Server } from '../../../../lexicon'
3
- import { authPassthru, resultPassthru } from '../../../proxy'
5
+ import { ids } from '../../../../lexicon/lexicons'
6
+ import { resultPassthru } from '../../../proxy'
4
7
 
5
8
  export default function (server: Server, ctx: AppContext) {
6
9
  server.com.atproto.server.listAppPasswords({
7
10
  auth: ctx.authVerifier.accessStandard(),
8
- handler: async ({ auth, req }) => {
11
+ handler: async ({ auth }) => {
9
12
  if (ctx.entrywayAgent) {
13
+ assert(ctx.cfg.entryway)
10
14
  return resultPassthru(
11
15
  await ctx.entrywayAgent.com.atproto.server.listAppPasswords(
12
16
  undefined,
13
- authPassthru(req),
17
+ await ctx.serviceAuthHeaders(
18
+ auth.credentials.did,
19
+ ctx.cfg.entryway.did,
20
+ ids.ComAtprotoServerListAppPasswords,
21
+ ),
14
22
  ),
15
23
  )
16
24
  }